Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Feb 2008 15:25:34 GMT
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/120505: [maintainer] net/phpldapadmin, net/phpldapadmin098 -- use /usr/ports/UIDs, etc.
Message-ID:  <200802101525.m1AFPYCk043965@happy-idiot-talk.infracaninophile.co.uk>
Resent-Message-ID: <200802101530.m1AFU2GR018214@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         120505
>Category:       ports
>Synopsis:       [maintainer] net/phpldapadmin, net/phpldapadmin098 -- use /usr/ports/UIDs, etc.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Sun Feb 10 15:30:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Matthew Seaman
>Release:        FreeBSD 7.0-PRERELEASE i386
>Organization:
Infracaninophile
>Environment:
System: FreeBSD happy-idiot-talk.infracaninophile.co.uk 7.0-PRERELEASE FreeBSD 7.0-PRERELEASE #24: Sat Feb 2 16:38:34 GMT 2008 root@happy-idiot-talk.infracaninophile.co.uk:/usr/obj/usr/src/sys/HAPPY-IDIOT-TALK i386


	
>Description:
	

This is an update to the ports only -- no updates to either of
the phpldapadmin applications themselves.

Changes:

* When installed using WITH_SUPHP use a fixed 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 pldapadm to _pla
and add an entry to /usr/ports/UIDs:

  _pla:*:636:80:phpLDAPAdmin Owner:/nonexistent:/usr/sbin/nologin

Both net/phpldapadmin and net/phpldapadmin098 use the same UID, hence
both patch-sets in the same PR.

* Use the standard $WWWDIR for PLIST_SUB and SUB_LIST, instead of
rolling my own equivalent.

* Various internal code changes and clean-up

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.

>How-To-Repeat:
	
>Fix:

	

--- UIDs.patch begins here ---
--- UIDs.save	2008-02-10 12:17:42.000000000 +0000
+++ UIDs	2008-02-10 12:20:02.000000000 +0000
@@ -124,6 +124,7 @@
 polkit:*:562:562:PolicyKit User:/nonexistent:/usr/sbin/nologin
 pulse:*:563:563:PulseAudio System User:/nonexistent:/usr/sbin/nologin
 _xsi:*:600:600:XMLSysInfo User:/nonexistent:/usr/sbin/nologin
+_pla:*:636:80:phpLDAPAdmin Owner:/nonexistent:/usr/sbin/nologin
 bnetd:*:700:700:Bnetd user:/nonexistent:/usr/sbin/nologin
 bopm:*:717:717:Blitzed Open Proxy Monitor:/nonexistent:/bin/sh
 openxpki:*:777:777:OpenXPKI Owner:/nonexistent:/usr/sbin/nologin
--- UIDs.patch ends here ---

--- phpldapadmin.diff begins here ---
diff -Nur /usr/ports/net/phpldapadmin/Makefile phpldapadmin/Makefile
--- /usr/ports/net/phpldapadmin/Makefile	2008-02-06 07:14:43.000000000 +0000
+++ phpldapadmin/Makefile	2008-02-10 15:15:16.000000000 +0000
@@ -7,6 +7,7 @@
 
 PORTNAME=	phpldapadmin
 PORTVERSION=	1.1.0.5
+PORTREVISION=	1
 PORTEPOCH=	1
 CATEGORIES=	net www
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
@@ -21,36 +22,54 @@
 DEFAULT_PHP_VER=	5
 IGNORE_WITH_PHP=	4
 
-.if defined(WITH_SUPHP)
+.if defined(WITH_SUPHP) && !defined(WITHOUT_SUPHP)
 
 PKGNAMESUFFIX+=	-suphp
 RUN_DEPENDS+=	${LOCALBASE}/sbin/suphp:${PORTSDIR}/www/suphp
 WANT_PHP_CGI=	yes
 
-PLAUSR?=	pldapadm
-
-SUB_LIST+=	PLAUSR=${PLAUSR} \
-		PLAGRP=${PLAGRP}
-SUB_FILES+=	pkg-install  pkg-deinstall
-
 .else
 
 WANT_PHP_WEB=	yes
 
 .endif
 
