a project to simplify installation of open source software
on Mac OS X and Darwin
# $Id: Portfile 22493 2007-03-02 21:58:17Z blair@macports.org $
PortSystem 1.0
name apache20
version 2.0.59
categories www
maintainers blair@orcaware.com
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. This Portfile is not the latest version \
of the Apache web server, see the apache2 port.
homepage http://httpd.apache.org/
platforms darwin freebsd openbsd
master_sites apache:httpd
distname httpd-${version}
checksums md5 b0200a497d1c89daad680c676d32a6df
use_bzip2 yes
depends_lib port:apr0 \
port:apr-util0 \
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/httpd-std.conf.in
reinplace "s|public_html|Sites|g" ${worksrcpath}/docs/conf/httpd-std.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-config \
--with-apr-util=${prefix}/bin/apu-config \
--libdir=${prefix}/lib \
--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}/apache20/conf
file rename -force ${confDir}/httpd.conf ${confDir}/httpd.conf.sample
destroot.keepdirs ${destroot}${prefix}/apache20/logs
# fix libtool path
reinplace "s|/apache20/build/libtool|/share/apr-0/build/libtool|g" \
${destroot}${prefix}/apache20/build/config_vars.mk
set mandir ${destroot}${prefix}/share/man/man1
file rename -force ${mandir}/dbmmanage.1 ${mandir}/dbmmanage20.1
file rename -force ${mandir}/htdbm.1 ${mandir}/htdbm20.1
file rename -force ${mandir}/htdigest.1 ${mandir}/htdigest20.1
file rename -force ${mandir}/htpasswd.1 ${mandir}/htpasswd20.1
set mandir ${destroot}${prefix}/share/man/man8
file rename -force ${mandir}/ab.8 ${mandir}/ab20.8
file rename -force ${mandir}/apachectl.8 ${mandir}/apachectl20.8
file rename -force ${mandir}/apxs.8 ${mandir}/apxs20.8
file rename -force ${mandir}/httpd.8 ${mandir}/httpd20.8
file rename -force ${mandir}/logresolve.8 ${mandir}/logresolve20.8
file rename -force ${mandir}/rotatelogs.8 ${mandir}/rotatelog20.8
file rename -force ${mandir}/suexec.8 ${mandir}/suexec20.8
}
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
}
variant no_startupitem {
startupitem.create no
}
startupitem.create yes
startupitem.start \
"\[ -x ${prefix}/apache20/bin/apachectl \] && ${prefix}/apache20/bin/apachectl start > /dev/null"
startupitem.stop \
"\[ -r ${prefix}/apache20/logs/httpd.pid \] && ${prefix}/apache20/bin/apachectl stop > /dev/null"
startupitem.restart \
"\[ -r ${prefix}/apache20/logs/httpd.pid \] && ${prefix}/apache20/bin/apachectl restart > /dev/null"