diff options
author | Stuart Herbert <stuart@gentoo.org> | 2005-09-04 09:47:51 +0000 |
---|---|---|
committer | Stuart Herbert <stuart@gentoo.org> | 2005-09-04 09:47:51 +0000 |
commit | e51fb2a9abb6abdbe716d43d44400316dea68a8a (patch) | |
tree | 934d9eea3725fbce27698bf63258f3a8cdb36aaf /app-admin | |
parent | Added ~sh (diff) | |
download | gentoo-2-e51fb2a9abb6abdbe716d43d44400316dea68a8a.tar.gz gentoo-2-e51fb2a9abb6abdbe716d43d44400316dea68a8a.tar.bz2 gentoo-2-e51fb2a9abb6abdbe716d43d44400316dea68a8a.zip |
Initial import from PHP overlay
(Portage version: 2.0.51.22-r2)
Diffstat (limited to 'app-admin')
-rw-r--r-- | app-admin/eselect-php/ChangeLog | 7 | ||||
-rw-r--r-- | app-admin/eselect-php/Manifest | 7 | ||||
-rw-r--r-- | app-admin/eselect-php/eselect-php-0.96.ebuild | 22 | ||||
-rw-r--r-- | app-admin/eselect-php/files/digest-eselect-php-0.96 | 0 | ||||
-rw-r--r-- | app-admin/eselect-php/files/php-cgi.eselect | 196 | ||||
-rw-r--r-- | app-admin/eselect-php/files/php-devel.eselect | 196 | ||||
-rw-r--r-- | app-admin/eselect-php/files/php.eselect | 196 | ||||
-rw-r--r-- | app-admin/eselect-php/metadata.xml | 5 |
8 files changed, 629 insertions, 0 deletions
diff --git a/app-admin/eselect-php/ChangeLog b/app-admin/eselect-php/ChangeLog new file mode 100644 index 000000000000..60b4a1ef1a28 --- /dev/null +++ b/app-admin/eselect-php/ChangeLog @@ -0,0 +1,7 @@ +# ChangeLog for app-admin/eselect-php +# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-php/ChangeLog,v 1.1 2005/09/04 09:47:51 stuart Exp $ + + 4 Sept 2005; <stuart@gentoo.org> ChangeLog: + Initial import + diff --git a/app-admin/eselect-php/Manifest b/app-admin/eselect-php/Manifest new file mode 100644 index 000000000000..a6c6dcf3aa3d --- /dev/null +++ b/app-admin/eselect-php/Manifest @@ -0,0 +1,7 @@ +MD5 c58d07ca1c1235bbad9bccaec96fc062 metadata.xml 157 +MD5 8246a1261b855e8a75c28c64e8f16f4c ChangeLog 186 +MD5 41ba19e3ddff51947a010402b69f446a eselect-php-0.96.ebuild 549 +MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-eselect-php-0.96 0 +MD5 56b1b73b5930d81021e0c0005a6656eb files/php-devel.eselect 4295 +MD5 d6d69edb299e5b3f80608655cf30765c files/php-cgi.eselect 4283 +MD5 c852cc2b3c6a01fb3383b25bb8cfe6b3 files/php.eselect 4275 diff --git a/app-admin/eselect-php/eselect-php-0.96.ebuild b/app-admin/eselect-php/eselect-php-0.96.ebuild new file mode 100644 index 000000000000..2eeac7f9695f --- /dev/null +++ b/app-admin/eselect-php/eselect-php-0.96.ebuild @@ -0,0 +1,22 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-php/eselect-php-0.96.ebuild,v 1.1 2005/09/04 09:47:51 stuart Exp $ + +inherit eutils + +DESCRIPTION="PHP modules for eselect." +HOMEPAGE="http://svn.gnqs.org/projects/gentoo-php-overlay/wiki/InstallPhpEselectModules" +SRC_URI="" +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~x86 ~ppc" +IUSE="" +DEPEND="app-admin/eselect" + +src_install() { + dodir /usr/share/eselect/modules + insinto /usr/share/eselect/modules + doins ${FILESDIR}/php.eselect + doins ${FILESDIR}/php-cgi.eselect + doins ${FILESDIR}/php-devel.eselect +} diff --git a/app-admin/eselect-php/files/digest-eselect-php-0.96 b/app-admin/eselect-php/files/digest-eselect-php-0.96 new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/app-admin/eselect-php/files/digest-eselect-php-0.96 diff --git a/app-admin/eselect-php/files/php-cgi.eselect b/app-admin/eselect-php/files/php-cgi.eselect new file mode 100644 index 000000000000..1926132fd7ea --- /dev/null +++ b/app-admin/eselect-php/files/php-cgi.eselect @@ -0,0 +1,196 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: php-cgi.eselect,v 1.1 2005/09/04 09:47:51 stuart Exp $ + +DESCRIPTION="Manage the /usr/bin/php link" +MAINTAINER="stuart@gentoo.org" +SVN_DATE='$Date: 2005/09/04 09:47:51 $' +VERSION=$(svn_date_to_version "${SVN_DATE}" ) + +PHP_SYMLINK_TARGETDIR="${ROOT}/usr/bin" +PHP_SYMLINK_APPLIST=( php-cgi ) +PHP_VERSIONS="4 5 6" +PHP_HELP="php-cgi" + +find_libdir() { + # where has multilib put the native php binary? + for x in lib64 lib32 lib ; do + for y in ${PHP_VERSIONS} ; do + if test -d /usr/${x}/php${y}/bin ; then + libdir=${x} + return + fi + done + done + + # if we get here, then we can't find where PHP is installed + # throw in any old default - it doesn't matter, because there's + # no PHP anyway + + libdir=/usr/lib +} + +find_versions() { + find_libdir + + # how many packages are we looking for? + musthave=${#PHP_SYMLINK_APPLIST[@]} + + for f in $PHP_VERSIONS ; do + (( dohave = 0 )) + for (( i = 0 ; i < ${#PHP_SYMLINK_APPLIST[@]} ; i = i + 1 )) ; do + n=${PHP_SYMLINK_APPLIST[$i]} + [[ -f ${ROOT}/usr/${libdir}/php${f}/bin/${n} ]] && (( dohave = $dohave + 1 )) + done + + if (( $dohave == $musthave )) ; then + echo "php${f}" + fi + done +} + +# try to remove the php symlink +# +# $1 - symlink to remove + +remove_symlink() { + [[ -L ${1} ]] && rm -f ${1} +} + +# set the php symlink +# +# $1 - symlink to set +# $2 - php version to set it to + +set_symlink() { + PHP_BASENAME=`basename ${1}` + + find_libdir + target="${ROOT}/usr/${libdir}/$2/bin/`basename $1`" + + pushd "`dirname $1`" 1>/dev/null + ln -s "${target}" "${PHP_BASENAME}" + popd 1>/dev/null +} + +# work out which PHP version the user has chosen from the list +# +# $1: the list id that the user has chosen + +get_phpversion_fromlist () { + version=$1 + + versions=( $(find_versions) ) + for (( i = 0 ; i < ${#versions[@]} ; i = i + 1 )) ; do + if [[ ${versions[$i]} == ${version} ]] ; then + echo ${version} + return + fi + done + + echo "(not-found)" +} + +get_phpversion_fromlink () { + echo $1 | sed -e 's|.*/\(php[0-9]\+\)/.*|\1|;' +} + +get_current_phpversion () { + link=$(readlink ${PHP_SYMLINK_TARGETDIR}/${PHP_SYMLINK_APPLIST[0]}) + version=$(get_phpversion_fromlink $link) + + [[ -z "$version" ]] && version="(unset)" + echo $version +} + +# $1: basename of target app +# $2: php version to use + +set_current_phpversion() { + PHP_SYMLINK_REALTARGET="${PHP_SYMLINK_TARGETDIR}/$1" + + if [[ -e ${PHP_SYMLINK_REALTARGET} ]] ; then + # the target file exists + # question is - is it a symlink, or something else? + + if [[ ! -L ${PHP_SYMLINK_REALTARGET} ]] ; then + # it is something else + # + # be cautious - do not remove it + die -q "${PHP_SYMLINK_REALTARGET} exists, but is not a symlink" + fi + fi + + if [[ -L ${PHP_SYMLINK_REALTARGET} ]] ; then + # existing symlink + if ! remove_symlink ${PHP_SYMLINK_REALTARGET} ; then + die -q "Couldn't remove existing symlink" + fi + fi + + if ! set_symlink ${PHP_SYMLINK_REALTARGET} "${2}" ; then + die -q "Couldn't set a new symlink" + fi +} + +### show action ### + +describe_show() { + echo "Show the current PHP version for ${PHP_HELP}" +} + +do_show() { + write_list_start "Current PHP version:" + version=$(get_current_phpversion) + write_kv_list_entry "$version" "" +} + +### list action ### + +describe_list() { + echo "List available PHP versions to link to" +} + +do_list() { + versions=( $(find_versions ) ) + current=$(get_current_phpversion) + + write_list_start "Available PHP versions:" + + if [[ -n ${versions[@]} ]] ; then + local i + for (( i = 0 ; i < ${#versions[@]} ; i = i + 1 )) ; do + linkversion=${versions[${i}]} + + [[ $linkversion == $current ]] && \ + versions[${i}]="${versions[${i}]} $(highlight '*' )" + done + write_numbered_list "${versions[@]}" + else + write_kv_list_entry "(none found)" "" + fi +} + +### set action ### + +describe_set() { + echo "Set PHP version used" +} + +do_set() { + if [[ -z ${1} ]] ; then + # no parameter + die -q "You didn't tell me which version of PHP to use" + fi + + version=$(get_phpversion_fromlist $1) + if [[ ${version} == "(not-found)" ]] ; then + die -q "I don't recognise that version of PHP" + fi + + for (( i = 0 ; i < ${#PHP_SYMLINK_APPLIST[@]} ; i = i + 1 )) ; do + set_current_phpversion ${PHP_SYMLINK_APPLIST[$i]} ${version} + done +} + +# vim: set ft=eselect : diff --git a/app-admin/eselect-php/files/php-devel.eselect b/app-admin/eselect-php/files/php-devel.eselect new file mode 100644 index 000000000000..524120cbc809 --- /dev/null +++ b/app-admin/eselect-php/files/php-devel.eselect @@ -0,0 +1,196 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: php-devel.eselect,v 1.1 2005/09/04 09:47:51 stuart Exp $ + +DESCRIPTION="Manage the /usr/bin/php link" +MAINTAINER="stuart@gentoo.org" +SVN_DATE='$Date: 2005/09/04 09:47:51 $' +VERSION=$(svn_date_to_version "${SVN_DATE}" ) + +PHP_SYMLINK_TARGETDIR="${ROOT}/usr/bin" +PHP_SYMLINK_APPLIST=( php-config phpize ) +PHP_VERSIONS="4 5 6" +PHP_HELP="php-devel" + +find_libdir() { + # where has multilib put the native php binary? + for x in lib64 lib32 lib ; do + for y in ${PHP_VERSIONS} ; do + if test -d /usr/${x}/php${y}/bin ; then + libdir=${x} + return + fi + done + done + + # if we get here, then we can't find where PHP is installed + # throw in any old default - it doesn't matter, because there's + # no PHP anyway + + libdir=/usr/lib +} + +find_versions() { + find_libdir + + # how many packages are we looking for? + musthave=${#PHP_SYMLINK_APPLIST[@]} + + for f in $PHP_VERSIONS ; do + (( dohave = 0 )) + for (( i = 0 ; i < ${#PHP_SYMLINK_APPLIST[@]} ; i = i + 1 )) ; do + n=${PHP_SYMLINK_APPLIST[$i]} + [[ -f ${ROOT}/usr/${libdir}/php${f}/bin/${n} ]] && (( dohave = $dohave + 1 )) + done + + if (( $dohave == $musthave )) ; then + echo "php${f}" + fi + done +} + +# try to remove the php symlink +# +# $1 - symlink to remove + +remove_symlink() { + [[ -L ${1} ]] && rm -f ${1} +} + +# set the php symlink +# +# $1 - symlink to set +# $2 - php version to set it to + +set_symlink() { + PHP_BASENAME=`basename ${1}` + + find_libdir + target="${ROOT}/usr/${libdir}/$2/bin/`basename $1`" + + pushd "`dirname $1`" 1>/dev/null + ln -s "${target}" "${PHP_BASENAME}" + popd 1>/dev/null +} + +# work out which PHP version the user has chosen from the list +# +# $1: the list id that the user has chosen + +get_phpversion_fromlist () { + version=$1 + + versions=( $(find_versions) ) + for (( i = 0 ; i < ${#versions[@]} ; i = i + 1 )) ; do + if [[ ${versions[$i]} == ${version} ]] ; then + echo ${version} + return + fi + done + + echo "(not-found)" +} + +get_phpversion_fromlink () { + echo $1 | sed -e 's|.*/\(php[0-9]\+\)/.*|\1|;' +} + +get_current_phpversion () { + link=$(readlink ${PHP_SYMLINK_TARGETDIR}/${PHP_SYMLINK_APPLIST[0]}) + version=$(get_phpversion_fromlink $link) + + [[ -z "$version" ]] && version="(unset)" + echo $version +} + +# $1: basename of target app +# $2: php version to use + +set_current_phpversion() { + PHP_SYMLINK_REALTARGET="${PHP_SYMLINK_TARGETDIR}/$1" + + if [[ -e ${PHP_SYMLINK_REALTARGET} ]] ; then + # the target file exists + # question is - is it a symlink, or something else? + + if [[ ! -L ${PHP_SYMLINK_REALTARGET} ]] ; then + # it is something else + # + # be cautious - do not remove it + die -q "${PHP_SYMLINK_REALTARGET} exists, but is not a symlink" + fi + fi + + if [[ -L ${PHP_SYMLINK_REALTARGET} ]] ; then + # existing symlink + if ! remove_symlink ${PHP_SYMLINK_REALTARGET} ; then + die -q "Couldn't remove existing symlink" + fi + fi + + if ! set_symlink ${PHP_SYMLINK_REALTARGET} "${2}" ; then + die -q "Couldn't set a new symlink" + fi +} + +### show action ### + +describe_show() { + echo "Show the current PHP version for ${PHP_HELP}" +} + +do_show() { + write_list_start "Current PHP version:" + version=$(get_current_phpversion) + write_kv_list_entry "$version" "" +} + +### list action ### + +describe_list() { + echo "List available PHP versions to link to" +} + +do_list() { + versions=( $(find_versions ) ) + current=$(get_current_phpversion) + + write_list_start "Available PHP versions:" + + if [[ -n ${versions[@]} ]] ; then + local i + for (( i = 0 ; i < ${#versions[@]} ; i = i + 1 )) ; do + linkversion=${versions[${i}]} + + [[ $linkversion == $current ]] && \ + versions[${i}]="${versions[${i}]} $(highlight '*' )" + done + write_numbered_list "${versions[@]}" + else + write_kv_list_entry "(none found)" "" + fi +} + +### set action ### + +describe_set() { + echo "Set PHP version used" +} + +do_set() { + if [[ -z ${1} ]] ; then + # no parameter + die -q "You didn't tell me which version of PHP to use" + fi + + version=$(get_phpversion_fromlist $1) + if [[ ${version} == "(not-found)" ]] ; then + die -q "I don't recognise that version of PHP" + fi + + for (( i = 0 ; i < ${#PHP_SYMLINK_APPLIST[@]} ; i = i + 1 )) ; do + set_current_phpversion ${PHP_SYMLINK_APPLIST[$i]} ${version} + done +} + +# vim: set ft=eselect : diff --git a/app-admin/eselect-php/files/php.eselect b/app-admin/eselect-php/files/php.eselect new file mode 100644 index 000000000000..3742b4b40b49 --- /dev/null +++ b/app-admin/eselect-php/files/php.eselect @@ -0,0 +1,196 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: php.eselect,v 1.1 2005/09/04 09:47:51 stuart Exp $ + +DESCRIPTION="Manage the /usr/bin/php link" +MAINTAINER="stuart@gentoo.org" +SVN_DATE='$Date: 2005/09/04 09:47:51 $' +VERSION=$(svn_date_to_version "${SVN_DATE}" ) + +PHP_SYMLINK_TARGETDIR="${ROOT}/usr/bin" +PHP_SYMLINK_APPLIST=( php ) +PHP_VERSIONS="4 5 6" +PHP_HELP="php" + +find_libdir() { + # where has multilib put the native php binary? + for x in lib64 lib32 lib ; do + for y in ${PHP_VERSIONS} ; do + if test -d /usr/${x}/php${y}/bin ; then + libdir=${x} + return + fi + done + done + + # if we get here, then we can't find where PHP is installed + # throw in any old default - it doesn't matter, because there's + # no PHP anyway + + libdir=/usr/lib +} + +find_versions() { + find_libdir + + # how many packages are we looking for? + musthave=${#PHP_SYMLINK_APPLIST[@]} + + for f in $PHP_VERSIONS ; do + (( dohave = 0 )) + for (( i = 0 ; i < ${#PHP_SYMLINK_APPLIST[@]} ; i = i + 1 )) ; do + n=${PHP_SYMLINK_APPLIST[$i]} + [[ -f ${ROOT}/usr/${libdir}/php${f}/bin/${n} ]] && (( dohave = $dohave + 1 )) + done + + if (( $dohave == $musthave )) ; then + echo "php${f}" + fi + done +} + +# try to remove the php symlink +# +# $1 - symlink to remove + +remove_symlink() { + [[ -L ${1} ]] && rm -f ${1} +} + +# set the php symlink +# +# $1 - symlink to set +# $2 - php version to set it to + +set_symlink() { + PHP_BASENAME=`basename ${1}` + + find_libdir + target="${ROOT}/usr/${libdir}/$2/bin/`basename $1`" + + pushd "`dirname $1`" 1>/dev/null + ln -s "${target}" "${PHP_BASENAME}" + popd 1>/dev/null +} + +# work out which PHP version the user has chosen from the list +# +# $1: the list id that the user has chosen + +get_phpversion_fromlist () { + version=$1 + + versions=( $(find_versions) ) + for (( i = 0 ; i < ${#versions[@]} ; i = i + 1 )) ; do + if [[ ${versions[$i]} == ${version} ]] ; then + echo ${version} + return + fi + done + + echo "(not-found)" +} + +get_phpversion_fromlink () { + echo $1 | sed -e 's|.*/\(php[0-9]\+\)/.*|\1|;' +} + +get_current_phpversion () { + link=$(readlink ${PHP_SYMLINK_TARGETDIR}/${PHP_SYMLINK_APPLIST[0]}) + version=$(get_phpversion_fromlink $link) + + [[ -z "$version" ]] && version="(unset)" + echo $version +} + +# $1: basename of target app +# $2: php version to use + +set_current_phpversion() { + PHP_SYMLINK_REALTARGET="${PHP_SYMLINK_TARGETDIR}/$1" + + if [[ -e ${PHP_SYMLINK_REALTARGET} ]] ; then + # the target file exists + # question is - is it a symlink, or something else? + + if [[ ! -L ${PHP_SYMLINK_REALTARGET} ]] ; then + # it is something else + # + # be cautious - do not remove it + die -q "${PHP_SYMLINK_REALTARGET} exists, but is not a symlink" + fi + fi + + if [[ -L ${PHP_SYMLINK_REALTARGET} ]] ; then + # existing symlink + if ! remove_symlink ${PHP_SYMLINK_REALTARGET} ; then + die -q "Couldn't remove existing symlink" + fi + fi + + if ! set_symlink ${PHP_SYMLINK_REALTARGET} "${2}" ; then + die -q "Couldn't set a new symlink" + fi +} + +### show action ### + +describe_show() { + echo "Show the current PHP version for ${PHP_HELP}" +} + +do_show() { + write_list_start "Current PHP version:" + version=$(get_current_phpversion) + write_kv_list_entry "$version" "" +} + +### list action ### + +describe_list() { + echo "List available PHP versions to link to" +} + +do_list() { + versions=( $(find_versions ) ) + current=$(get_current_phpversion) + + write_list_start "Available PHP versions:" + + if [[ -n ${versions[@]} ]] ; then + local i + for (( i = 0 ; i < ${#versions[@]} ; i = i + 1 )) ; do + linkversion=${versions[${i}]} + + [[ $linkversion == $current ]] && \ + versions[${i}]="${versions[${i}]} $(highlight '*' )" + done + write_numbered_list "${versions[@]}" + else + write_kv_list_entry "(none found)" "" + fi +} + +### set action ### + +describe_set() { + echo "Set PHP version used" +} + +do_set() { + if [[ -z ${1} ]] ; then + # no parameter + die -q "You didn't tell me which version of PHP to use" + fi + + version=$(get_phpversion_fromlist $1) + if [[ ${version} == "(not-found)" ]] ; then + die -q "I don't recognise that version of PHP" + fi + + for (( i = 0 ; i < ${#PHP_SYMLINK_APPLIST[@]} ; i = i + 1 )) ; do + set_current_phpversion ${PHP_SYMLINK_APPLIST[$i]} ${version} + done +} + +# vim: set ft=eselect : diff --git a/app-admin/eselect-php/metadata.xml b/app-admin/eselect-php/metadata.xml new file mode 100644 index 000000000000..fd3dbe39fa64 --- /dev/null +++ b/app-admin/eselect-php/metadata.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>php</herd> +</pkgmetadata> |