diff options
author | Martin Wilke <miwi@FreeBSD.org> | 2008-01-21 10:58:20 +0000 |
---|---|---|
committer | Martin Wilke <miwi@FreeBSD.org> | 2008-01-21 10:58:20 +0000 |
commit | 784cf429418a5d41f90a1541851fa5c86f51f402 (patch) | |
tree | 6c732b6232a9ef6d529e62641a7558613dd54c36 /databases/phpmyadmin/files | |
parent | Update to 2.9.3 (diff) |
Changes:
* When installed using WITH_SUPHP use a fix username/UID from
/usr/ports/UIDs. There's no equivalent /usr/ports/GIDs entry
because it defaults to group 'www'.
* Consequently change the default username from phpmyadm to _pma
and add an entry to /usr/ports/UIDs:
_pma:*:336:80:phpMyAdmin Owner:/nonexistent:/sbin/nologin
* Use the standard $WWWDIR for PLIST_SUB and SUB_LIST, instead of
rolling my own equivalent.
* Various internal code changes and clean-up
* Bump PORTREVISION
Note: the changes here mostly affect compilation with WITH_SUPHP
defined. If you're not a suPHP user, then there's very little
ultimately that has changed.
PR: 119825
Submitted by: Matthew Seaman <m.seaman@infracaninophile.co.uk> (maintainer)
Notes
Notes:
svn path=/head/; revision=205961
Diffstat (limited to 'databases/phpmyadmin/files')
-rw-r--r-- | databases/phpmyadmin/files/pkg-deinstall.in | 8 | ||||
-rw-r--r-- | databases/phpmyadmin/files/pkg-install.in | 116 | ||||
-rw-r--r-- | databases/phpmyadmin/files/pkg-message.in | 6 |
3 files changed, 71 insertions, 59 deletions
diff --git a/databases/phpmyadmin/files/pkg-deinstall.in b/databases/phpmyadmin/files/pkg-deinstall.in index 4962506b4e26..83204b698c11 100644 --- a/databases/phpmyadmin/files/pkg-deinstall.in +++ b/databases/phpmyadmin/files/pkg-deinstall.in @@ -9,13 +9,13 @@ case $2 in The phpMyAdmin-suphp port has been deleted. If you are not upgrading and don't intend to use phpMyAdmin any more then you may wish to delete -the %%MYADMUSR%% account, which can be done with +the %%PMA_USR%% account, which can be done with the following command: - # pw userdel %%MYADMUSR%% + # pw userdel %%PMA_USR%% EOMSG - if [ -d %%PREFIX%%/%%MYADMDIR%% ] ; then - echo " # rm -rf %%PREFIX%%/%%MYADMDIR%%/" + if [ -d %%WWWDIR%% ] ; then + echo " # rm -rf %%WWWDIR%%/" fi echo ;; diff --git a/databases/phpmyadmin/files/pkg-install.in b/databases/phpmyadmin/files/pkg-install.in index bb4180b2660f..b8adfb92959b 100644 --- a/databases/phpmyadmin/files/pkg-install.in +++ b/databases/phpmyadmin/files/pkg-install.in @@ -5,66 +5,83 @@ PATH=/usr/sbin:/usr/bin:/bin ; export PATH -myadmdir=%%PREFIX%%/%%MYADMDIR%% -myadmusr=%%MYADMUSR%% -myadmgrp=%%MYADMGRP%% +pma_dir=%%WWWDIR%% +pma_usr=%%PMA_USR%% +pma_uid=%%PMA_UID%% +pma_grp=%%PMA_GRP%% +pma_gid=%%PMA_GID%% -myadmgcos="phpMyAdmin Owner" -myadmhome=/nonexistent -myadmshell=/sbin/nologin +pma_gcos="%%PMA_GCOS%%" +pma_home=%%PMA_HOME%% +pma_shell=%%PMA_SHELL%% create_group() { - local user group gcos home shell + local user uid group gid gcos home shell user=$1 - group=$2 - gcos=$3 - home=$4 - shell=$5 + uid=$2 + group=$3 + gid=$4 + gcos=$5 + home=$6 + shell=$7 - if pw groupadd -n $group ; then - echo "===> Group $group created" + + if pw group show -n $group >/dev/null 2>&1 ; then + echo "===> Using pre-existing group $group" else - cat <<-EOERRORMSG - *** Failed to create the $group group. + if pw groupadd -n $group -g $gid ; then + echo "===> Group $group created" + else + cat <<-EOERRORMSG + *** Failed to create the $group group. - Please add the $user user and $group group - manually with the commands: + Please add the $user user and $group group + manually with the commands: - pw groupadd -n $group - pw useradd -n $user -g $group -c "$gcos" \\ - -d $home -s $shell -h - + pw groupadd -n $group -g $gid + pw useradd -n $user -u $uid -g $group -c "$gcos" \\ + -d $home -s $shell -h - - and retry installing this package. - EOERRORMSG - exit 1 + and retry installing this package. + EOERRORMSG + exit 1 + fi fi + } create_user() { - local user group gcos home shell + local user uid group gid gcos home shell user=$1 - group=$2 - gcos=$3 - home=$4 - shell=$5 - - if pw useradd -n $user -g $group -c "$gcos" -d $home -s $shell -h - ; then - echo "===> Created $user user" + uid=$2 + group=$3 + gid=$4 + gcos=$5 + home=$6 + shell=$7 + + if pw user show -n $user >/dev/null 2>&1 ; then + echo "===> Using pre-existing user $user" else - cat <<-EOERRORMSG - *** Failed to create the $user user. + if pw useradd -n $user -u $uid -g $group -c "$gcos" \ + -d $home -s $shell -h - ; then + echo "===> Created $user user" + else + cat <<-EOERRORMSG + *** Failed to create the $user user. - Please add the $user user manually with the command: + Please add the $user user manually with the command: - pw useradd -n $user -g $group -c "$gcos" \\ - -d $home -s $shell -h - + pw useradd -n $user -u $uid -g $group -c "$gcos" \\ + -d $home -s $shell -h - - and retry installing this package. - EOERRORMSG - exit 1 + and retry installing this package. + EOERRORMSG + exit 1 + fi fi } @@ -72,24 +89,19 @@ create_user() { case $2 in PRE-INSTALL) - # Create the myadm user and group if they do not already exist - - if pw user show -n $myadmusr >/dev/null 2>&1 ; then - echo "===> Using pre-existing user $myadmusr" - else - if ! pw group show -n $myadmgrp >/dev/null 2>&1 ; then - create_group $myadmusr $myadmgrp "$myadmgcos" $myadmhome \ - $myadmshell - fi - create_user $myadmusr $myadmgrp "$myadmgcos" $myadmhome $myadmshell - fi + # Create the pma user and group if they do not already exist + create_group $pma_usr $pma_uid $pma_grp $pma_gid \ + "$pma_gcos" $pma_home $pma_shell + create_user $pma_usr $pma_uid $pma_grp $pma_gid \ + "$pma_gcos" $pma_home $pma_shell ;; + POST-INSTALL) # Change ownership of the phpMyAdm directory - echo "===> Adjusting file ownership in $myadmdir" - chown -R $myadmusr:$myadmgrp $myadmdir || exit 1 + echo "===> Adjusting file ownership in $pma_dir" + chown -R $pma_usr:$pma_grp $pma_dir || exit 1 ;; esac diff --git a/databases/phpmyadmin/files/pkg-message.in b/databases/phpmyadmin/files/pkg-message.in index 34fbb55d1919..152f150c8762 100644 --- a/databases/phpmyadmin/files/pkg-message.in +++ b/databases/phpmyadmin/files/pkg-message.in @@ -1,16 +1,16 @@ %%PKGNAME%% has been installed into: - %%PREFIX%%/%%MYADMDIR%% + %%WWWDIR%% Please edit config.inc.php to suit your needs. To make phpMyAdmin available through your web site, I suggest that you add something like the following to httpd.conf: - Alias /phpmyadmin/ "%%PREFIX%%/%%MYADMDIR%%/" + Alias /phpmyadmin/ "%%WWWDIR%%/" - <Directory "%%PREFIX%%/%%MYADMDIR%%/"> + <Directory "%%WWWDIR%%/"> Options none AllowOverride Limit |