-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Portfile
249 lines (212 loc) · 8.8 KB
/
Portfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
# -*- 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.62
revision 0
checksums rmd160 90f7acd7ac8a8f6502ae96584c7b66cacf5aabf2 \
sha256 674188e7bf44ced82da8db522da946849e22080d73d16c93f7f4df89e25729ec \
size 7521661
categories www
maintainers {ryandesign @ryandesign} {mps @Schamschula} 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 https://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:libxml2 \
port:pcre \
port:perl5 \
port:zlib
patch.pre_args-replace -p0 -p1
patchfiles patch-build-rules.mk.in.diff \
patch-config.layout.diff \
patch-support-apxs.in.diff \
patch-ssl_engine_init.c.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
}
}
# https://trac.macports.org/wiki/WimplicitFunctionDeclaration#strchr
configure.checks.implicit_function_declaration.whitelist-append strchr
compiler.thread_local_storage yes
# Avoid inheriting CPP value from apr
configure.env "CPP=${configure.cc} -E"
configure.pre_args --prefix=${prefix}
configure.args --enable-authn-alias=shared \
--enable-cache \
--enable-deflate \
--enable-disk_cache \
--enable-file_cache \
--enable-layout=MacPorts \
--enable-mem_cache \
--enable-mods-shared=all \
--enable-proxy \
--enable-ssl \
--enable-proxy-connect \
--enable-proxy-ftp \
--enable-proxy-http \
--with-apr=${prefix}/bin/apr-1-config \
--with-apr-util=${prefix}/bin/apu-1-config \
--with-expat=${prefix} \
--with-libxml2=${prefix} \
--with-pcre=${prefix} \
--with-ssl=${prefix} \
--with-z=${prefix} \
ac_cv_path_RSYNC=/usr/bin/rsync
# explicitly disable modules that may build opportunistically
configure.args-append \
--disable-brotli \
--disable-lua
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" {}
# }
}
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 path:lib/libldap.dylib: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 brotli description {Build brotli module} {
depends_lib-append port:brotli
configure.args-replace --disable-brotli --enable-brotli
configure.args-append --with-brotli=${prefix}
}
variant http2 description {Enable HTTP/2 support} {
depends_lib-append port:nghttp2
configure.args-append --enable-http2
}
variant xml2enc description {Enable i18n support for markup filters} {
configure.args-append --enable-xml2enc --with-libxml2=${prefix}
depends_lib-append port:libxml2
}
variant mpms_shared_all description {Build all MPM's as DSO for dynamic loading} {
configure.args-append --enable-mpms-shared=all
}
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 "
For information about configuring Apache2, see
https://trac.macports.org/wiki/howto/Apache2
"
livecheck.type regex
livecheck.url ${homepage}download.cgi
livecheck.regex httpd-(\[0-9.\]+)${extract.suffix}