a project to simplify installation of open source software
on Mac OS X and Darwin
# $Id: Portfile 22490 2007-03-02 21:51:15Z blair@macports.org $
PortSystem 1.0
name apache2
version 2.2.4
categories www
maintainers imajes@macports.org
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}
checksums md5 536c86c7041515a25dd8bad3611da9a3
use_bzip2 yes
depends_lib port:apr \
port:apr-util \
port:expat \
port:openssl \
port:pcre
patchfiles patch-httpd-std.conf.in
platform darwin {
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
}
}
platform darwin 7 {
pre-configure {
system "cd ${worksrcpath} && glibtoolize --force"
}
}
configure.pre_args --prefix=${prefix}/${name}
configure.args --with-apr=${prefix}/bin/apr-1-config \
--with-apr-util=${prefix}/bin/apu-1-config \
--libdir=${prefix}/lib \
--with-expat=${prefix} \
--with-pcre=${prefix} \
--mandir=${prefix}/share/man \
--enable-mods-shared=all \
--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-destroot {
set confDir ${destroot}${prefix}/apache2/conf
file rename -force ${confDir}/httpd.conf ${confDir}/httpd.conf.sample
destroot.keepdirs ${destroot}${prefix}/apache2/logs
# fix libtool path
reinplace "s|/apache2/build/libtool|/share/apr-0/build/libtool|g" \
${destroot}${prefix}/apache2/build/config_vars.mk
}
variant openbsd {
build.env-append "LD_LIBRARY_PATH=${prefix}/lib"
}
variant openldap {
configure.args-append --enable-ldap --enable-authnz-ldap
depends_lib-append port:openldap
}
# This ends up being the default mpm if no other is chosen
variant preforkmpm {
configure.args-append --with-mpm=prefork
}
# This mpm is probably preferred (maybe we should make it a default variant?)
variant workermpm {
configure.args-append --with-mpm=worker
}
# This mpm is experimental
variant eventmpm {
configure.args-append --with-mpm=event
}
variant no_startupitem {
startupitem.create no
}
startupitem.create yes
startupitem.start \
"\[ -x ${prefix}/apache2/bin/apachectl \] && ${prefix}/apache2/bin/apachectl start > /dev/null"
startupitem.stop \
"\[ -r ${prefix}/apache2/logs/httpd.pid \] && ${prefix}/apache2/bin/apachectl stop > /dev/null"
startupitem.restart \
"\[ -r ${prefix}/apache2/logs/httpd.pid \] && ${prefix}/apache2/bin/apachectl restart > /dev/null"