source: trunk/dports/www/apache24-devel/Portfile

Last change on this file was 149886, checked in by ryandesign@…, 17 months ago

apache24-devel: update to 2.4.23

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.3 KB
Line 
1# -*- 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
2# $Id: Portfile 149886 2016-07-05 20:01:48Z ryandesign@macports.org $
3
4PortSystem          1.0
5# Untested
6PortGroup           apache2 1.0
7
8name                apache24-devel
9apache2.name        apache2
10version             2.4.23
11categories          www
12maintainers         ryandesign mathiesen.info:macintosh pixilla openmaintainer
13license             Apache-2
14description         The extremely popular second version of the Apache http server
15long_description    Apache is an HTTP server designed as a plug-in replacement for the NCSA \
16                    server version 1.3 (or 1.4). It fixes numerous bugs in the NCSA server \
17                    and includes many frequently requested new features, and has an API \
18                    which allows it to be extended to meet users' needs more easily.
19homepage            http://httpd.apache.org/
20platforms           darwin freebsd openbsd
21
22master_sites        apache:httpd
23distname            httpd-${version}
24use_bzip2           yes
25use_parallel_build  yes
26
27checksums           rmd160  01a485281ededaaf932c9478ad078879a63254bc \
28                    sha256  0c1694b2aad7765896faf92843452ee2555b9591ae10d4f19b245f2adfe85e58
29
30depends_lib         port:apr \
31                    port:apr-util \
32                    port:expat \
33                    path:lib/libssl.dylib:openssl \
34                    port:pcre \
35                    port:perl5 \
36                    port:zlib
37
38patch.pre_args      -p1
39patchfiles          patch-build-rules.mk.in.diff \
40                    patch-config.layout.diff \
41                    patch-support-apxs.in.diff
42
43post-patch {
44    reinplace "s,@MANDIR@,\${prefix}/share/${apache2.name},g" \
45        ${worksrcpath}/config.layout
46    reinplace "s,@APACHE_NAME@,${apache2.name},g" \
47        ${worksrcpath}/config.layout
48}
49
50platform darwin {
51    patchfiles-append   patch-support-apachectl.in.diff
52}
53
54platform darwin 9 {
55    post-extract {
56        reinplace "s|-export-symbols-regex ssl_module||g" ${worksrcpath}/configure
57    }
58}
59
60configure.pre_args --prefix=${prefix}
61configure.args     --with-apr=${prefix}/bin/apr-1-config \
62                   --with-apr-util=${prefix}/bin/apu-1-config \
63                   --enable-layout=MacPorts \
64                   --with-expat=${prefix} \
65                   --with-pcre=${prefix} \
66                   --with-z=${prefix} \
67                   --enable-mods-shared=all \
68                   --enable-authn-alias=shared \
69                   --enable-ssl \
70                   --with-ssl=${prefix} \
71                   --enable-cache \
72                   --enable-disk_cache \
73                   --enable-file_cache \
74                   --enable-mem_cache \
75                   --enable-deflate \
76                   --enable-proxy \
77                   --enable-proxy-connect \
78                   --enable-proxy-http \
79                   --enable-proxy-ftp
80
81post-configure {
82    # Setting DYLD_FALLBACK_LIBRARY_PATH instead of DYLD_LIBRARY_PATH
83    # avoids issues with library collisions (bug #3013)
84    reinplace "s|DYLD_LIBRARY_PATH|DYLD_FALLBACK_LIBRARY_PATH|g" \
85        ${worksrcpath}/support/envvars-std
86}
87
88post-build {
89    reinplace -E {s| -arch [a-z0-9_]+||g} \
90        ${worksrcpath}/config.nice \
91        ${worksrcpath}/build/config_vars.mk
92    if {[tbool configure.ccache]} {
93        reinplace -E {s|ccache ||g} \
94            ${worksrcpath}/config.nice \
95            ${worksrcpath}/build/config_vars.mk
96    }
97}
98
99post-destroot {
100
101    move ${destroot}${apache2.sysconfdir}/httpd.conf \
102        ${destroot}${apache2.sysconfdir}/httpd.conf.orig
103
104    xinstall -m 755 -${destroot}${apache2.datadir}
105    xinstall -m 755 -${destroot}${apache2.runtimedir}
106    xinstall -m 755 -${destroot}${apache2.logfiledir}
107    destroot.keepdirs   ${destroot}${apache2.datadir} \
108                        ${destroot}${apache2.runtimedir} \
109                        ${destroot}${apache2.logfiledir}
110
111    # fix libtool path
112    reinplace "s|/build/libtool|/share/apr-1/build/libtool|g" \
113        ${destroot}${apache2.installbuilddir}/config_vars.mk
114
115    xinstall -d ${destroot}${apache2.docdir}
116    xinstall -m 0644 -W ${worksrcpath} ABOUT_APACHE CHANGES LICENSE NOTICE README \
117        README.platforms ROADMAP VERSIONING ${destroot}${apache2.docdir}
118
119#     foreach {module args} [array get apache_default_modules] {
120#         apxsInstall ${module} "yes" {}
121#     }
122}
123
124pre-activate {
125    # apache24-devel 2.4.7_0 and earlier installed these items directly to ${prefix} (bypassing ${destroot}); remove them if found
126    foreach d "${apache2.datadir} ${apache2.runtimedir} ${apache2.logfiledir}" {
127        set f ${d}/.turd_${name}
128        if {[file exists ${f}] && [registry_file_registered ${f}] == "0"} {
129            if {[catch {delete ${f}}]} {
130                ui_warn "Cannot delete ${f}; please remove it manually"
131            }
132        }
133    }
134}
135
136post-activate {
137    set confDir ${prefix}/etc/${apache2.name}
138    if {![file exists ${confDir}/httpd.conf]} {
139        file copy ${confDir}/httpd.conf.orig ${confDir}/httpd.conf
140        reinplace "s|#LoadModule slotmem_shm_module|LoadModule slotmem_shm_module|g" \
141        ${confDir}/httpd.conf
142    }
143
144#
145#   if {![file exists ${apache2.sbindir}/envvars]} {
146#       xinstall -m 755 ${apache2.sbindir}/envvars-std ${apache2.sbindir}/envvars
147#   }
148#
149#   fileInstall "install" "${prefix}" "0644"
150#
151#   set listenFile [open "${apache2.sysconfdir}/ports.conf" w 0644]
152#   foreach listen_port ${apache2.listen_ports} {
153#       puts ${listenFile} "Listen ${listen_port}"
154#   }
155#   close ${listenFile}
156#
157#   foreach action {enmod dismod} {
158#       foreach module ${apache2.default_ ${action}} {
159#           exec "${apache2.sbindir}/a2${action}" ${module}
160#       }
161#   }
162}
163
164platform openbsd {
165    build.env-append "LD_LIBRARY_PATH=${prefix}/lib"
166}
167
168variant openldap description {Enable LDAP support through OpenLDAP} {
169    configure.args-append --enable-ldap --enable-authnz-ldap
170    depends_lib-append port:openldap
171    pre-configure {
172        if {-1 == [string first -lldap [exec ${prefix}/bin/apu-1-config --libs]]} {
173            ui_error "To install ${name} with the +openldap variant, apr-util must be installed"
174            ui_error "with the +openldap variant. Rebuild apr-util using:"
175            ui_error
176            ui_error "    sudo port upgrade --enforce-variants apr-util +openldap"
177            ui_error
178            return -code error "incompatible apr-util installation"
179        }
180    }
181}
182
183variant preforkmpm conflicts workermpm eventmpm description {Use prefork MPM} {
184    configure.args-append --with-mpm=prefork
185}
186
187variant workermpm conflicts preforkmpm eventmpm description {Use worker MPM} {
188    configure.args-append --with-mpm=worker
189}
190
191variant eventmpm conflicts preforkmpm workermpm description {Use event MPM (experimental)} {
192    configure.args-append --with-mpm=event
193}
194
195if {![variant_isset workermpm] && ![variant_isset eventmpm]} {
196    default_variants +preforkmpm
197}
198
199startupitem.create  yes
200startupitem.start   \
201"\[ -x ${prefix}/sbin/apachectl \] && ${prefix}/sbin/apachectl start > /dev/null"
202startupitem.stop    \
203"\[ -r ${prefix}/var/run/${apache2.name}/httpd.pid \] && ${prefix}/sbin/apachectl stop > /dev/null"
204startupitem.restart \
205"${prefix}/sbin/apachectl graceful > /dev/null"
206
207livecheck.type  regex
208livecheck.url   ${homepage}download.cgi
209livecheck.regex httpd-(\[0-9.\]+)${extract.suffix}
Note: See TracBrowser for help on using the repository browser.