Permalink
Fetching contributors…
Cannot retrieve contributors at this time
251 lines (210 sloc) 8.99 KB
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0
PortGroup apache2 1.0
name apache2
version 2.4.35
checksums rmd160 f3cb1f3f6133ca3998e10f331c2eec310baf2229 \
sha256 2607c6fdd4d12ac3f583127629291e9432b247b782396a563bec5678aae69b56 \
size 7044336
categories www
maintainers {ryandesign @ryandesign} {mps @Schamschula} {pixilla @pixilla} openmaintainer
license Apache-2
description The extremely popular second version of the Apache http server
long_description Apache is an HTTP server designed as a plug-in replacement for the NCSA \
server version 1.3 (or 1.4). It fixes numerous bugs in the NCSA server \
and includes many frequently requested new features, and has an API \
which allows it to be extended to meet users' needs more easily.
homepage http://httpd.apache.org/
platforms darwin freebsd openbsd
master_sites apache:httpd
distname httpd-${version}
use_bzip2 yes
use_parallel_build yes
depends_lib port:apr \
port:apr-util \
port:expat \
path:lib/libssl.dylib:openssl \
port:pcre \
port:perl5 \
port:zlib
patch.pre_args -p1
patchfiles patch-build-rules.mk.in.diff \
patch-config.layout.diff \
patch-support-apxs.in.diff
post-patch {
reinplace "s,@MANDIR@,\${prefix}/share/${name},g" \
${worksrcpath}/config.layout
reinplace "s,@APACHE_NAME@,${name},g" \
${worksrcpath}/config.layout
reinplace -E "s/(User|Group) daemon/\\1 _www/" \
${worksrcpath}/docs/conf/httpd.conf.in
}
platform darwin {
patchfiles-append patch-support-apachectl.in.diff
post-patch {
# Customize userdir naming to match darwin
reinplace "s|/home/|/Users/|g" ${worksrcpath}/docs/conf/extra/httpd-userdir.conf.in
reinplace "s|public_html|Sites|g" ${worksrcpath}/docs/conf/extra/httpd-userdir.conf.in
}
# HFS can be case insensitive, so protect for this as in
# http://docs.info.apple.com/article.html?artnum=300422
patchfiles-append patch-docs-conf-httpd.conf.in.diff
}
platform darwin 9 {
post-extract {
reinplace "s|-export-symbols-regex ssl_module||g" ${worksrcpath}/configure
}
}
configure.pre_args --prefix=${prefix}
configure.args --with-apr=${prefix}/bin/apr-1-config \
--with-apr-util=${prefix}/bin/apu-1-config \
--enable-layout=MacPorts \
--with-expat=${prefix} \
--with-pcre=${prefix} \
--with-z=${prefix} \
--enable-mods-shared=all \
--enable-authn-alias=shared \
--enable-ssl \
--with-ssl=${prefix} \
--enable-cache \
--enable-disk_cache \
--enable-file_cache \
--enable-mem_cache \
--enable-deflate \
--enable-proxy \
--enable-proxy-connect \
--enable-proxy-http \
--enable-proxy-ftp
post-configure {
# Setting DYLD_FALLBACK_LIBRARY_PATH instead of DYLD_LIBRARY_PATH
# avoids issues with library collisions (bug #3013)
reinplace "s|DYLD_LIBRARY_PATH|DYLD_FALLBACK_LIBRARY_PATH|g" \
${worksrcpath}/support/envvars-std
}
post-build {
reinplace -E {s| -arch [a-z0-9_]+||g} \
${worksrcpath}/config.nice \
${worksrcpath}/build/config_vars.mk
if {[tbool configure.ccache]} {
reinplace -E {s|ccache ||g} \
${worksrcpath}/config.nice \
${worksrcpath}/build/config_vars.mk
}
}
post-destroot {
move ${destroot}${apache2.sysconfdir}/httpd.conf \
${destroot}${apache2.sysconfdir}/httpd.conf.orig
foreach f [glob -tails -directory ${destroot}${apache2.sysconfdir}/extra/ *] {
move ${destroot}${apache2.sysconfdir}/extra/${f} \
${destroot}${apache2.sysconfdir}/extra/${f}.orig
}
delete ${destroot}${apache2.sysconfdir}/original
xinstall -m 755 -d ${destroot}${apache2.datadir}
xinstall -m 755 -d ${destroot}${apache2.runtimedir}
xinstall -m 755 -d ${destroot}${apache2.logfiledir}
destroot.keepdirs ${destroot}${apache2.datadir} \
${destroot}${apache2.runtimedir} \
${destroot}${apache2.logfiledir}
xinstall -d ${destroot}${apache2.docdir}
xinstall -m 0644 -W ${worksrcpath} ABOUT_APACHE CHANGES LICENSE NOTICE README \
README.platforms ROADMAP VERSIONING ${destroot}${apache2.docdir}
# foreach {module args} [array get apache_default_modules] {
# apxsInstall ${module} "yes" {}
# }
}
pre-activate {
# apache24-devel 2.4.7_0 and earlier installed these items directly to ${prefix} (bypassing ${destroot}); remove them if found
foreach d "${apache2.datadir} ${apache2.runtimedir} ${apache2.logfiledir}" {
set f ${d}/.turd_${name}
if {[file exists ${f}] && [registry_file_registered ${f}] == "0"} {
if {[catch {delete ${f}}]} {
ui_warn "Cannot delete ${f}; please remove it manually"
}
}
}
}
post-activate {
if {![file exists ${apache2.sysconfdir}/httpd.conf]} {
file copy ${apache2.sysconfdir}/httpd.conf.orig ${apache2.sysconfdir}/httpd.conf
reinplace "s|#LoadModule slotmem_shm_module|LoadModule slotmem_shm_module|g" \
${apache2.sysconfdir}/httpd.conf
}
#
# if {![file exists ${apache2.sbindir}/envvars]} {
# xinstall -m 755 ${apache2.sbindir}/envvars-std ${apache2.sbindir}/envvars
# }
#
# fileInstall "install" "${prefix}" "0644"
#
# set listenFile [open "${apache2.sysconfdir}/ports.conf" w 0644]
# foreach listen_port ${apache2.listen_ports} {
# puts ${listenFile} "Listen ${listen_port}"
# }
# close ${listenFile}
#
# foreach action {enmod dismod} {
# foreach module ${apache2.default_ ${action}} {
# exec "${apache2.sbindir}/a2${action}" ${module}
# }
# }
}
platform openbsd {
build.env-append "LD_LIBRARY_PATH=${prefix}/lib"
}
variant openldap description {Enable LDAP support through OpenLDAP} {
configure.args-append --enable-ldap --enable-authnz-ldap
depends_lib-append port:openldap
pre-configure {
if {-1 == [string first -lldap [exec ${prefix}/bin/apu-1-config --libs]]} {
ui_error "To install ${name} with the +openldap variant, apr-util must be installed"
ui_error "with the +openldap variant. Rebuild apr-util using:"
ui_error
ui_error " sudo port upgrade --enforce-variants apr-util +openldap"
ui_error
return -code error "incompatible apr-util installation"
}
}
}
variant preforkmpm conflicts workermpm eventmpm description {Use prefork MPM} {
configure.args-append --with-mpm=prefork
}
variant workermpm conflicts preforkmpm eventmpm description {Use worker MPM} {
configure.args-append --with-mpm=worker
}
variant eventmpm conflicts preforkmpm workermpm description {Use event MPM (experimental)} {
configure.args-append --with-mpm=event
}
if {![variant_isset workermpm] && ![variant_isset eventmpm]} {
default_variants +preforkmpm
}
startupitem.create yes
startupitem.start \
"\[ -x ${prefix}/sbin/apachectl \] && ${prefix}/sbin/apachectl start > /dev/null"
startupitem.stop \
"\[ -r ${prefix}/var/run/${name}/httpd.pid \] && ${prefix}/sbin/apachectl stop > /dev/null"
startupitem.restart \
"${prefix}/sbin/apachectl graceful > /dev/null"
notes "
Apache2 has been migrated from the 2.2.x to the 2.4.x branch.
The install paths have been changed to no longer violate the MacPorts mtree:
1. The binaries are now under ${prefix}/sbin/
(rather than under ${prefix}/apache2/bin/)
2. The configure files are now under ${prefix}/etc/apache2/
(rather than under ${prefix}/apache2/conf/)
3. The modules are now under ${prefix}/lib/apache2/modules/
(rather than under ${prefix}/apache2/modules/)
4. The web root is now located under ${prefix}/www/apache2/html/
(rather than under ${prefix}/apache2/htdocs/)
5. The cgi-bin is now located under ${prefix}/www/apache2/cgi-bin/
(rather than under ${prefix}/apache2/cgi-bin/)
6. The logs are now located under ${prefix}/var/log/apache2/
(rather than under ${prefix}/apache2/logs/)
7. The manual is now located under ${prefix}/www/apache2/manual/
(rather than under ${prefix}/apache2/manual/)
8. The manual (man) pages are still at ${prefix}/share/apache2/man/
You can move your htdocs and cgi-bin to the new locations, or edit\
${prefix}/etc/apache2/httpd.conf to point at the old locations.
"
livecheck.type regex
livecheck.url ${homepage}download.cgi
livecheck.regex httpd-(\[0-9.\]+)${extract.suffix}