summaryrefslogtreecommitdiff
path: root/net/phpldapadmin/files
diff options
context:
space:
mode:
authorRong-En Fan <rafan@FreeBSD.org>2008-03-09 04:45:39 +0000
committerRong-En Fan <rafan@FreeBSD.org>2008-03-09 04:45:39 +0000
commita620c0c128905650c8779e1961c77a6884dee366 (patch)
tree1fd993f69b500b2b89dc290c03bdc05b35b224ed /net/phpldapadmin/files
parent- Register UID for net/phpldapadmin, net/phpldapadmin098 (diff)
- Use fixed UID when WITH_SUPHP
- Use WWWDIR for PLIST_SUB and SUB_LIST - Various port clean-up PR: ports/120505 Submitted by: Matthew Seaman <m.seaman at infracaninophile.co.uk> (maintainer)
Notes
Notes: svn path=/head/; revision=208665
Diffstat (limited to 'net/phpldapadmin/files')
-rw-r--r--net/phpldapadmin/files/pkg-deinstall.in10
-rw-r--r--net/phpldapadmin/files/pkg-install.in124
-rw-r--r--net/phpldapadmin/files/pkg-message.in13
3 files changed, 79 insertions, 68 deletions
diff --git a/net/phpldapadmin/files/pkg-deinstall.in b/net/phpldapadmin/files/pkg-deinstall.in
index cca9c556093d..8c531f2ea1e7 100644
--- a/net/phpldapadmin/files/pkg-deinstall.in
+++ b/net/phpldapadmin/files/pkg-deinstall.in
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $FreeBSD: /tmp/pcvs/ports/net/phpldapadmin/files/pkg-deinstall.in,v 1.1 2005-12-11 23:51:12 lawrance Exp $
+# $FreeBSD: /tmp/pcvs/ports/net/phpldapadmin/files/pkg-deinstall.in,v 1.2 2008-03-09 04:45:38 rafan Exp $
#
case $2 in
@@ -9,13 +9,13 @@ case $2 in
The phpldapadmin-suphp port has been deleted.
If you are not upgrading and don't intend to use
phpLDAPadmin any more then you may wish to delete
-the %%PLAUSR%% account, which can be done with
+the %%PLA_USR%% account, which can be done with
the following command:
- # pw userdel %%PLAUSR%%
+ # pw userdel %%PLA_USR%%
EOMSG
- if [ -d %%PREFIX%%/%%PLADIR%% ] ; then
- echo " # rm -rf %%PREFIX%%/%%PLADIR%%/"
+ if [ -d %%WWWDIR%% ] ; then
+ echo " # rm -rf %%WWWDIR%%/"
fi
echo
;;
diff --git a/net/phpldapadmin/files/pkg-install.in b/net/phpldapadmin/files/pkg-install.in
index b56e32ad6767..ec4c871acb11 100644
--- a/net/phpldapadmin/files/pkg-install.in
+++ b/net/phpldapadmin/files/pkg-install.in
@@ -1,70 +1,87 @@
#!/bin/sh
#
-# $FreeBSD: /tmp/pcvs/ports/net/phpldapadmin/files/pkg-install.in,v 1.1 2005-12-11 23:51:12 lawrance Exp $
+# $FreeBSD: /tmp/pcvs/ports/net/phpldapadmin/files/pkg-install.in,v 1.2 2008-03-09 04:45:38 rafan Exp $
#
PATH=/usr/sbin:/usr/bin:/bin ; export PATH
-pladir=%%PREFIX%%/%%PLADIR%%
-plausr=%%PLAUSR%%
-plagrp=%%PLAGRP%%
+pla_dir=%%WWWDIR%%
+pla_usr=%%PLA_USR%%
+pla_uid=%%PLA_UID%%
+pla_grp=%%PLA_GRP%%
+pla_gid=%%PLA_GID%%
-plagcos="phpLDAPadmin Owner"
-plahome=/nonexistent
-plashell=/sbin/nologin
+pla_gcos="%%PLA_GCOS%%"
+pla_home=%%PLA_HOME%%
+pla_shell=%%PLA_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.
-
- 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 -
-
- and retry installing this package.
- EOERRORMSG
- exit 1
+ 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:
+
+ 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
+ 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
}
@@ -73,23 +90,18 @@ case $2 in
PRE-INSTALL)
# Create the pla user and group if they do not already exist
-
- if pw user show -n $plausr >/dev/null 2>&1 ; then
- echo "===> Using pre-existing user $plausr"
- else
- if ! pw group show -n $plagrp >/dev/null 2>&1 ; then
- create_group $plausr $plagrp "$plagcos" $plahome \
- $plashell
- fi
- create_user $plausr $plagrp "$plagcos" $plahome $plashell
- fi
+ create_group $pla_usr $pla_uid $pla_grp $pla_gid \
+ "$pla_gcos" $pla_home $pla_shell
+ create_user $pla_usr $pla_uid $pla_grp $pla_gid \
+ "$pla_gcos" $pla_home $pla_shell
;;
+
POST-INSTALL)
- # Change ownership of the phpLDAPadmin directory
+ # Change ownership of the phpMyAdm directory
- echo "===> Adjusting file ownership in $pladir"
- chown -R $plausr:$plagrp $pladir || exit 1
+ echo "===> Adjusting file ownership in $pla_dir"
+ chown -R $pla_usr:$pla_grp $pla_dir || exit 1
;;
esac
diff --git a/net/phpldapadmin/files/pkg-message.in b/net/phpldapadmin/files/pkg-message.in
index 2043e40b38b4..f1425b31beea 100644
--- a/net/phpldapadmin/files/pkg-message.in
+++ b/net/phpldapadmin/files/pkg-message.in
@@ -1,16 +1,16 @@
%%PKGNAME%% has been installed into:
- %%PREFIX%%/%%PLADIR%%
+ %%WWWDIR%%
Please edit config.php to suit your needs.
To make phpLDAPadmin available through your web site, I suggest that
-you add something like following to httpd.conf:
+you add something like the following to httpd.conf:
- Alias /phpldapadmin/ "%%PREFIX%%/%%PLADIR%%/htdocs"
+ Alias /phpldapadmin/ "%%WWWDIR%%/htdocs"
- <Directory "%%PREFIX%%/%%PLADIR%%/htdocs">
+ <Directory "%%WWWDIR%%/htdocs">
Options none
AllowOverride none
@@ -24,10 +24,9 @@ layout of the %%PKGNAME%% files has been completely reworked. You will
need to modify your apache configuration and merge the settings from
your original configuration file:
- %%PREFIX%%/%%PLADIR%%/config.php
+ %%WWWDIR%%/config.php
to
- %%PREFIX%%/%%PLADIR%%/config/config.php
-
+ %%WWWDIR%%/config/config.php