diff options
author | clement <clement@FreeBSD.org> | 2005-12-13 22:26:57 +0000 |
---|---|---|
committer | clement <clement@FreeBSD.org> | 2005-12-13 22:26:57 +0000 |
commit | 52224442bf85189ba95af70b2bc34be12a88bd05 (patch) | |
tree | 0ea39cc24e6aa2204a463618ea38b86f1f203528 /www/apache22 | |
parent | da547804247c7c777efc2e3bad28c087a343d1e2 (diff) | |
download | FreeBSD-ports-52224442bf85189ba95af70b2bc34be12a88bd05.zip FreeBSD-ports-52224442bf85189ba95af70b2bc34be12a88bd05.tar.gz |
- Fix envvars.d [1]
- Add apache22_http_accept_enable to load accf_http kernel module [2]
Additionnally, if it's not defined, we drop accept filter support
- Drop obsolete apache22ssl_enable rc.conf option
- Sync apache22.sh behavior with apachectl
Add graceful and graceful-stop targets
- Rework categories (add CACHE_MODULES)
- Add support for apr_dbd: MySQL, PostgrSQL and SQLite3 backends are supported
It adds mod_auth_dbd and mod_dbd automatically
more fixes to come soon...
PR: ports/90309 [1],
ports/90103 [2]
Submitted by: Simun Mikecin <sime@data.home.hr> [1],
Melvyn Sopacua <melvyn@melvyn.homeunix.net> [2]
Diffstat (limited to 'www/apache22')
-rw-r--r-- | www/apache22/Makefile | 20 | ||||
-rw-r--r-- | www/apache22/Makefile.doc | 1 | ||||
-rw-r--r-- | www/apache22/Makefile.modules | 45 | ||||
-rw-r--r-- | www/apache22/distinfo | 3 | ||||
-rw-r--r-- | www/apache22/files/apache.sh | 40 | ||||
-rw-r--r-- | www/apache22/files/no-accf.conf | 4 | ||||
-rw-r--r-- | www/apache22/files/patch-support:envvars-std.in | 2 | ||||
-rw-r--r-- | www/apache22/pkg-plist | 7 |
8 files changed, 92 insertions, 30 deletions
diff --git a/www/apache22/Makefile b/www/apache22/Makefile index 22ffd4b..21cce3a 100644 --- a/www/apache22/Makefile +++ b/www/apache22/Makefile @@ -12,10 +12,12 @@ PORTVERSION= 2.2.0 PORTREVISION= 3 CATEGORIES= www MASTER_SITES= ${MASTER_SITE_APACHE_HTTPD} \ - ${MASTER_SITE_LOCAL:S/%SUBDIR%/clement/}:powerlogo + ${MASTER_SITE_LOCAL:S/%SUBDIR%/clement/}:powerlogo \ + http://apache.webthing.com/database/:aprmysql DISTNAME= httpd-${PORTVERSION} DISTFILES= ${DISTNAME}.tar.bz2 \ - powerlogo.gif:powerlogo + powerlogo.gif:powerlogo \ + apr_dbd_mysql.c:aprmysql DIST_SUBDIR= apache22 EXTRACT_ONLY= ${DISTNAME}.tar.bz2 @@ -189,7 +191,10 @@ pre-everything:: @${ECHO_MSG} "" post-extract: - @${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/powerlogo.gif ${WRKSRC}/docs/icons/freebsd.gif + @${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/powerlogo.gif \ + ${WRKSRC}/docs/icons/freebsd.gif + @${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/apr_dbd_mysql.c \ + ${WRKSRC}/srclib/apr-util/dbd post-patch: @${REINPLACE_CMD} -e 's,apache_pb,icons/freebsd.gif" ALT="[Powered by FreeBSD]"><IMG SRC="apache_pb2_ani,g' \ @@ -212,9 +217,11 @@ post-configure: @FTPUSERS=`${EGREP} -v '^#' /etc/ftpusers| ${TR} -s "\n" " "` ;\ ${REINPLACE_CMD} -e "s,%%FTPUSERS%%,$$FTPUSERS," \ ${WRKSRC}/docs/conf/extra/httpd-userdir.conf - ${REINPLACE_CMD} -e "s,%%WWWOWN%%,${WWWOWN}, ; \ - s,%%WWWGRP%%,${WWWGRP}, " \ + @${REINPLACE_CMD} -e "s,%%WWWOWN%%,${WWWOWN}, ; \ + s,%%WWWGRP%%,${WWWGRP}," \ ${WRKSRC}/docs/conf/httpd.conf + @${REINPLACE_CMD} -e "s,%%PREFIX%%,${PREFIX}," \ + ${WRKSRC}/support/envvars-std pre-install: @PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL @@ -231,9 +238,10 @@ install-startup-script: post-install: install-startup-script @${MKDIR} ${PREFIX}/etc/apache22/envvars.d @${MKDIR} ${PREFIX}/etc/apache22/Includes - @${CAT} ${PKGMESSAGE} + @${INSTALL_DATA} ${FILESDIR}/no-accf.conf ${PREFIX}/etc/apache22/Includes .if !defined(NOPORTDOCS) @[ -d ${DOCSDIR}/style/lang/ ] && ${TOUCH} ${DOCSDIR}/style/lang/.keepme .endif + @${CAT} ${PKGMESSAGE} .include <bsd.port.post.mk> diff --git a/www/apache22/Makefile.doc b/www/apache22/Makefile.doc index 38d28b5..d5994c6 100644 --- a/www/apache22/Makefile.doc +++ b/www/apache22/Makefile.doc @@ -28,6 +28,7 @@ ## threadpool (testing purpose only) ## WITH_HTTP_PORT: default: 80 ## WITH_LDAP: Enable LDAP support (mod_auth_ldap) (implies WITH_LDAP_MODULES) +## WITH_(MYSQL|PGSQL|SQLITE): Enable SQL backend *dbd ## WITHOUT_V4MAPPED ## WITH_IPV6_V6ONLY: Don't allow IPv6 sockets to handle IPv4 ## connections diff --git a/www/apache22/Makefile.modules b/www/apache22/Makefile.modules index 4518136..7eea1ee 100644 --- a/www/apache22/Makefile.modules +++ b/www/apache22/Makefile.modules @@ -94,6 +94,31 @@ IGNORE= "Unknown DBM" CONFIGURE_ARGS+= --with-dbm=sdbm .endif +.if defined(WITH_MYSQL) +USE_MYSQL= YES +CONFIGURE_ARGS+= --with-mysql=${LOCALBASE} +CFLAGS+= -I${LOCALBASE}/include/mysql ${PTHREAD_CFLAGS} +LDFLAGS+= -L${LOCALBASE}/lib/mysql ${PTHREAD_LIBS} +CONFIGURE_ENV+= LIBS="${LIBS}" +WITH_THREADS= YES +AUTHN_MODULES= authn_dbd +MISC_MODULES= dbd +.endif + +.if defined(WITH_PGSQL) +USE_PGSQL= YES +CONFIGURE_ARGS+= --with-pgsql=${LOCALBASE} +AUTHN_MODULES= authn_dbd +MISC_MODULES= dbd +.endif + +.if defined(WITH_SQLITE) +USE_SQLITE= YES +CONFIGURE_ARGS+= --with-sqlite3=${LOCALBASE} +AUTHN_MODULES= authn_dbd +MISC_MODULES= dbd +.endif + .if defined(WITH_THREADS) CONFIGURE_ARGS+= --enable-threads . if ${WITH_PTHREAD_LIBS} != "c_r" && ${OSVERSION} > 500023 @@ -112,19 +137,19 @@ WITH_SSL_MODULES= yes CONFIGURE_ARGS+= --with-ssl=${OPENSSLBASE} .endif -AUTH_MODULES= auth_basic auth_digest -AUTHN_MODULES= authn_file authn_dbm authn_anon authn_default +AUTH_MODULES+= auth_basic auth_digest +AUTHN_MODULES+= authn_file authn_dbm authn_anon authn_default AUTHZ_MODULES= authz_host authz_groupfile authz_user authz_dbm \ authz_owner authz_default +CACHE_MODULES= cache disk_cache file_cache mem_cache DAV_MODULES= dav dav_fs EXPERIMENTAL_MODULES= bucketeer case_filter case_filter_in ext_filter charset_lite \ log_forensic optional_hook_export optional_hook_import \ - optional_fn_import optional_fn_export \ - mem_cache + optional_fn_import optional_fn_export LDAP_MODULES= ldap authnz_ldap -MISC_MODULES= actions alias asis autoindex cache cern_meta \ - cgi charset_lite deflate dir disk_cache env expires \ - file_cache headers imagemap include info log_config logio mime \ +MISC_MODULES+= actions alias asis autoindex cern_meta \ + cgi charset_lite deflate dir env expires \ + headers imagemap include info log_config logio mime \ mime_magic negotiation rewrite setenvif speling status \ unique_id userdir usertrack vhost_alias filter PROXY_MODULES= proxy proxy_connect proxy_ftp proxy_http proxy_ajp proxy_balancer @@ -133,7 +158,7 @@ SUEXEC_MODULES= suexec THREADS_MODULES= cgid DEFAULT_MODULES_CATEGORIES= \ - AUTH AUTHN AUTHZ DAV MISC + AUTH AUTHN AUTHZ DAV CACHE MISC -ALL_MODULES_CATEGORIES= AUTH AUTHN AUTHZ DAV EXPERIMENTAL LDAP MISC \ - PROXY SSL SUEXEC THREADS +ALL_MODULES_CATEGORIES= AUTH AUTHN AUTHZ CACHE DAV EXPERIMENTAL LDAP \ + MISC PROXY SSL SUEXEC THREADS diff --git a/www/apache22/distinfo b/www/apache22/distinfo index 42ca37d..1503d79 100644 --- a/www/apache22/distinfo +++ b/www/apache22/distinfo @@ -4,3 +4,6 @@ SIZE (apache22/httpd-2.2.0.tar.bz2) = 4839151 MD5 (apache22/powerlogo.gif) = 0f106073b3c7844cf22d4df126b27c62 SHA256 (apache22/powerlogo.gif) = 0144675a80761b9660bdb652d331d9ba3bebdff89c0fa35a56aa463662a53254 SIZE (apache22/powerlogo.gif) = 5279 +MD5 (apache22/apr_dbd_mysql.c) = 59d26a91cb7f1492fea9ab3e6cd054fc +SHA256 (apache22/apr_dbd_mysql.c) = db204a0e9a89620bf890985383b637d201b418002a0976a2476c0c58783cc3a3 +SIZE (apache22/apr_dbd_mysql.c) = 18999 diff --git a/www/apache22/files/apache.sh b/www/apache22/files/apache.sh index cfaeddd..d6b5b8d 100644 --- a/www/apache22/files/apache.sh +++ b/www/apache22/files/apache.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $FreeBSD: /tmp/pcvs/ports/www/apache22/files/Attic/apache.sh,v 1.9 2005-12-03 22:02:58 clement Exp $ +# $FreeBSD: /tmp/pcvs/ports/www/apache22/files/Attic/apache.sh,v 1.10 2005-12-13 22:26:57 clement Exp $ # # PROVIDE: apache22 @@ -12,9 +12,6 @@ # Add the following lines to /etc/rc.conf to enable apache22: # apache22_enable (bool): Set to "NO" by default. # Set it to "YES" to enable apache22 -# apache22ssl_enable (bool): Set to "NO" by default. -# Set it to "YES" to start apache with SSL -# (if <IfDefined SSL> exists in httpd.conf) # apache22limits_enable (bool):Set to "NO" by default. # Set it to yes to run `limits $limits_args` # just before apache starts. @@ -22,7 +19,9 @@ # Extra flags passed to start command. # apache22limits_args (str): Default to "-e -C daemon" # Arguments of pre-start limits run. -# +# apache22_http_accept_enable (bool): Set to "NO" by default. +# Set to yes to check for accf_http kernel +# module on start up and load if not loaded. . %%RC_SUBR%% name="apache22" @@ -31,20 +30,30 @@ rcvar=`set_rcvar` start_precmd="apache22_precmd" restart_precmd="apache22_checkconfig" reload_precmd="apache22_checkconfig" +reload_cmd="apache22_graceful" +graceful_cmd="apache22_graceful" +gracefulstop_cmd="apache22_gracefulstop" command="%%PREFIX%%/sbin/httpd" pidfile="/var/run/httpd.pid" required_files=%%PREFIX%%/etc/apache22/httpd.conf [ -z "$apache22_enable" ] && apache22_enable="NO" -[ -z "$apache22ssl_enable" ] && apache22ssl_enable="NO" [ -z "$apache22_flags" ] && apache22_flags="" [ -z "$apache22limits_enable" ] && apache22limits_enable="NO" [ -z "$apache22limits_args" ] && apache22limits_args="-e -C daemon" +[ -z "$apache22_http_accept_enable" ] && apache22_http_accept_enable="NO" load_rc_config $name -checkyesno apache22ssl_enable && \ - apache22_flags="-DSSL $apache22_flags" +if checkyesno apache22_http_accept_enable +then + if ! /sbin/kldstat -q -m accf_http + then + /sbin/kldload accf_http + fi +else + apache22_flags="-DNOHTTPACCEPT $apache22_flags" +fi apache22_checkconfig() { @@ -52,12 +61,23 @@ apache22_checkconfig() ${command} ${apache22_flags} -t } +apache22_graceful() { + echo "Performing a graceful restart" + ${command} -k graceful +} + +apache22_gracefulstop() { + echo "Performing a graceful stop" + ${command} -k graceful-stop +} + apache22_precmd() { if test -f %%PREFIX%%/sbin/envvars then . %%PREFIX%%/sbin/envvars fi + if checkyesno apache22limits_enable then eval `/usr/bin/limits ${apache22limits_args}` 2>/dev/null @@ -67,7 +87,5 @@ apache22_precmd() } -sig_reload=SIGUSR1 - -extra_commands="reload" +extra_commands="reload graceful gracefulstop" run_rc_command "$1" diff --git a/www/apache22/files/no-accf.conf b/www/apache22/files/no-accf.conf new file mode 100644 index 0000000..10e5164 --- /dev/null +++ b/www/apache22/files/no-accf.conf @@ -0,0 +1,4 @@ +<IfDefine NOHTTPACCEPT> + AcceptFilter http none + AcceptFilter https none +</IfDefine> diff --git a/www/apache22/files/patch-support:envvars-std.in b/www/apache22/files/patch-support:envvars-std.in index 6148034..c38910a 100644 --- a/www/apache22/files/patch-support:envvars-std.in +++ b/www/apache22/files/patch-support:envvars-std.in @@ -5,7 +5,7 @@ # @OS_SPECIFIC_VARS@ + -+ENVVARS_DIR=%%PREFIX%%/etc/apache21/envvars.d ++ENVVARS_DIR=%%PREFIX%%/etc/apache22/envvars.d + +for envvars_file in $(ls ${ENVVARS_DIR}/*.env 2>/dev/null) +do diff --git a/www/apache22/pkg-plist b/www/apache22/pkg-plist index 3fb4497..46253f5 100644 --- a/www/apache22/pkg-plist +++ b/www/apache22/pkg-plist @@ -1,5 +1,7 @@ @comment $FreeBSD$ @exec mkdir -p %D/etc/apache22/extra 2> /dev/null +@exec mkdir -p %D/etc/apache22/Includes 2> /dev/null || true +@exec mkdir -p %D/etc/apache22/envvars.d 2> /dev/null || true @unexec if cmp -s %D/etc/apache22/httpd.conf %D/%%EXAMPLESDIR%%/httpd.conf; then rm -f %D/etc/apache22/httpd.conf; fi %%EXAMPLESDIR%%/httpd.conf @exec [ -f %D/etc/apache22/httpd.conf ] || cp %D/%%EXAMPLESDIR%%/httpd.conf %D/etc/apache22/httpd.conf @@ -43,6 +45,7 @@ %%EXAMPLESDIR%%/extra/httpd-vhosts.conf @exec [ -f %D/etc/apache22/extra/httpd-vhosts.conf ] || cp %D/%%EXAMPLESDIR%%/extra/httpd-vhosts.conf %D/etc/apache22/extra/httpd-vhosts.conf etc/rc.d/apache22.sh +etc/apache22/Includes/no-accf.conf include/apache22/ap_compat.h include/apache22/ap_config.h include/apache22/ap_config_auto.h @@ -174,6 +177,7 @@ libexec/apache22/httpd.exp %%MOD_AUTH_BASIC%%libexec/apache22/mod_auth_basic.so %%MOD_AUTH_DIGEST%%libexec/apache22/mod_auth_digest.so %%MOD_AUTHN_ANON%%libexec/apache22/mod_authn_anon.so +%%MOD_AUTHN_DBD%%libexec/apache22/mod_authn_dbd.so %%MOD_AUTHN_DBM%%libexec/apache22/mod_authn_dbm.so %%MOD_AUTHN_DEFAULT%%libexec/apache22/mod_authn_default.so %%MOD_AUTHN_FILE%%libexec/apache22/mod_authn_file.so @@ -195,6 +199,7 @@ libexec/apache22/httpd.exp %%MOD_CHARSET_LITE%%libexec/apache22/mod_charset_lite.so %%MOD_DAV%%libexec/apache22/mod_dav.so %%MOD_DAV_FS%%libexec/apache22/mod_dav_fs.so +%%MOD_DBD%%libexec/apache22/mod_dbd.so %%MOD_DEFLATE%%libexec/apache22/mod_deflate.so %%MOD_DIR%%libexec/apache22/mod_dir.so %%MOD_DISK_CACHE%%libexec/apache22/mod_disk_cache.so @@ -530,8 +535,6 @@ www/apache22/icons/world2.png %%APR_PORTS%%@dirrm build-1 @unexec rmdir %D/libexec/apache22 2> /dev/null || true @dirrm include/apache22 -@exec mkdir -p %D/etc/apache22/Includes 2> /dev/null || true -@exec mkdir -p %D/etc/apache22/envvars.d 2> /dev/null || true @unexec rmdir %D/www/apache22 2> /dev/null || true @unexec rmdir %D/etc/apache22/Includes 2> /dev/null || true @unexec rm -f %D/etc/apache22/httpd.conf.bak 2> /dev/null || true |