/
Portfile
164 lines (136 loc) · 5.88 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
# -*- 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 legacysupport 1.0
PortGroup lua 1.0
name lighttpd
version 1.4.76
revision 0
checksums rmd160 6f119159a4552b24d3c98fc486ed89144299d6b9 \
sha256 8cbf4296e373cfd0cedfe9d978760b5b05c58fdc4048b4e2bcaf0a61ac8f5011 \
size 847132
set branch [join [lrange [split ${version} .] 0 1] .]
categories www
maintainers {ryandesign @ryandesign} openmaintainer
license BSD
description A secure, fast, compliant and flexible web-server
long_description lighttpd is a secure, fast, compliant and very \
flexible web server which has been optimized for \
high-performance environments. It has a very low \
memory footprint compared to other web servers \
and takes care of CPU load.
homepage https://www.lighttpd.net/
master_sites https://download.lighttpd.net/lighttpd/releases-${branch}.x/
use_xz yes
# Upstream no longer provides a configure script in the tarball.
use_autoreconf yes
autoreconf.cmd ./autogen.sh
autoreconf.args
depends_build-append port:autoconf \
port:automake \
port:libtool \
path:bin/pkg-config:pkgconfig
depends_lib port:brotli \
port:pcre2 \
port:spawn-fcgi \
port:xxhashlib \
port:zlib \
port:zstd
patchfiles patch-conf.diff
post-patch {
reinplace "s|@PREFIX@|${prefix}|g" \
${worksrcpath}/doc/config/conf.d/cgi.conf \
${worksrcpath}/doc/config/conf.d/fastcgi.conf \
${worksrcpath}/doc/config/conf.d/rrdtool.conf \
${worksrcpath}/doc/config/lighttpd.conf
}
configure.args-append CC_FOR_BUILD="${configure.cc}" \
CFLAGS_FOR_BUILD="${configure.cflags}" \
--with-brotli \
--with-lua=lua \
--with-pcre2 \
--with-xxhash \
--with-zlib \
--with-zstd \
ac_cv_prog_AWK=/usr/bin/awk
platform darwin {
patchfiles-append patch-conf-darwin.diff
post-patch {
if {${os.major} <= 8} {
set user "www"
set group "www"
} else {
set user "_www"
set group "_www"
}
reinplace "s|@USER@|${user}|g" ${worksrcpath}/doc/config/lighttpd.conf
reinplace "s|@GROUP@|${group}|g" ${worksrcpath}/doc/config/lighttpd.conf
}
}
test.run yes
test.target check
test.env SHELL=/bin/sh
set lighttpd_config_dir ${prefix}/etc/${name}
startupitem.create yes
startupitem.executable ${prefix}/sbin/lighttpd -D -f ${lighttpd_config_dir}/lighttpd.conf
destroot.keepdirs ${destroot}${prefix}/var/log/lighttpd \
${destroot}${prefix}/www/htdocs \
${destroot}${prefix}/var/run/lighttpd \
${destroot}${prefix}/var/lib/lighttpd/sockets \
${destroot}${prefix}/var/cache/lighttpd/compress
post-destroot {
xinstall -d ${destroot}${lighttpd_config_dir}/conf.d
foreach f [glob ${worksrcpath}/doc/config/*.conf] {
xinstall -m 0644 ${f} ${destroot}${lighttpd_config_dir}/[file tail ${f}].default
}
foreach f [glob ${worksrcpath}/doc/config/conf.d/*.conf] {
xinstall -m 0644 ${f} ${destroot}${lighttpd_config_dir}/conf.d/[file tail ${f}].default
}
set docdir ${destroot}${prefix}/share/doc/${name}
xinstall -d ${docdir}
xinstall -m 0644 -W ${worksrcpath} \
AUTHORS \
COPYING \
NEWS \
README \
${docdir}
}
install.asroot yes
post-activate {
# Copy default conf files if not present
foreach f [glob ${lighttpd_config_dir}/*.conf.default] {
set f [file rootname ${f}]
if {![file exists ${f}]} {
copy ${f}.default ${f}
}
}
foreach f [glob ${lighttpd_config_dir}/conf.d/*.conf.default] {
set f [file rootname ${f}]
if {![file exists ${f}]} {
copy ${f}.default ${f}
}
}
}
variant mysql57 description {Enable MySQL 5.7 support} {
depends_lib-append port:mysql57
configure.args-append --with-mysql=${prefix}/lib/mysql57/bin/mysql_config
#configure.cppflags-append -I${prefix}/include/mysql57/mysql
}
variant ssl description {Enable serving secure web sites with SSL} {
depends_lib-append path:lib/libssl.dylib:openssl
configure.args-append --with-openssl
}
variant davprops description {Enable mod_webdav} {
depends_lib-append port:libxml2 \
port:sqlite3
configure.args-append --with-webdav-props
}
default_variants +ssl
notes "
Before starting lighttpd it must be configured.\
Basic server configuration is in the file ${lighttpd_config_dir}/lighttpd.conf.\
Select which modules you want enabled in ${lighttpd_config_dir}/modules.conf.\
Individual modules' settings are in ${lighttpd_config_dir}/conf.d.
Sample config files have the .conf.default extension.\
When updating lighttpd, you should investigate whether you need to update\
your .conf files with changes from the corresponding .conf.default files.
"