FreeBSD Bugzilla – Attachment 84496 Details for
Bug 120505
[maintainer] net/phpldapadmin, net/phpldapadmin098 -- use /usr/ports/UIDs, etc.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
phpldapadmin098.diff
phpldapadmin098.diff (text/plain), 10.84 KB, created by
Matthew Seaman
on 2008-02-10 15:30:01 UTC
(
hide
)
Description:
phpldapadmin098.diff
Filename:
MIME Type:
Creator:
Matthew Seaman
Created:
2008-02-10 15:30:01 UTC
Size:
10.84 KB
patch
obsolete
>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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 120505
:
84495
| 84496