-# PLAUSR is only used WITH_SUPHP
-PLADIR?=	www/${PORTNAME}
-PLAGRP?=	${WWWGRP}
+# PLA_USR is only used WITH_SUPHP
+PLA_GRP?=	${WWWGRP}
+PLA_GID?=	${_PLA_GID}
 CFGDIR=		config
 CFGFILE=	config.php
 
-SUB_LIST+=	PKGNAME=${PKGNAME} \
-		PLADIR=${PLADIR}
+PLIST=		${WRKDIR}/plist
+PLIST_SUB+=	PLA_GRP=${PLA_GRP}
+
+.if defined(WITH_SUPHP) && !defined(WITHOUT_SUPHP)
+
+PLA_USR?=	_pla
+PLA_UID?=	636
+PLA_GCOS?=	"phpLDAPAdmin Owner"
+PLA_HOME?=	/nonexistent
+PLA_SHELL?=	/usr/sbin/nologin
+
+SUB_LIST+=	PLA_USR=${PLA_USR}    \
+		PLA_UID=${PLA_UID}    \
+		PLA_GRP=${PLA_GRP}    \
+		PLA_GID=${PLA_GID}    \
+		PLA_GCOS=${PLA_GCOS}  \
+		PLA_HOME=${PLA_HOME}  \
+		PLA_SHELL=${PLA_SHELL}
+SUB_FILES+=	pkg-install pkg-deinstall
+
+.endif
+
+SUB_LIST+=	PKGNAME=${PKGNAME}
 SUB_FILES+=	pkg-message
 
-PLIST=		${WRKDIR}/plist
-PLIST_SUB+=	PLADIR=${PLADIR} PLAGRP=${PLAGRP}
+.include <bsd.port.pre.mk>
+_PLA_GID!=	/usr/sbin/pw group show -n ${PLA_GRP} | ${CUT} -d : -f 3
+.if empty(_PLA_GID)
+_PLA_GID=	80
+.endif
 
 .SILENT:
 
@@ -64,16 +83,25 @@
 	${ECHO_MSG} "This port is PHP5 specific. If you need PHP4 support,"
 	${ECHO_MSG} "please use the net/phpldapadmin098 port instead."
 	${ECHO_MSG} ""
+.if defined(WITH_SUPHP) && !defined(WITHOUT_SUPHP)
+	@if /usr/sbin/pw show -n pldapadm >/dev/null 2>&1 ; then	      \
+	    ${ECHO_MSG} "===> WARNING ******************************" ;	      \
+	    ${ECHO_MSG} "The default username used by ${PKNAME} has changed"; \
+	    ${ECHO_MSG} "to ${PLA_USR} -- you should delete the old user:" ;  \
+	    ${ECHO_MSG} "  # /usr/sbin/pw user del -n pldapadm" ;	      \
+	    ${ECHO_MSG} "" ;						      \
+	fi
+.endif
 
 post-patch:
-	cd ${WRKSRC} ;                                                      \
+	cd ${WRKSRC} ;							    \
 	${FIND} . ! -type d ! -name ${CFGFILE}.example ! -name .cvsignore | \
-	    ${SORT} | ${SED} -e "s!^\.!%%PLADIR%%!"             >${PLIST} ; \
-	${CAT} ${PKGDIR}/pkg-plist-chunk                       >>${PLIST} ; \
-	${FIND} . -type d | ${SORT} -r | ${SED}                             \
-	    -e 's!^\./${CFGDIR}$$!@dirrmtry %%PLADIR%%/${CFGDIR}!'          \
-	    -e 's!^\.$$!@dirrmtry %%PLADIR%%!'                              \
-	    -e 's!^\.!@dirrm %%PLADIR%%!'                      >>${PLIST}
+	    ${SORT} | ${SED} -e "s!^\.!%%WWWDIR%%!"		>${PLIST} ; \
+	${CAT} ${PKGDIR}/pkg-plist-chunk		       >>${PLIST} ; \
+	${FIND} . -type d | ${SORT} -r | ${SED}				    \
+	    -e 's!^\./${CFGDIR}$$!@dirrmtry %%WWWDIR%%/${CFGDIR}!'	    \
+	    -e 's!^\.$$!@dirrmtry %%WWWDIR%%!'				    \
+	    -e 's!^\.!@dirrm %%WWWDIR%%!'		       >>${PLIST}
 
 pre-install:
 .if defined(WITH_SUPHP)
@@ -85,18 +113,18 @@
 install-app:
 	cd ${WRKSRC} ; \
 	for src in $$( ${FIND} . ! -name .cvsignore  ) ; do \
-	    dst=${PREFIX}/${PLADIR}$${src#.} ; \
+	    dst=${WWWDIR}$${src#.} ; \
 	    if ${TEST} -d $$src ; then \
-	        ${MKDIR} $$dst ; \
+		${MKDIR} $$dst ; \
 	    else \
-	        ${INSTALL_DATA} $$src $$dst ; \
+		${INSTALL_DATA} $$src $$dst ; \
 	    fi \
 	done
 
 install-conf:
-	cd ${PREFIX}/${PLADIR}/${CFGDIR} ; \
+	cd ${WWWDIR}/${CFGDIR} ; \
 	${CHMOD} 0640 ${CFGFILE}.example ; \
-	${CHGRP} ${PLAGRP} ${CFGFILE}.example ; \
+	${CHGRP} ${PLA_GRP} ${CFGFILE}.example ; \
 	if ${TEST} ! -f ${CFGFILE} ; then \
 	    ${CP} -p ${CFGFILE}.example ${CFGFILE} ; \
 	fi
@@ -107,4 +135,4 @@
 .endif
 	${CAT} ${PKGMESSAGE}
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff -Nur /usr/ports/net/phpldapadmin/files/pkg-deinstall.in phpldapadmin/files/pkg-deinstall.in
--- /usr/ports/net/phpldapadmin/files/pkg-deinstall.in	2005-12-11 23:51:12.000000000 +0000
+++ phpldapadmin/files/pkg-deinstall.in	2008-02-10 12:34:31.000000000 +0000
@@ -9,13 +9,13 @@
 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 -Nur /usr/ports/net/phpldapadmin/files/pkg-install.in phpldapadmin/files/pkg-install.in
--- /usr/ports/net/phpldapadmin/files/pkg-install.in	2005-12-11 23:51:12.000000000 +0000
+++ phpldapadmin/files/pkg-install.in	2008-02-10 12:32:44.000000000 +0000
@@ -1,70 +1,87 @@
 #!/bin/sh
 #
-# $FreeBSD: ports/net/phpldapadmin/files/pkg-install.in,v 1.1 2005/12/11 23:51:12 lawrance Exp $
+# $FreeBSD$
 #
 
 PATH=/usr/sbin:/usr/bin:/bin ; export PATH
 
-pladir=%%PREFIX%%/%%PLADIR%%
-plausr=%%PLAUSR%%
-plagrp=%%PLAGRP%%
-
-plagcos="phpLDAPadmin Owner"
-plahome=/nonexistent
-plashell=/sbin/nologin
+pla_dir=%%WWWDIR%%
+pla_usr=%%PLA_USR%%
+pla_uid=%%PLA_UID%%
+pla_grp=%%PLA_GRP%%
+pla_gid=%%PLA_GID%%
+
+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.
+	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 -g $gid
+		    pw useradd -n $user -u $uid -g $group -c "$gcos" \\
+		        -d $home -s $shell -h -
 
-	    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
+		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
+    uid=$2
+    group=$3
+    gid=$4
+    gcos=$5
+    home=$6
+    shell=$7
 
-    if pw useradd -n $user -g $group -c "$gcos" -d $home -s $shell -h - ; then
-	echo "===> Created $user user"
+    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 @@
     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 -Nur /usr/ports/net/phpldapadmin/files/pkg-message.in phpldapadmin/files/pkg-message.in
--- /usr/ports/net/phpldapadmin/files/pkg-message.in	2006-05-28 17:59:00.000000000 +0100
+++ phpldapadmin/files/pkg-message.in	2008-02-10 15:13:14.000000000 +0000
@@ -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 @@
 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
 
diff -Nur /usr/ports/net/phpldapadmin/pkg-plist-chunk phpldapadmin/pkg-plist-chunk
--- /usr/ports/net/phpldapadmin/pkg-plist-chunk	2005-12-11 23:51:12.000000000 +0000
+++ phpldapadmin/pkg-plist-chunk	2008-02-10 13:10:58.000000000 +0000
@@ -1,7 +1,7 @@
 @mode 640
-@group %%PLAGRP%%
-@unexec if cmp -s %D/%%PLADIR%%/config/config.php.example %D/%%PLADIR%%/config/config.php ; then rm -f %D/%%PLADIR%%/config/config.php ; fi
-%%PLADIR%%/config/config.php.example
+@group %%PLA_GRP%%
+@unexec if cmp -s %D/%%WWWDIR%%/config/config.php.example %D/%%WWWDIR%%/config/config.php ; then rm -f %D/%%WWWDIR%%/config/config.php ; fi
+%%WWWDIR%%/config/config.php.example
 @exec [ ! -f %B/config.php ] && cp -p %B/%f %B/config.php || true
 @mode
 @group
--- phpldapadmin.diff ends here ---

--- phpldapadmin098.diff begins here ---
diff -Nur /usr/ports/net/phpldapadmin098/Makefile phpldapadmin098/Makefile
--- /usr/ports/net/phpldapadmin098/Makefile	2007-03-24 08:06:37.000000000 +0000
+++ phpldapadmin098/Makefile	2008-02-10 15:16:16.000000000 +0000
@@ -7,6 +7,7 @@
 
 PORTNAME=	phpldapadmin098
 PORTVERSION=	0.9.8.4
+PORTREVISION=	1
 PORTEPOCH=	1
 CATEGORIES=	net www
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
@@ -20,38 +21,54 @@
 USE_PHP=	gettext ldap openssl pcre session
 DEFAULT_PHP_VER=	4
 
-.if defined(WITH_SUPHP)
+.if defined(WITH_SUPHP) && !defined(WITHOUT_SUPHP)
 
 PKGNAMESUFFIX+=	-suphp
 RUN_DEPENDS+=	${LOCALBASE}/sbin/suphp:${PORTSDIR}/www/suphp
 WANT_PHP_CGI=	yes
 
-PLAUSR?=	pldapadm
-
-SUB_LIST+=	PLAUSR=${PLAUSR} \
-		PLAGRP=${PLAGRP}
-SUB_FILES+=	pkg-install  pkg-deinstall
-
 .else
 
 WANT_PHP_WEB=	yes
 
 .endif
 
-# PLAUSR is only used WITH_SUPHP
-PLADIR?=	www/${PORTNAME}
-PLADIRX?=	${PLADIR:S/098//}
-PLAGRP?=	${WWWGRP}
+# PLA_USR is only used WITH_SUPHP
+PLA_GRP?=	${WWWGRP}
+PLA_GID?=	${_PLA_GID}
 CFGDIR=		config
 CFGFILE=	config.php
 
-SUB_LIST+=	PKGNAME=${PKGNAME} \
-		PLADIR=${PLADIR}   \
-		PLADIRX=${PLADIRX}
+PLIST=		${WRKDIR}/plist
+PLIST_SUB+=	PLA_GRP=${PLA_GRP}
+
+.if defined(WITH_SUPHP) && !defined(WITHOUT_SUPHP)
+
+PLA_USR?=	_pla
+PLA_UID?=	636
+PLA_GCOS?=	"phpLDAPAdmin Owner"
+PLA_HOME?=	/nonexistent
+PLA_SHELL?=	/usr/sbin/nologin
+
+SUB_LIST+=	PLA_USR=${PLA_USR}    \
+		PLA_UID=${PLA_UID}    \
+		PLA_GRP=${PLA_GRP}    \
+		PLA_GID=${PLA_GID}    \
+		PLA_GCOS=${PLA_GCOS}  \
+		PLA_HOME=${PLA_HOME}  \
+		PLA_SHELL=${PLA_SHELL}
+SUB_FILES+=	pkg-install pkg-deinstall
+
+.endif
+
+SUB_LIST+=	PKGNAME=${PKGNAME}
 SUB_FILES+=	pkg-message
 
-PLIST=		${WRKDIR}/plist
-PLIST_SUB+=	PLADIR=${PLADIR} PLAGRP=${PLAGRP}
+.include <bsd.port.pre.mk>
+_PLA_GID!=	/usr/sbin/pw group show -n ${PLA_GRP} | ${CUT} -d : -f 3
+.if empty(_PLA_GID)
+_PLA_GID=	80
+.endif
 
 .SILENT:
 
@@ -66,16 +83,25 @@
 	${ECHO_MSG} "However, for best results with PHP5 please use the"
 	${ECHO_MSG} "net/phpldapadmin port instead."
 	${ECHO_MSG} ""
+.if defined(WITH_SUPHP) && !defined(WITHOUT_SUPHP)
+	@if /usr/sbin/pw show -n pldapadm >/dev/null 2>&1 ; then	      \
+	    ${ECHO_MSG} "===> WARNING ******************************" ;	      \
+	    ${ECHO_MSG} "The default username used by ${PKNAME} has changed"; \
+	    ${ECHO_MSG} "to ${PLA_USR} -- you should delete the old user:" ;  \
+	    ${ECHO_MSG} "  # /usr/sbin/pw user del -n pldapadm" ;	      \
+	    ${ECHO_MSG} "" ;						      \
+	fi
+.endif
 
 post-patch:
-	cd ${WRKSRC} ;                                                      \
+	cd ${WRKSRC} ;							    \
 	${FIND} . ! -type d ! -name ${CFGFILE}.example ! -name .cvsignore | \
-	    ${SORT} | ${SED} -e "s!^\.!%%PLADIR%%!"             >${PLIST} ; \
-	${CAT} ${PKGDIR}/pkg-plist-chunk                       >>${PLIST} ; \
-	${FIND} . -type d | ${SORT} -r | ${SED}                             \
-	    -e 's!^\./${CFGDIR}$$!@dirrmtry %%PLADIR%%/${CFGDIR}!'          \
-	    -e 's!^\.$$!@dirrmtry %%PLADIR%%!'                              \
-	    -e 's!^\.!@dirrm %%PLADIR%%!'                      >>${PLIST}
+	    ${SORT} | ${SED} -e "s!^\.!%%WWWDIR%%!"		>${PLIST} ; \
+	${CAT} ${PKGDIR}/pkg-plist-chunk		       >>${PLIST} ; \
+	${FIND} . -type d | ${SORT} -r | ${SED}				    \
+	    -e 's!^\./${CFGDIR}$$!@dirrmtry %%WWWDIR%%/${CFGDIR}!'	    \
+	    -e 's!^\.$$!@dirrmtry %%WWWDIR%%!'				    \
+	    -e 's!^\.!@dirrm %%WWWDIR%%!'		       >>${PLIST}
 
 pre-install:
 .if defined(WITH_SUPHP)
@@ -87,18 +113,18 @@
 install-app:
 	cd ${WRKSRC} ; \
 	for src in $$( ${FIND} . ! -name .cvsignore  ) ; do \
-	    dst=${PREFIX}/${PLADIR}$${src#.} ; \
+	    dst=${WWWDIR}$${src#.} ; \
 	    if ${TEST} -d $$src ; then \
-	        ${MKDIR} $$dst ; \
+		${MKDIR} $$dst ; \
 	    else \
-	        ${INSTALL_DATA} $$src $$dst ; \
+		${INSTALL_DATA} $$src $$dst ; \
 	    fi \
 	done
 
 install-conf:
-	cd ${PREFIX}/${PLADIR}/${CFGDIR} ; \
+	cd ${WWWDIR}/${CFGDIR} ; \
 	${CHMOD} 0640 ${CFGFILE}.example ; \
-	${CHGRP} ${PLAGRP} ${CFGFILE}.example ; \
+	${CHGRP} ${PLA_GRP} ${CFGFILE}.example ; \
 	if ${TEST} ! -f ${CFGFILE} ; then \
 	    ${CP} -p ${CFGFILE}.example ${CFGFILE} ; \
 	fi
@@ -109,4 +135,4 @@
 .endif
 	${CAT} ${PKGMESSAGE}
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff -Nur /usr/ports/net/phpldapadmin098/files/pkg-deinstall.in phpldapadmin098/files/pkg-deinstall.in
--- /usr/ports/net/phpldapadmin098/files/pkg-deinstall.in	2005-12-11 23:51:12.000000000 +0000
+++ phpldapadmin098/files/pkg-deinstall.in	2008-02-10 14:58:41.000000000 +0000
@@ -9,13 +9,13 @@
 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 -Nur /usr/ports/net/phpldapadmin098/files/pkg-install.in phpldapadmin098/files/pkg-install.in
--- /usr/ports/net/phpldapadmin098/files/pkg-install.in	2005-12-11 23:51:12.000000000 +0000
+++ phpldapadmin098/files/pkg-install.in	2008-02-10 14:59:18.000000000 +0000
@@ -1,70 +1,87 @@
 #!/bin/sh
 #
-# $FreeBSD: ports/net/phpldapadmin098/files/pkg-install.in,v 1.1 2005/12/11 23:51:12 lawrance Exp $
+# $FreeBSD$
 #
 
 PATH=/usr/sbin:/usr/bin:/bin ; export PATH
 
-pladir=%%PREFIX%%/%%PLADIR%%
-plausr=%%PLAUSR%%
-plagrp=%%PLAGRP%%
-
-plagcos="phpLDAPadmin Owner"
-plahome=/nonexistent
-plashell=/sbin/nologin
+pla_dir=%%WWWDIR%%
+pla_usr=%%PLA_USR%%
+pla_uid=%%PLA_UID%%
+pla_grp=%%PLA_GRP%%
+pla_gid=%%PLA_GID%%
+
+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.
+	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 -g $gid
+		    pw useradd -n $user -u $uid -g $group -c "$gcos" \\
+		        -d $home -s $shell -h -
 
-	    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
+		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
+    uid=$2
+    group=$3
+    gid=$4
+    gcos=$5
+    home=$6
+    shell=$7
 
-    if pw useradd -n $user -g $group -c "$gcos" -d $home -s $shell -h - ; then
-	echo "===> Created $user user"
+    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 @@
     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 -Nur /usr/ports/net/phpldapadmin098/files/pkg-message.in phpldapadmin098/files/pkg-message.in
--- /usr/ports/net/phpldapadmin098/files/pkg-message.in	2006-05-28 17:59:00.000000000 +0100
+++ phpldapadmin098/files/pkg-message.in	2008-02-10 15:01:58.000000000 +0000
@@ -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 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,10 @@
 need to modify your apache configuration and merge the settings from
 your original configuration file:
 
-    %%PREFIX%%/%%PLADIRX%%/config.php
+    %%WWWDIR%%/config.php
 
  to
 
-   %%PREFIX%%/%%PLADIR%%/config/config.php
+    %%WWWDIR%%/config/config.php
 
 
diff -Nur /usr/ports/net/phpldapadmin098/pkg-plist-chunk phpldapadmin098/pkg-plist-chunk
--- /usr/ports/net/phpldapadmin098/pkg-plist-chunk	2005-12-11 23:51:12.000000000 +0000
+++ phpldapadmin098/pkg-plist-chunk	2008-02-10 15:03:22.000000000 +0000
@@ -1,7 +1,7 @@
 @mode 640
-@group %%PLAGRP%%
-@unexec if cmp -s %D/%%PLADIR%%/config/config.php.example %D/%%PLADIR%%/config/config.php ; then rm -f %D/%%PLADIR%%/config/config.php ; fi
-%%PLADIR%%/config/config.php.example
+@group %%PLA_GRP%%
+@unexec if cmp -s %D/%%WWWDIR%%/config/config.php.example %D/%%WWWDIR%%/config/config.php ; then rm -f %D/%%WWWDIR%%/config/config.php ; fi
+%%WWWDIR%%/config/config.php.example
 @exec [ ! -f %B/config.php ] && cp -p %B/%f %B/config.php || true
 @mode
 @group
--- phpldapadmin098.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200802101525.m1AFPYCk043965>