From cd86643c54d876ba244d164feff192d7fd0d68cb Mon Sep 17 00:00:00 2001 From: Olli Hauer Date: Sun, 22 Jul 2012 18:50:58 +0000 Subject: [PATCH] - apache20 has no SLAVE_PORTS so cleanup and simplify Makefile.modules - use port framework instead pkg-install to check for www user - no REVISION bump, logic / functionality has not changed with hat apache@ --- www/apache20/Makefile | 6 ++-- www/apache20/Makefile.modules | 67 ++++++++++++++++++----------------- www/apache20/pkg-install | 35 ------------------ 3 files changed, 37 insertions(+), 71 deletions(-) delete mode 100644 www/apache20/pkg-install diff --git a/www/apache20/Makefile b/www/apache20/Makefile index b53f7e0dac5c..a3aebe09e606 100644 --- a/www/apache20/Makefile +++ b/www/apache20/Makefile @@ -26,6 +26,9 @@ LIB_DEPENDS= expat:${PORTSDIR}/textproc/expat2 \ pcre:${PORTSDIR}/devel/pcre \ apr-0:${PORTSDIR}/devel/apr0 +USERS= www +GROUPS= www + MAKE_JOBS_SAFE= yes DEPRECATED= will be unsupported by ASF when 2.4.0 is release, migrate to 2.2.x+ now @@ -216,9 +219,6 @@ post-configure: @${REINPLACE_CMD} -e "s,%%PREFIX%%,${PREFIX}," \ ${WRKSRC}/support/envvars-std -pre-install: - @PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL - post-install: @${MKDIR} ${PREFIX}/etc/apache2/envvars.d @${MKDIR} ${PREFIX}/etc/apache2/Includes diff --git a/www/apache20/Makefile.modules b/www/apache20/Makefile.modules index f4774b696fe9..c83d8a6804b5 100644 --- a/www/apache20/Makefile.modules +++ b/www/apache20/Makefile.modules @@ -13,50 +13,51 @@ # # MPM section: -# << TO BE WRITTEN >> -.if defined (SLAVE_PORT_MPM) -PLIST_SUB+= PREFORK="@comment " WORKER="@comment " -PKGNAMESUFFIX= -${SLAVE_PORT_MPM} +# WITH_MPM: prefork worker perchild threadpool itk + +.if ${WITH_MPM:L} == "prefork" +PLIST_SUB+= WORKER="@comment " THREADPOOL="@comment " + +.elif ${WITH_MPM:L} == "worker" +PLIST_SUB+= WORKER="" THREADPOOL="@comment " + +.elif ${WITH_MPM:L} == "threadpool" +PLIST_SUB+= WORKER="@comment " THREADPOOL="" + +.elif ${WITH_MPM:L} == "perchild" +PLIST_SUB+= WORKER="@comment " THREADPOOL="@comment " + +.elif ${WITH_MPM:L} == "itk" +PLIST_SUB+= WORKER="@comment " THREADPOOL="@comment " +EXTRA_PATCHES+= ${PATCHDIR}/mpm-itk-${MPM_ITK_VERSION} + .else -. if ${WITH_MPM} != "prefork" +IGNORE= "Unknown MPM: ${WITH_MPM}" +.endif # MPM prefork + +.if ${WITH_MPM:L} != "prefork" PKGNAMESUFFIX= -${WITH_MPM:L} -. if ${WITH_MPM:L} != "itk" +.endif + +.if ${WITH_MPM:L} == "worker" || ${WITH_MPM:L} == "perchild" || ${WITH_MPM:L} == "threadpool" WITH_THREADS= yes WITH_THREADS_MODULES= yes WITHOUT_MODULES+= cgi -. endif -. if ${WITH_MPM:L} == "worker" -PLIST_SUB+= PREFORK="@comment " WORKER="" THREADPOOL="@comment " -. elif ${WITH_MPM:L} == "perchild" -PLIST_SUB+= PREFORK="@comment " WORKER="@comment " THREADPOOL="@comment " -. elif ${WITH_MPM:L} == "threadpool" -PLIST_SUB+= PREFORK="@comment " WORKER="@comment " THREADPOOL="" -. elif ${WITH_MPM:L} == "itk" -PLIST_SUB+= PREFORK="@comment " WORKER="@comment " THREADPOOL="@comment " -EXTRA_PATCHES+= ${PATCHDIR}/mpm-itk-${MPM_ITK_VERSION} -. else -IGNORE= "Unknown MPM: ${WITH_MPM}" -. endif -. else -PLIST_SUB+= PREFORK="@comment " WORKER="@comment " THREADPOOL="@comment " -. endif -.else -PLIST_SUB+= PREFORK="@comment " WORKER="@comment " THREADPOOL="@comment " .endif # xDBM section # .if !defined(WITH_DBM) . if defined(WITH_BDB) || defined(WITH_BDB_BASE) || defined(WITH_BERKELEYDB) -WITH_DBM=bdb +WITH_DBM= bdb . endif .endif .if defined(WITH_BERKELEYDB) && !defined(WITH_BDB_VER) . if ${WITH_BERKELEYDB} == "FreeBSD" - WITH_BDB_BASE=YES +WITH_BDB_BASE=YES . else - WITH_BDB_VER=${WITH_BERKELEYDB:S/db//} +WITH_BDB_VER=${WITH_BERKELEYDB:S/db//} . endif .endif @@ -64,19 +65,19 @@ WITH_DBM=bdb . if ${WITH_DBM:L} == "sdbm" CONFIGURE_ARGS+= --with-dbm=sdbm . elif ${WITH_DBM:L} == "ndbm" -CONFIGURE_ARGS+= --with-ndbm +CONFIGURE_ARGS+= --with-ndbm . elif ${WITH_DBM:L} == "gdbm" LIB_DEPENDS+= gdbm:${PORTSDIR}/databases/gdbm CONFIGURE_ARGS+= --with-gdbm=${LOCALBASE} . elif ${WITH_DBM:L} == "db" || ${WITH_DBM:L} == "bdb" . if defined(WITH_BDB_BASE) -CONFIGURE_ARGS+= --with-dbm=db185 \ - --with-berkeley-db=/usr +CONFIGURE_ARGS+= --with-dbm=db185 \ + --with-berkeley-db=/usr . else -USE_BDB= yes +USE_BDB= yes INVALID_BDB_VER= 46 47 -CONFIGURE_ARGS+= --with-dbm=db${BDB_VER:S/40/4/} \ - --with-berkeley-db=${LOCALBASE} +CONFIGURE_ARGS+= --with-dbm=db${BDB_VER:S/40/4/} \ + --with-berkeley-db=${LOCALBASE} . endif . else . else diff --git a/www/apache20/pkg-install b/www/apache20/pkg-install deleted file mode 100644 index 5910273e21e3..000000000000 --- a/www/apache20/pkg-install +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -# $FreeBSD$ -# - -if [ "$2" != "PRE-INSTALL" ]; then - exit 0 -fi - -WWWUSER=www -WWWGROUP=${WWWUSER} -WWWUID=80 -WWWGID=${WWWUID} - -if ! pw groupshow "${WWWGROUP}" 2>/dev/null 1>&2; then - if pw groupadd ${WWWGROUP} -g ${WWWGID}; then - echo "Added group \"${WWWGROUP}\"." - else - echo "Adding group \"${WWWGROUP}\" failed..." - exit 1 - fi -fi - -if ! pw usershow "${WWWUSER}" 2>/dev/null 1>&2; then - if pw useradd ${WWWUSER} -u ${WWWUID} -g ${WWWGROUP} -h - \ - -s "/sbin/nologin" -d "/nonexistent" \ - -c "World Wide Web Owner"; \ - then - echo "Added user \"${WWWUSER}\"." - else - echo "Adding user \"${WWWUSER}\" failed..." - exit 1 - fi -fi - -exit 0