From m.seaman@infracaninophile.co.uk Sun Feb 10 15:25:44 2008 Return-Path: Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 710E616A418 for ; Sun, 10 Feb 2008 15:25:42 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from smtp.infracaninophile.co.uk (gate6.infracaninophile.co.uk [IPv6:2001:8b0:151:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id EDE6F13C457 for ; Sun, 10 Feb 2008 15:25:40 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [IPv6:::1]) by smtp.infracaninophile.co.uk (8.14.2/8.14.2) with ESMTP id m1AFPYBR043966 for ; Sun, 10 Feb 2008 15:25:34 GMT (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost) by happy-idiot-talk.infracaninophile.co.uk (8.14.2/8.14.2/Submit) id m1AFPYCk043965; Sun, 10 Feb 2008 15:25:34 GMT (envelope-from matthew) Message-Id: <200802101525.m1AFPYCk043965@happy-idiot-talk.infracaninophile.co.uk> Date: Sun, 10 Feb 2008 15:25:34 GMT From: Matthew Seaman Reply-To: Matthew Seaman To: FreeBSD-gnats-submit@freebsd.org Cc: Subject: [maintainer] net/phpldapadmin, net/phpldapadmin098 -- use /usr/ports/UIDs, etc. X-Send-Pr-Version: 3.113 X-GNATS-Notify: >Number: 120505 >Category: ports >Synopsis: [maintainer] net/phpldapadmin, net/phpldapadmin098 -- use /usr/ports/UIDs, etc. >Confidential: no >Severity: serious >Priority: medium >Responsible: rafan >State: closed >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Sun Feb 10 15:30:01 UTC 2008 >Closed-Date: Sun Mar 09 04:45:45 UTC 2008 >Last-Modified: Sun Mar 9 04:50:02 UTC 2008 >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 +_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 +.include 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" - + 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 +_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 +.include 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" - + 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: From: Matthew Seaman To: FreeBSD-gnats-submit@freebsd.org Cc: Subject: Re: ports/120505: [maintainer] net/phpldapadmin, net/phpldapadmin098 -- use /usr/ports/UIDs, etc. Date: Sat, 08 Mar 2008 16:20:42 +0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig5EF7A3DA6FA4E88AA2FA69F3 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Matthew Seaman wrote: >> Number: 120505 >> Category: ports >> Synopsis: [maintainer] net/phpldapadmin, net/phpldapadmin098 -- = use /usr/ports/UIDs, etc. Is there some problem with this PR? It's been a month since I submitted it, and no sign of any activity yet. Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW --------------enig5EF7A3DA6FA4E88AA2FA69F3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.8 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEAREIAAYFAkfSvOAACgkQ8Mjk52CukIy2OACfRZX8E/OFB2Ka5ThF0UnTiUg9 wB4AoJTIqX54z0Dbsnhc2ZzEwNf6QY3Z =3Be0 -----END PGP SIGNATURE----- --------------enig5EF7A3DA6FA4E88AA2FA69F3-- Responsible-Changed-From-To: freebsd-ports-bugs->rafan Responsible-Changed-By: rafan Responsible-Changed-When: Sat Mar 8 18:31:19 UTC 2008 Responsible-Changed-Why: I'll take it. http://www.freebsd.org/cgi/query-pr.cgi?pr=120505 State-Changed-From-To: open->closed State-Changed-By: rafan State-Changed-When: Sun Mar 9 04:45:43 UTC 2008 State-Changed-Why: Committed. Thanks! http://www.freebsd.org/cgi/query-pr.cgi?pr=120505 From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: ports/120505: commit references a PR Date: Sun, 9 Mar 2008 04:43:51 +0000 (UTC) rafan 2008-03-09 04:43:45 UTC FreeBSD ports repository Modified files: . UIDs Log: - Register UID for net/phpldapadmin, net/phpldapadmin098 PR: 120505 Revision Changes Path 1.62 +2 -1 ports/UIDs _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org" From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: ports/120505: commit references a PR Date: Sun, 9 Mar 2008 04:45:43 +0000 (UTC) rafan 2008-03-09 04:45:39 UTC FreeBSD ports repository Modified files: net/phpldapadmin Makefile pkg-plist-chunk net/phpldapadmin/files pkg-deinstall.in pkg-install.in pkg-message.in net/phpldapadmin098 Makefile pkg-plist-chunk net/phpldapadmin098/files pkg-deinstall.in pkg-install.in pkg-message.in Log: - 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 (maintainer) Revision Changes Path 1.24 +55 -27 ports/net/phpldapadmin/Makefile 1.2 +5 -5 ports/net/phpldapadmin/files/pkg-deinstall.in 1.2 +66 -54 ports/net/phpldapadmin/files/pkg-install.in 1.4 +6 -7 ports/net/phpldapadmin/files/pkg-message.in 1.3 +3 -3 ports/net/phpldapadmin/pkg-plist-chunk 1.20 +55 -29 ports/net/phpldapadmin098/Makefile 1.2 +5 -5 ports/net/phpldapadmin098/files/pkg-deinstall.in 1.2 +66 -54 ports/net/phpldapadmin098/files/pkg-install.in 1.5 +5 -5 ports/net/phpldapadmin098/files/pkg-message.in 1.3 +3 -3 ports/net/phpldapadmin098/pkg-plist-chunk _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org" >Unformatted: