diff options
author | miwi <miwi@FreeBSD.org> | 2008-01-21 18:58:20 +0800 |
---|---|---|
committer | miwi <miwi@FreeBSD.org> | 2008-01-21 18:58:20 +0800 |
commit | 8b52b838abd5934e0d829d2a1fbc99fb18b15ea8 (patch) | |
tree | 158d49484c7011f22a1020d24a4fe75b00e7f953 /databases/phpmyadmin211/Makefile | |
parent | da7449ba638c8f29715e83753dc4fe52d2b4b627 (diff) | |
download | freebsd-ports-gnome-8b52b838abd5934e0d829d2a1fbc99fb18b15ea8.tar.gz freebsd-ports-gnome-8b52b838abd5934e0d829d2a1fbc99fb18b15ea8.tar.zst freebsd-ports-gnome-8b52b838abd5934e0d829d2a1fbc99fb18b15ea8.zip |
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)
Diffstat (limited to 'databases/phpmyadmin211/Makefile')
-rw-r--r-- | databases/phpmyadmin211/Makefile | 76 |
1 files changed, 53 insertions, 23 deletions
diff --git a/databases/phpmyadmin211/Makefile b/databases/phpmyadmin211/Makefile index fdc12db6fdfd..79b048557ec7 100644 --- a/databases/phpmyadmin211/Makefile +++ b/databases/phpmyadmin211/Makefile @@ -7,6 +7,7 @@ PORTNAME= phpMyAdmin DISTVERSION= 2.11.4 +PORTREVISION= 1 CATEGORIES= databases www MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= phpmyadmin @@ -21,10 +22,6 @@ NO_BUILD= yes USE_PHP= ctype mysql pcre session .endif -SUB_LIST+= "MYADMDIR=${MYADMDIR}" \ - "PKGNAME=${PKGNAME}" -SUB_FILES= pkg-message - # Unfortunately can't make WITH_SUPHP part of the OPTIONS selection, # since it has to be processed before just about anything else. @@ -34,18 +31,43 @@ PKGNAMESUFFIX= -suphp RUN_DEPENDS+= ${LOCALBASE}/sbin/suphp:${PORTSDIR}/www/suphp WANT_PHP_CGI= yes -MYADMUSR?= phpmyadm - -SUB_LIST+= "MYADMUSR=${MYADMUSR}" \ - "MYADMGRP=${MYADMGRP}" -SUB_FILES+= pkg-install pkg-deinstall - .else WANT_PHP_WEB= yes .endif +# PMA_USR is only used WITH_SUPHP + +PMA_GRP?= ${WWWGRP} +PMA_GID?= ${_PMA_GID} +CFGFILE= config.inc.php + +PLIST= ${WRKDIR}/plist +PLIST_SUB+= PMA_GRP=${PMA_GRP} + +.if defined(WITH_SUPHP) && !defined(WITHOUT_SUPHP) + +PMA_USR?= _pma +PMA_UID?= 336 +PMA_GCOS?= "phpMyAdmin Owner" +PMA_HOME?= /nonexistent +PMA_SHELL?= /sbin/nologin + +SUB_LIST+= PMA_USR=${PMA_USR} \ + PMA_UID=${PMA_UID} \ + PMA_GRP=${PMA_GRP} \ + PMA_GID=${PMA_GID} \ + PMA_GCOS=${PMA_GCOS} \ + PMA_HOME=${PMA_HOME} \ + PMA_SHELL=${PMA_SHELL} +SUB_FILES+= pkg-install pkg-deinstall + +.endif + +SUB_LIST+= PKGNAME=${PKGNAME} +SUB_FILES+= pkg-message + # Copy the way lang/php{4,5}-extensions deals with its OPTIONS -- avoids # problems with include of bsd.port.pre.mk @@ -82,13 +104,12 @@ USE_PHP+= ${opt:L} .endfor .endif -# MYADMUSR is only used WITH_SUPHP -MYADMDIR?= www/phpMyAdmin -MYADMGRP?= ${WWWGRP} -CFGFILE= config.inc.php +.include <bsd.port.pre.mk> -PLIST= ${WRKDIR}/plist -PLIST_SUB+= MYADMDIR=${MYADMDIR} MYADMGRP=${MYADMGRP} +_PMA_GID!= /usr/sbin/pw group show -n ${PMA_GRP} | ${CUT} -d : -f 3 +.if empty(_PMA_GID) +_PMA_GID= 80 +.endif .SILENT: @@ -109,6 +130,15 @@ pre-everything:: ${ECHO_MSG} "install lang/php4 before attempting to install" ${ECHO_MSG} "databases/phpmyadmin" ${ECHO_MSG} "" +.if defined(WITH_SUPHP) && !defined(WITHOUT_SUPHP) + @if /usr/sbin/pw show -n phpmyadm >/dev/null 2>&1 ; then \ + ${ECHO_MSG} "===> WARNING ******************************" ; \ + ${ECHO_MSG} "The default username used by ${PKNAME} has changed"; \ + ${ECHO_MSG} "to ${PMA_USR} -- you should delete the old user:" ; \ + ${ECHO_MSG} " # /usr/sbin/pw user del -n phpmyadm" ; \ + ${ECHO_MSG} "" ; \ + fi +.endif # When creating a package, empty directories will not be generated # from the pkg tarball. Therefore make sure no directories are empty. @@ -121,11 +151,11 @@ post-patch: ${CP} ${FILESDIR}/${CFGFILE}.sample ${WRKSRC}/${CFGFILE}.sample cd ${WRKSRC} ; \ ${FIND} . ! -type d ! -name ${CFGFILE}.sample | ${SORT} | \ - ${SED} -e "s,^\.,%%MYADMDIR%%," >${PLIST} ; \ + ${SED} -e "s,^\.,%%WWWDIR%%," >${PLIST} ; \ ${CAT} ${PKGDIR}/pkg-plist-chunk >>${PLIST} ; \ ${FIND} . -type d | ${SORT} -r | ${SED} \ - -e "s,^\.$$,@dirrmtry %%MYADMDIR%%," \ - -e "s,^\.,@dirrm %%MYADMDIR%%," >>${PLIST} + -e "s,^\.$$,@dirrmtry %%WWWDIR%%," \ + -e "s,^\.,@dirrm %%WWWDIR%%," >>${PLIST} pre-install: .if defined(WITH_SUPHP) @@ -137,7 +167,7 @@ do-install: install-app install-conf install-app: cd ${WRKSRC} ; \ for src in $$( ${FIND} . ! -name .cvsignore ) ; do \ - dst=${PREFIX}/${MYADMDIR}$${src#.} ; \ + dst=${WWWDIR}$${src#.} ; \ if ${TEST} -d $$src ; then \ ${MKDIR} $$dst ; \ else \ @@ -146,9 +176,9 @@ install-app: done install-conf: install-app - cd ${PREFIX}/${MYADMDIR} ; \ + cd ${WWWDIR} ; \ ${CHMOD} 0640 ${CFGFILE}.sample ; \ - ${CHGRP} ${MYADMGRP} ${CFGFILE}.sample ; \ + ${CHGRP} ${PMA_GRP} ${CFGFILE}.sample ; \ if ${TEST} ! -f ${CFGFILE} ; then \ ${CP} -p ${CFGFILE}.sample ${CFGFILE} ; \ fi @@ -159,4 +189,4 @@ post-install: .endif ${CAT} ${PKGMESSAGE} -.include <bsd.port.mk> +.include <bsd.port.post.mk> |