Index: www/apache24/Makefile =================================================================== --- www/apache24/Makefile +++ www/apache24/Makefile @@ -30,7 +30,6 @@ CPE_PRODUCT= http_server PORTDOCS= * -SUB_FILES= pkg-install pkg-deinstall # XXX: before running makepatch please run the command # `$SED -e 's/PATCH_PATH_SEPARATOR=/PATCH_PATH_SEPARATOR?=/' Mk/bsd.port.mk @@ -99,7 +98,7 @@ SSL_USES= ssl .include -ETC_SUBDIRS= Includes envvars.d extra modules.d +ETC_SUBDIRS= Includes envvars.d extra apache.d modules.d APR_CONFIG?= ${LOCALBASE}/bin/apr-1-config APU_CONFIG?= ${LOCALBASE}/bin/apu-1-config @@ -193,8 +192,10 @@ ${WRKSRC}/docs/conf/httpd.conf ${REINPLACE_CMD} -e "s,%%PREFIX%%,${PREFIX}," ${WRKSRC}/support/envvars-std -post-install: +pre-install: @${MKDIR} ${ETC_SUBDIRS:S|^|${STAGEDIR}${ETCDIR}/|} + +post-install: ${INSTALL_DATA} ${FILESDIR}/no-accf.conf ${STAGEDIR}${ETCDIR}/Includes/ # place for 3rd party module configuration ${INSTALL_DATA} ${FILESDIR}/README_modules.d ${STAGEDIR}${ETCDIR}/modules.d/ @@ -202,6 +203,11 @@ -${STRIP_CMD} ${STAGEDIR}${PREFIX}/sbin/* 2>/dev/null -${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/* -${STRIP_CMD} ${STAGEDIR}${PREFIX}/libexec/apache24/mod_*.so + @${MKDIR} ${STAGEDIR}${DATADIR}/apache.d + mv ${STAGEDIR}${ETCDIR}/apache.d/*.conf.sample ${STAGEDIR}${DATADIR}/apache.d + (cd ${STAGEDIR}${DATADIR}; \ + ${FIND} apache.d -name '*.sample' | \ + sed -e 's|\(.*\)\(.sample\)|@sample ${DATADIR_REL}/\1\2 ${ETCDIR_REL}/\1 |' >> ${TMPPLIST}) post-install-LOG_FORENSIC-on: ${INSTALL_SCRIPT} ${WRKSRC}/support/check_forensic ${STAGEDIR}${PREFIX}/sbin Index: www/apache24/files/patch-Makefile.in =================================================================== --- www/apache24/files/patch-Makefile.in +++ www/apache24/files/patch-Makefile.in @@ -1,4 +1,4 @@ ---- Makefile.in.orig 2016-03-20 15:51:49 UTC +--- Makefile.in.orig 2017-09-19 10:15:00 UTC +++ Makefile.in @@ -32,12 +32,9 @@ include $(top_srcdir)/build/program.mk install-conf: @@ -14,7 +14,23 @@ done; \ for j in $(top_srcdir)/docs/conf $(top_builddir)/docs/conf ; do \ cd $$j ; \ -@@ -98,15 +95,12 @@ install-conf: +@@ -88,6 +85,7 @@ install-conf: + loading_disabled=""; \ + fi; \ + fi; \ ++ ( \ + if test $$j = "cgid" -a "$$have_cgi" = "1"; then \ + echo ""; \ + echo " $${loading_disabled}LoadModule $${j}_module $(rel_libexecdir)/mod_$${j}.so"; \ +@@ -99,6 +97,7 @@ install-conf: + else \ + echo "$${loading_disabled}LoadModule $${j}_module $(rel_libexecdir)/mod_$${j}.so"; \ + fi; \ ++ ) > $(DESTDIR)$(sysconfdir)/apache.d/$${j}.conf.sample; \ + fi; \ + done; \ + sed -e '1,/@@LoadModule@@/d' \ +@@ -108,15 +107,12 @@ install-conf: -e 's#@@SSLPort@@#$(SSLPORT)#g' \ < $$i; \ fi \ @@ -32,7 +48,7 @@ fi; \ done ; \ done ; \ -@@ -157,48 +151,25 @@ dox: +@@ -167,48 +163,25 @@ dox: doxygen $(top_srcdir)/docs/doxygen.conf install-htdocs: @@ -90,7 +106,7 @@ install-other: @test -d $(DESTDIR)$(logfiledir) || $(MKINSTALLDIRS) $(DESTDIR)$(logfiledir) -@@ -252,12 +223,7 @@ install-man: +@@ -262,12 +235,7 @@ install-man: @test -d $(DESTDIR)$(manualdir) || $(MKINSTALLDIRS) $(DESTDIR)$(manualdir) @cp -p $(top_srcdir)/docs/man/*.1 $(DESTDIR)$(mandir)/man1 @cp -p $(top_srcdir)/docs/man/*.8 $(DESTDIR)$(mandir)/man8 Index: www/apache24/files/patch-docs__conf__httpd.conf.in =================================================================== --- www/apache24/files/patch-docs__conf__httpd.conf.in +++ www/apache24/files/patch-docs__conf__httpd.conf.in @@ -1,16 +1,17 @@ ---- docs/conf/httpd.conf.in.orig 2015-11-03 11:58:58 UTC +--- docs/conf/httpd.conf.in.orig 2016-08-16 23:12:07 UTC +++ docs/conf/httpd.conf.in -@@ -65,6 +65,9 @@ Listen @@Port@@ +@@ -65,6 +65,10 @@ Listen @@Port@@ # @@LoadModule@@ ++IncludeOptional @rel_sysconfdir@/apache.d/*.conf +# Third party modules +IncludeOptional @rel_sysconfdir@/modules.d/[0-9][0-9][0-9]_*.conf + # # If you wish httpd to run as a different user or group, you must run -@@ -74,8 +77,8 @@ Listen @@Port@@ +@@ -74,8 +78,8 @@ Listen @@Port@@ # It is usually good practice to create a dedicated user and group for # running httpd, as with most system services. # @@ -21,7 +22,7 @@ -@@ -181,7 +184,7 @@ DocumentRoot "@exp_htdocsdir@" +@@ -181,7 +185,7 @@ DocumentRoot "@exp_htdocsdir@" # logged here. If you *do* define an error logfile for a # container, that host's errors will be logged there and not here. # @@ -30,7 +31,7 @@ # # LogLevel: Control the number of messages logged to the error_log. -@@ -210,13 +213,13 @@ LogLevel warn +@@ -210,13 +214,13 @@ LogLevel warn # define per- access logfiles, transactions will be # logged therein and *not* in this file. # @@ -46,7 +47,7 @@ -@@ -407,3 +410,5 @@ SSLRandomSeed startup builtin +@@ -416,3 +420,5 @@ SSLRandomSeed startup builtin SSLRandomSeed connect builtin Index: www/apache24/files/pkg-deinstall.in =================================================================== --- www/apache24/files/pkg-deinstall.in +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# - -MPM_FALLBACK="%%ETCDIR%%/modules.d/%%MPMF%%" - -_cleanup(){ - if [ -f ${MPM_FALLBACK} ]; then - echo -n "remove fallback MPM : " - /bin/rm -vf ${MPM_FALLBACK} - fi -} - -# run only if build with modular MPM -if [ "x$2" = "xDEINSTALL" ]; then - %%MPM_FALLBACK_CHECK%%_cleanup -fi - Index: www/apache24/files/pkg-install.in =================================================================== --- www/apache24/files/pkg-install.in +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# - -# Note: -# We have to use grep or wc after awk, else -# there is no usable ret value that can be -# used for further processing - -HTTPD_CONF="%%ETCDIR%%/httpd.conf" -MPM_FALLBACK="%%ETCDIR%%/modules.d/%%MPMF%%" - -_log_msg(){ - /usr/bin/logger -p local0.notice -s -t apache24 "$1" -} - -_check_deprecated(){ -if [ -r ${HTTPD_CONF} ]; then - /usr/bin/awk '/^LoadModule[[:blank:]]+mpm_(event|prefork|worker)_module/ {print $2}' ${HTTPD_CONF} | /usr/bin/grep -q '^mpm_' - if [ $? -ne 0 ]; then - _log_msg "===================================================" - _log_msg "WARNING!" - _log_msg " No apache MPM module is activated in httpd.conf," - _log_msg " mpm_prefork will be activated as fall back" - _log_msg "" - _log_msg " Please follow the instructions in" - _log_msg " ${MPM_FALLBACK}" - _log_msg "===================================================" - -cat > ${MPM_FALLBACK} << _EOF -# ================================================================== -# Note: -# www/apache24 build changed from static MPM to modular MPM loading! -# -# This file was installed as fall back, since no activated MPM -# was detected in the existing httpd.conf. -# -# Please merge additions from httpd.conf.sample into your httpd.conf! -# -# After activating one of the mpm_modules in httpd.conf it is save -# to deactivate the "LoadModule" line in this file. -# -# In case mod_(php|perl|python|...) modules from the official FreeBSD -# package repo are installed please use the mpm_prefork module, else -# feel free to test mpm_event (preferred) or mpm_worker. -# -# For more information see: -# http://httpd.apache.org/docs/2.4/mod/ -# ================================================================== - -LoadModule mpm_prefork_module libexec/apache24/mod_mpm_prefork.so -_EOF - - fi # $? -ne 0 -else - echo ${HTTPD_CONF} not readable -fi -} - -# run only if build with modular MPM -if [ "$2" = "POST-INSTALL" ]; then - %%MPM_FALLBACK_CHECK%%_check_deprecated -fi - Index: www/apache24/pkg-plist =================================================================== --- www/apache24/pkg-plist +++ www/apache24/pkg-plist @@ -515,5 +515,6 @@ %%WWWDIR%%/icons/world2.png %%WWWDIR%%/icons/xml.png @preunexec rm -f %D/%%ETCDIR%%/httpd.conf.bak 2> /dev/null || true +@dir %%ETCDIR%%/apache.d @dir %%ETCDIR%%/envvars.d @dir %%WWWDIR%%/data