source: trunk/dports/www/apache20/Portfile @ 71578

Last change on this file since 71578 was 71578, checked in by ryandesign@…, 9 years ago

Remove darwin 7 bits; MacPorts base doesn't compile on < darwin 8 anymore

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.8 KB
Line 
1# $Id: Portfile 71578 2010-09-17 00:01:14Z ryandesign@macports.org $
2
3# Besides having a Port for the Apache 2.0.x line, this Port was built
4# to allow Apache 2.x.y on Mac OS X 10.3 to serve PHP Zend encoded
5# files using the Zend Optimizer.  The Zend Optimizer is distributed
6# only in binary form as an Apache module that enables the server to
7# serve optimized and obfuscated PHP code from third party vendors.
8# Since the Optimizer is a binary module, it must run in a binary
9# compatible OS and Apache environment.
10#
11# While newer versions of the Zend Optimizer do work with Apache
12# 2.2.x, it appears that these binary modules are compiled on 10.4 and
13# trying to load the module into Apache on 10.3 results in missing
14# symbol errors.  When older versions of the Zend Optimizer that work
15# on 10.3 are loaded into Apache 2.2.x, then the error_log will have
16# messages about double free memory errors.  So the only combination
17# that works on 10.3 is with Apache 2.0.x.
18
19PortSystem 1.0
20
21name             apache20
22version          2.0.63
23revision        1
24
25categories       www
26maintainers      blair
27description      The extremely popular second version of the Apache http \
28                        server
29long_description Apache is an HTTP server designed as a plug-in replacement \
30                        for the NCSA server version 1.3 (or 1.4).  It fixes \
31                        numerous bugs in the NCSA server and includes many \
32                        frequently requested new features, and has an API \
33                        which allows it to be extended to meet users' needs \
34                        more easily.  This Portfile is not the latest version \
35                        of the Apache web server, see the apache2 port.  \
36                        Besides having a Port for the Apache 2.0.x line, this \
37                        Port was built to allow Apache 2.x.y on Mac OS X 10.3 \
38                        to serve PHP Zend encoded files using the Zend \
39                        Optimizer.  The Zend Optimizer is distributed only in \
40                        binary form as an Apache module that enables the \
41                        server to serve optimized and obfuscated PHP code \
42                        from third party vendors.   Since the Optimizer is a \
43                        binary module, it must run in a binary compatible OS \
44                        and Apache environment.   While newer versions of the \
45                        Zend Optimizer do work with Apache 2.2.x, it appears \
46                        that these binary modules are compiled on 10.4 and \
47                        trying to load the module into Apache on 10.3 results \
48                        in missing symbol errors.  When older versions of the \
49                        Zend Optimizer that work on 10.3 are loaded into \
50                        Apache 2.2.x, then the error_log will contain \
51                        messages about double free memory errors.  So the \
52                        only combination that works on 10.3 is with Apache \
53                        2.0.x.
54
55homepage         http://httpd.apache.org/
56platforms        darwin freebsd openbsd
57
58master_sites     apache:httpd
59distname         httpd-${version}
60checksums        md5 c7924ebe95f9f66c9f80c0f9d4012152 \
61                 sha1 20e2b64944e38e96491af788a37cb709d2c5b755 \
62                 rmd160 f6a7de59860f627ac40b245fcf742fb07e1b4870
63use_bzip2        yes
64
65depends_lib      port:apr0 \
66                 port:apr-util0 \
67                 port:expat \
68                 port:openssl \
69                 port:pcre
70
71patchfiles       patch-httpd-std.conf.in
72
73platform darwin {
74        post-patch {
75                # Customize userdir naming to match darwin
76                reinplace "s|/home/|/Users/|g" ${worksrcpath}/docs/conf/httpd-std.conf.in
77                reinplace "s|public_html|Sites|g" ${worksrcpath}/docs/conf/httpd-std.conf.in
78        }
79}
80
81configure.pre_args --prefix=${prefix}/${name}
82configure.args     --with-apr=${prefix}/bin/apr-config \
83                   --with-apr-util=${prefix}/bin/apu-config \
84                   --libdir=${prefix}/lib \
85                   --with-pcre=${prefix} \
86                   --mandir=${prefix}/share/man \
87                   --enable-mods-shared=all \
88                   --enable-ssl \
89                   --with-ssl=${prefix} \
90                   --enable-cache \
91                   --enable-disk_cache \
92                   --enable-file_cache \
93                   --enable-mem_cache \
94                   --enable-deflate \
95                   --enable-proxy \
96                   --enable-proxy-connect \
97                   --enable-proxy-http \
98                   --enable-proxy-ftp
99                   
100post-configure {
101        # Setting DYLD_FALLBACK_LIBRARY_PATH instead of DYLD_LIBRARY_PATH
102        # avoids issues with library collisions (bug #3013)
103        reinplace "s|DYLD_LIBRARY_PATH|DYLD_FALLBACK_LIBRARY_PATH|g" \
104                ${worksrcpath}/support/envvars-std
105}
106
107destroot.violate_mtree yes
108
109post-destroot {
110        set confDir ${destroot}${prefix}/apache20/conf
111        file rename -force ${confDir}/httpd.conf ${confDir}/httpd.conf.sample
112
113        destroot.keepdirs ${destroot}${prefix}/apache20/logs
114
115        # fix libtool path
116        reinplace "s|/apache20/build/libtool|/share/apr-0/build/libtool|g" \
117                ${destroot}${prefix}/apache20/build/config_vars.mk
118
119        set mandir ${destroot}${prefix}/share/man/man1
120        file rename -force ${mandir}/dbmmanage.1 ${mandir}/dbmmanage20.1
121        file rename -force ${mandir}/htdbm.1 ${mandir}/htdbm20.1
122        file rename -force ${mandir}/htdigest.1 ${mandir}/htdigest20.1
123        file rename -force ${mandir}/htpasswd.1 ${mandir}/htpasswd20.1
124
125        set mandir ${destroot}${prefix}/share/man/man8
126        file rename -force ${mandir}/ab.8 ${mandir}/ab20.8
127        file rename -force ${mandir}/apachectl.8 ${mandir}/apachectl20.8
128        file rename -force ${mandir}/apxs.8 ${mandir}/apxs20.8
129        file rename -force ${mandir}/httpd.8 ${mandir}/httpd20.8
130        file rename -force ${mandir}/logresolve.8 ${mandir}/logresolve20.8
131        file rename -force ${mandir}/rotatelogs.8 ${mandir}/rotatelog20.8
132        file rename -force ${mandir}/suexec.8 ${mandir}/suexec20.8
133}
134
135platform openbsd {
136        build.env-append "LD_LIBRARY_PATH=${prefix}/lib"
137}
138
139variant openldap description {Enable LDAP support through OpenLDAP} {
140        configure.args-append --enable-ldap --enable-authnz-ldap
141        depends_lib-append port:openldap
142        pre-configure {
143                if {-1 == [string first -lldap [exec ${prefix}/bin/apu-config --libs]]} {
144                        ui_error "To install ${name} with the +openldap variant, apr-util0 must be installed"
145                        ui_error "with the +openldap variant. Rebuild apr-util0 using:"
146                        ui_error
147                        ui_error "    sudo port upgrade --enforce-variants apr-util0 +openldap"
148                        ui_error
149                        return -code error "incompatible apr-util0 installation"
150                }
151        }
152}
153
154variant preforkmpm conflicts workermpm description {Use prefork MPM} {
155        configure.args-append --with-mpm=prefork
156}
157
158variant workermpm conflicts preforkmpm description {Use worker MPM} {
159        configure.args-append --with-mpm=worker
160}
161
162if {![variant_isset workermpm] && ![variant_isset eventmpm]} {
163        default_variants +preforkmpm
164}
165
166variant no_startupitem description {Do not create a startup item} {
167        startupitem.create      no
168}
169
170startupitem.create      yes
171startupitem.start       \
172"\[ -x ${prefix}/apache20/bin/apachectl \] && ${prefix}/apache20/bin/apachectl start > /dev/null"
173startupitem.stop        \
174"\[ -r ${prefix}/apache20/logs/httpd.pid \] && ${prefix}/apache20/bin/apachectl stop > /dev/null"
175startupitem.restart     \
176"\[ -r ${prefix}/apache20/logs/httpd.pid \] && ${prefix}/apache20/bin/apachectl restart > /dev/null"
177
178livecheck.type  regex
179livecheck.url   ${homepage}
180livecheck.regex {Apache (2\.0(?:\.\d+)*) Released}
Note: See TracBrowser for help on using the repository browser.