1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-26 05:02:18 +00:00
freebsd-ports/www/apache13-modssl/Makefile
Norikatsu Shigemura 6a2523de1c s/run_rc_commmand/run_rc_command/
Pointed out by:	Dan Langille <dan@langille.org>
Pointy hat to:	nork
2004-05-03 16:27:45 +00:00

380 lines
13 KiB
Makefile

# New ports collection makefile for: Apache + mod_ssl
# Date created: Sat Aug 22 12:00:00 CDT 1998
# Whom: rse@engelschall.com
#
# $FreeBSD$
#
PORTNAME= apache+mod_ssl
PORTVERSION= ${VERSION_APACHE}+${VERSION_MODSSL}${PVERSION_MODSNMP}${PVERSION_MODACCEL}${PVERSION_MODDEFLATE}
PORTREVISION= 3
CATEGORIES= www security
MASTER_SITES= ${MASTER_SITE_APACHE_HTTPD} \
${MASTER_SITES_MODSSL:S/$/:mod_ssl/} \
http://www.mod-snmp.com/distr/:mod_snmp \
http://sysoev.ru/mod_accel/:mod_accel \
http://sysoev.ru/mod_deflate/:mod_deflate
PKGNAMESUFFIX?= ${MODSNMP_SUFFIX}${MODACCEL_SUFFIX}${MODDEFLATE_SUFFIX}${IPV6_SUFFIX}${PKGNAMESUFFIX2}
DISTNAME= apache_${VERSION_APACHE}
DISTFILES= ${DISTNAME}${EXTRACT_SUFX} ${MODSSL_FILE}:mod_ssl \
${MODSNMP_DISTFILE} ${MODACCEL_DISTFILE} ${MODDEFLATE_DISTFILE}
EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX} ${MODSSL_FILE} \
${MODACCEL_FILE} ${MODDEFLATE_FILE}
.if defined(APACHE_WITH_IPV6) || make(makesum) || defined(FETCH_ALL)
PATCH_SITES+= ftp://ftp.42.org/pub/orphan/
PATCHFILES+= apache-1.3.29modssl-v6-20031204.diff.gz
.endif
MAINTAINER= dinoex@FreeBSD.org
COMMENT?= The Apache 1.3 webserver with SSL/TLS functionality
LIB_DEPENDS= mm.13:${PORTSDIR}/devel/mm
PATCH_DEPENDS= ${BUILD_DEPENDS}
CONFLICTS?= apache+ipv6-1.* apache+ssl-1.* apache-1.* apache-2.* \
apache_fp-1.* caudium-devel-1.* caudium10-1.* caudium12-* \
ru-apache+mod_ssl-1.* ru-apache-1.* thttpd-2.* w3c-httpd-3.*
VERSION_APACHE= 1.3.29
VERSION_MODSSL= 2.8.16
VERSION_MODSNMP= 1.3.14.12
VERSION_MODACCEL= 1.0.31
VERSION_MODDEFLATE= 1.0.20
USE_OPENSSL= yes
HAS_CONFIGURE= yes
USE_PERL5_BUILD= yes
MASTER_SITES_MODSSL= http://www.modssl.org/source/ \
ftp://ftp.modssl.org/source/ \
ftp://ftp.blatzheim.com/pub/mod_ssl/ \
ftp://ftp.fu-berlin.de/unix/security/mod_ssl/ \
${MASTER_SITE_RINGSERVER:S,%SUBDIR%,net/www/mod_ssl/source,}
MODSSL_FILE= mod_ssl-${VERSION_MODSSL}-${VERSION_APACHE}${EXTRACT_SUFX}
MODSNMP_FILE= mod_snmp_${VERSION_MODSNMP}${EXTRACT_SUFX}
MODACCEL_FILE= mod_accel-${VERSION_MODACCEL}${EXTRACT_SUFX}
MODDEFLATE_FILE= mod_deflate-${VERSION_MODDEFLATE}${EXTRACT_SUFX}
RC_SCRIPTS_SUB= PREFIX=${PREFIX} RC_SUBR=${RC_SUBR}
.include <bsd.port.pre.mk>
DATADIR= ${PREFIX}/www
DOCSDIR= ${PREFIX}/share/doc/apache
DOCUMENT_ROOT= ${DATADIR}/data
.if !exist(${PREFIX}/etc/rc.d/apache.sh && !defined(WITHOUT_RC_SUBR)
USE_RC_SUBR= yes
PLIST_FILES+= etc/rc.d/apache.sh
.else
PLIST_FILES+= etc/rc.d/apache.sh.sample
.endif
.if defined(WITH_APACHE_SUEXEC) && ${WITH_APACHE_SUEXEC} == yes
APACHE_SUEXEC_CALLER?=www
APACHE_SUEXEC_DOCROOT?=${DOCUMENT_ROOT}
APACHE_SUEXEC_LOG?=/var/log/httpd-suexec.log
APACHE_SUEXEC_USERDIR?=public_html
APACHE_SUEXEC_UIDMIN?=1000
APACHE_SUEXEC_GIDMIN?=1000
APACHE_SUEXEC_SAFE_PATH?=/bin:/usr/bin:${PREFIX}/bin
SUEXEC_CONF= --enable-suexec \
--suexec-caller=${APACHE_SUEXEC_CALLER} \
--suexec-docroot=${APACHE_SUEXEC_DOCROOT} \
--suexec-logfile=${APACHE_SUEXEC_LOG} \
--suexec-userdir=${APACHE_SUEXEC_USERDIR} \
--suexec-uidmin=${APACHE_SUEXEC_UIDMIN} \
--suexec-gidmin=${APACHE_SUEXEC_GIDMIN} \
--suexec-safepath=${APACHE_SUEXEC_SAFE_PATH}
.if defined(APACHE_SUEXEC_UMASK)
SUEXEC_CONF+= --suexec-umask=${APACHE_SUEXEC_UMASK}
.endif
PLIST_FILES+= sbin/suexec
SUEXEC_MAN= suexec.8
.else # !SUEXEC
SUEXEC_CONF=
SUEXEC_MAN=
.endif # !SUEXEC
CONFIGURE_ARGS+=--prefix=${PREFIX} \
--server-uid=www \
--server-gid=www \
--with-perl=${PERL} \
--with-layout=FreeBSD \
--without-confadjust \
--enable-module=most \
--enable-module=auth_db \
--enable-module=mmap_static \
--disable-module=auth_dbm \
--enable-shared=max \
--enable-module=ssl \
--enable-module=define \
${SUEXEC_CONF}
.if defined(APACHE_RELATIVE_RUNTIMEDIR)
CONFIGURE_ARGS+= --runtimedir=${APACHE_RELATIVE_RUNTIMEDIR}
.endif
.if defined(APACHE_HARD_SERVER_LIMIT)
HARD_SERVER_LIMIT=-DHARD_SERVER_LIMIT=${APACHE_HARD_SERVER_LIMIT}
.else
HARD_SERVER_LIMIT=-DHARD_SERVER_LIMIT=512
.endif
OPTIM= ${HARD_SERVER_LIMIT} \
-DDOCUMENT_LOCATION=\\"${PREFIX}/www/data/\\" \
-DDEFAULT_PATH=\\"${PREFIX}/bin:/bin:/usr/bin\\" \
-DACCEPT_FILTER_NAME=\\"httpready\\"
.if defined(APACHE_FD_SETSIZE)
OPTIM+= -DFD_SETSIZE=${APACHE_FD_SETSIZE}
.else
OPTIM+= -DFD_SETSIZE=1024
.endif
.if defined(APACHE_BUFFERED_LOGS) && ${APACHE_BUFFERED_LOGS} == yes
OPTIM+= -DBUFFERED_LOGS
.endif
.if defined(APACHE_PERF_TUNING) && ${APACHE_PERF_TUNING} == yes
CFLAGS+= -O3
.endif
.if defined(APACHE_WITH_MODSNMP) || make(makesum) || defined(FETCH_ALL)
MODSNMP_DISTFILE= ${MODSNMP_FILE}:mod_snmp
.endif
.if defined(APACHE_WITH_MODSNMP)
CONFLICTS+= apache+mod_ssl-1.* \
apache+mod_ssl+ipv6-1.* \
apache+mod_ssl+mod_accel-1.* \
apache+mod_ssl+mod_accel+ipv6-1.* \
apache+mod_ssl+mod_accel+mod_deflate-1.* \
apache+mod_ssl+mod_accel+mod_deflate+ipv6-1.* \
apache+mod_ssl+mod_deflate-1.* \
apache+mod_ssl+mod_deflate+ipv6-1.* \
MODSNMP_SUFFIX= +mod_snmp
PVERSION_MODSNMP= +${VERSION_MODSNMP}
CONFIGURE_ARGS+= --activate-module=src/modules/snmp_agt/libsnmp_agt.a
CFLAGS+= -DSNMP -DUSE_DB -DSNMP_CONFIG_H -DHARD_VIRTUAL_HOST_MAX=1000 \
-DSNMPLOCALONLY
EXTRA_PATCHES+= ${WRKSRC}/src/modules/snmp_agt/mod_snmp.patch
PLIST_FILES+= %%DOCSDIR%%/mod/mod_snmp.html \
%%DOCSDIR%%/snmp_agt/index.html \
%%DOCSDIR%%/snmp_agt/www-mib.txt \
%%DOCSDIR%%/snmp_agt/snmpv2-mib.txt \
%%DOCSDIR%%/snmp_agt/rfc2594.txt \
%%DOCSDIR%%/snmp_agt/apache-scoreboard-mib.txt \
%%DOCSDIR%%/snmp_agt/apache-config-mib.txt
PLIST_DIRS+= %%DOCSDIR%%/snmp_agt %%DOCSDIR%% www/buckets
.else
CONFLICTS+= apache+mod_snmp*-1.*
.endif
.if defined(APACHE_WITH_MODACCEL) || make(makesum) || defined(FETCH_ALL)
MODACCEL_DISTFILE= ${MODACCEL_FILE}:mod_accel
.endif
.if defined(APACHE_WITH_MODACCEL)
CONFLICTS+= apache+mod_ssl-1.* \
apache+mod_ssl+ipv6-1.* \
apache+mod_ssl+mod_snmp-1.* \
apache+mod_ssl+mod_snmp+ipv6-1.* \
apache+mod_ssl+mod_snmp+mod_deflate-1.* \
apache+mod_ssl+mod_snmp+mod_deflate+ipv6-1.* \
apache+mod_ssl+mod_deflate-1.* \
apache+mod_ssl+mod_deflate+ipv6-1.*
MODACCEL_SUFFIX= +mod_accel
PVERSION_MODACCEL= +${VERSION_MODACCEL}
CONFIGURE_ARGS+= --activate-module=src/modules/extra/mod_randban.o \
--enable-shared=randban \
--activate-module=src/modules/extra/mod_freeze.o \
--enable-shared=freeze \
--activate-module=src/modules/accel/libaccel.a \
--enable-shared=accel
EXTRA_PATCHES+= ${FILESDIR}/mod_accel-preservehost.patch
PLIST_FILES+= libexec/apache/libaccel.so \
libexec/apache/mod_freeze.so \
libexec/apache/mod_randban.so \
%%DOCSDIR%%/mod/mod_accel.html
.else
CONFLICTS+= apache+mod_accel*-1.*
.endif
.if defined(APACHE_WITH_MODDEFLATE) || make(makesum) || defined(FETCH_ALL)
MODDEFLATE_DISTFILE= ${MODDEFLATE_FILE}:mod_deflate
.endif
.if defined(APACHE_WITH_MODDEFLATE)
CONFLICTS+= apache+mod_ssl-1.* \
apache+mod_ssl+ipv6-1.* \
apache+mod_ssl+mod_snmp-1.* \
apache+mod_ssl+mod_snmp+ipv6-1.* \
apache+mod_ssl+mod_snmp+mod_accel-1.* \
apache+mod_ssl+mod_snmp+mod_accel+ipv6-1.* \
apache+mod_ssl+mod_accel-1.* \
apache+mod_ssl+mod_accel+ipv6-1.*
MODDEFLATE_SUFFIX= +mod_deflate
PVERSION_MODDEFLATE= +${VERSION_MODDEFLATE}
CONFIGURE_ARGS+= --activate-module=src/modules/extra/mod_deflate.o
PLIST_FILES+= %%DOCSDIR%%/mod/mod_deflate.html
.else
CONFLICTS+= apache+mod_deflate*-1.*
.endif
.if defined(APACHE_WITH_IPV6)
.if defined(APACHE_WITH_MODACCEL)
BROKEN= "mod_accel and ipv6 don't compile together"
.endif
CONFLICTS+= apache+mod_ssl-1.* \
apache+mod_ssl+mod_snmp-1.* \
apache+mod_ssl+mod_snmp+mod_accel-1.* \
apache+mod_ssl+mod_snmp+mod_accel+mod_deflate-1.* \
apache+mod_ssl+mod_accel-1.* \
apache+mod_ssl+mod_accel+mod_deflate-1.* \
apache+mod_ssl+mod_deflate-1.*
IPV6_SUFFIX= +ipv6
CONFIGURE_ARGS+= --enable-rule=INET6
PLIST_SUB+= WITHIPV6=""
PLIST_FILES+= include/apache/sa_len.h \
include/apache/sockaddr_storage.h
.else
EXTRA_PATCHES+= ${FILESDIR}/mod_access.c.patch
.endif
CONFIGURE_ENV= CFLAGS='${CFLAGS}' \
OPTIM='${OPTIM}' \
SSL_BASE='${OPENSSLBASE}' \
EAPI_MM='SYSTEM' \
PATH="${PREFIX}/bin:${PATH}"
INSTALL_TARGET= install-quiet
MAN1= dbmmanage.1 htdigest.1 htpasswd.1
MAN8= ab.8 apachectl.8 apxs.8 httpd.8 logresolve.8 rotatelogs.8 \
${SUEXEC_MAN}
TYPE= test
CRT=
KEY=
pre-fetch:
@${ECHO_MSG} ""
@${ECHO_MSG} "You may use the following build options:"
@${ECHO_MSG} ""
@${ECHO_MSG} " WITH_APACHE_SUEXEC=yes enable the suEXEC feature"
@${ECHO_MSG} " [default is no]"
@${ECHO_MSG} " APACHE_SUEXEC_CALLER=user set the suEXEC username of the allowed caller"
@${ECHO_MSG} " [default is www]"
@${ECHO_MSG} " APACHE_SUEXEC_DOCROOT=dir set the suEXEC root directory"
@${ECHO_MSG} " [default is ${DOCUMENT_ROOT}]"
@${ECHO_MSG} " APACHE_SUEXEC_LOG=file set the suEXEC logfile"
@${ECHO_MSG} " [default is /var/log/httpd-suexec.log]"
@${ECHO_MSG} " APACHE_SUEXEC_USERDIR=dir set the suEXEC user subdirectory"
@${ECHO_MSG} " [default is public_html]"
@${ECHO_MSG} " APACHE_SUEXEC_UIDMIN=uid set the suEXEC minimal allowed UID"
@${ECHO_MSG} " [default is 1000]"
@${ECHO_MSG} " APACHE_SUEXEC_GIDMIN=gid set the suEXEC minimal allowed GID"
@${ECHO_MSG} " [default is 1000]"
@${ECHO_MSG} " APACHE_SUEXEC_SAFE_PATH=path set the suEXEC safe PATH"
@${ECHO_MSG} " [default is /bin:/usr/bin:${PREFIX}/bin]"
@${ECHO_MSG} " APACHE_SUEXEC_UMASK=umask set the umask for the suEXEC'd script"
@${ECHO_MSG} " [default is inherited from the Apache process]"
@${ECHO_MSG} ""
@${ECHO_MSG} " APACHE_HARD_SERVER_LIMIT=nr Maximum number of Apache processes."
@${ECHO_MSG} " [default is 512]"
@${ECHO_MSG} " APACHE_FD_SETSIZE=nr Maximum number of descriptors."
@${ECHO_MSG} " [default is 1024]"
@${ECHO_MSG} ""
@${ECHO_MSG} " APACHE_BUFFERED_LOGS=yes Log entries are buffered before writing."
@${ECHO_MSG} " Writes may not be atomic, entries from multiple"
@${ECHO_MSG} " children could become mixed together and your"
@${ECHO_MSG} " web stats may be inaccurate."
@${ECHO_MSG} " [default is no]"
@${ECHO_MSG} " APACHE_PERF_TUNING=yes CFLAGS optimization."
@${ECHO_MSG} " This setting may produce broken code and thus"
@${ECHO_MSG} " is not recommended for production servers."
@${ECHO_MSG} " [default is no]"
@${ECHO_MSG} ""
@${ECHO_MSG} " APACHE_WITH_IPV6=yes IPv6 support."
@${ECHO_MSG} " This setting turns IPv6 support on."
@${ECHO_MSG} " [default is no]"
@${ECHO_MSG} ""
@${ECHO_MSG} " APACHE_WITH_MODSNMP=yes mod_snmp support."
@${ECHO_MSG} " This setting turns support for SNMP on."
@${ECHO_MSG} " [default is no]"
@${ECHO_MSG} ""
@${ECHO_MSG} " APACHE_WITH_MODACCEL=yes mod_accel support."
@${ECHO_MSG} " This setting activates build of mod_accel."
@${ECHO_MSG} " [default is no]"
@${ECHO_MSG} ""
@${ECHO_MSG} " APACHE_WITH_MODDEFLATE=yes mod_deflate support."
@${ECHO_MSG} " This setting activates build of mod_deflate."
@${ECHO_MSG} " [default is no]"
@${ECHO_MSG} ""
post-extract:
post-extract:
@${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
${FILESDIR}/rcng.sh > ${WRKSRC}/rcng.sh
@${SED} -e "s=%%PREFIX%%=${PREFIX}=g" ${FILESDIR}/apache.sh \
> ${WRKSRC}/apache.sh
.if defined(APACHE_WITH_MODSNMP)
(cd ${WRKSRC}; ${TAR} xfz ${DISTDIR}/${MODSNMP_FILE})
.endif
pre-patch:
@cd ${WRKDIR}/mod_ssl-${VERSION_MODSSL}-${VERSION_APACHE} \
&& ${ECHO_MSG} "===> Applying mod_ssl-${VERSION_MODSSL} extension" \
&& ./configure --with-apache=../${DISTNAME} --expert
.if defined(APACHE_WITH_MODACCEL)
@cd ${WRKDIR}/mod_accel-${VERSION_MODACCEL} \
&& ${ECHO_MSG} "===> Applying mod_accel-${VERSION_MODACCEL} extension" \
&& ./configure --with-apache=../${DISTNAME} --with-mod_randban --with-mod_freeze \
&& ${MAKE}
.endif
.if defined(APACHE_WITH_MODDEFLATE)
@cd ${WRKDIR}/mod_deflate-${VERSION_MODDEFLATE} \
&& ${ECHO_MSG} "===> Applying mod_deflate-${VERSION_MODDEFLATE} extension" \
&& ./configure --with-apache=../${DISTNAME} \
&& ${MAKE}
.endif
post-patch:
@${PERL} -pi -e 's|-print|-print0|;s|xargs|xargs -0|' \
${WRKSRC}/Makefile.tmpl
@${PERL} -pi -e "s|SSL_LDFLAGS=''|SSL_LDFLAGS='${OPENSSL_LDFLAGS}'|" \
${WRKSRC}/src/modules/ssl/libssl.module
@cd ${WRKSRC} \
&& ${FIND} . -type f -name "*.orig" -print | ${XARGS} ${RM} -f
post-build:
@cd ${WRKSRC} \
&& ${ECHO_MSG} "===> Creating Dummy Certificate for Server (SnakeOil)" \
&& ${ECHO_MSG} " [use 'make certificate' to create a real one]" \
&& ${MAKE} certificate TYPE=dummy >/dev/null 2>&1
certificate:
@cd ${WRKSRC} \
&& ${ECHO_MSG} "===> Creating Test Certificate for Server" \
&& ${MAKE} certificate TYPE=${TYPE} CRT=${CRT} KEY=${KEY}
pre-install:
@${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
post-install:
.if defined(USE_RC_SUBR)
${INSTALL_SCRIPT} ${WRKSRC}/rcng.sh ${PREFIX}/etc/rc.d/apache.sh
.else
${INSTALL_SCRIPT} ${WRKSRC}/apache.sh ${PREFIX}/etc/rc.d/apache.sh.sample
.endif
.if defined(APACHE_WITH_MODSNMP)
@${MKDIR} ${DATADIR}/buckets
@${CHOWN} www:www ${DATADIR}/buckets
.endif
.include <bsd.port.post.mk>