diff options
author | Martin Wilke <miwi@FreeBSD.org> | 2008-01-21 10:58:20 +0000 |
---|---|---|
committer | Martin Wilke <miwi@FreeBSD.org> | 2008-01-21 10:58:20 +0000 |
commit | 784cf429418a5d41f90a1541851fa5c86f51f402 (patch) | |
tree | 6c732b6232a9ef6d529e62641a7558613dd54c36 /databases/phpmyadmin211/Makefile | |
parent | b6a7e8059227098bbbdc6ea2b970f6a4e14791a3 (diff) | |
download | ports-784cf429418a5d41f90a1541851fa5c86f51f402.tar.gz ports-784cf429418a5d41f90a1541851fa5c86f51f402.zip |
Notes
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> |