Gentoo Archives: gentoo-commits

From: Mikle Kolyada <zlogene@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-servers/lighttpd/
Date: Tue, 01 Jan 2019 09:28:13
Message-Id: 1546334813.21ecd18de98d1297688f1e06cec565fffd2a07ad.zlogene@gentoo
1 commit: 21ecd18de98d1297688f1e06cec565fffd2a07ad
2 Author: Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jan 1 09:26:53 2019 +0000
4 Commit: Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
5 CommitDate: Tue Jan 1 09:26:53 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=21ecd18d
7
8 www-servers/lighttpd: revbump to fix openssl-1.x compat
9
10 Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>
11 Package-Manager: Portage-2.3.51, Repoman-2.3.11
12
13 www-servers/lighttpd/lighttpd-1.4.52-r1.ebuild | 226 +++++++++++++++++++++++++
14 1 file changed, 226 insertions(+)
15
16 diff --git a/www-servers/lighttpd/lighttpd-1.4.52-r1.ebuild b/www-servers/lighttpd/lighttpd-1.4.52-r1.ebuild
17 new file mode 100644
18 index 00000000000..73cb1300148
19 --- /dev/null
20 +++ b/www-servers/lighttpd/lighttpd-1.4.52-r1.ebuild
21 @@ -0,0 +1,226 @@
22 +# Copyright 1999-2019 Gentoo Authors
23 +# Distributed under the terms of the GNU General Public License v2
24 +
25 +EAPI=7
26 +
27 +inherit autotools flag-o-matic readme.gentoo-r1 systemd user
28 +
29 +DESCRIPTION="Lightweight high-performance web server"
30 +HOMEPAGE="https://www.lighttpd.net https://github.com/lighttpd"
31 +SRC_URI="https://download.lighttpd.net/lighttpd/releases-1.4.x/${P}.tar.xz"
32 +
33 +LICENSE="BSD GPL-2"
34 +SLOT="0"
35 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
36 +IUSE="bzip2 dbi doc fam gdbm geoip ipv6 kerberos ldap libev libressl lua minimal mmap memcached mysql pcre php postgres rrdtool sasl selinux ssl sqlite test webdav xattr zlib"
37 +
38 +REQUIRED_USE="kerberos? ( ssl !libressl ) webdav? ( sqlite )"
39 +
40 +BDEPEND="virtual/pkgconfig"
41 +
42 +COMMON_DEPEND="
43 + bzip2? ( app-arch/bzip2 )
44 + dbi? ( dev-db/libdbi )
45 + fam? ( virtual/fam )
46 + gdbm? ( sys-libs/gdbm )
47 + geoip? ( dev-libs/geoip )
48 + ldap? ( >=net-nds/openldap-2.1.26 )
49 + libev? ( >=dev-libs/libev-4.01 )
50 + lua? ( >=dev-lang/lua-5.1:= )
51 + memcached? ( dev-libs/libmemcached )
52 + mysql? ( dev-db/mysql-connector-c:= )
53 + pcre? ( >=dev-libs/libpcre-3.1 )
54 + php? ( dev-lang/php:*[cgi] )
55 + postgres? ( dev-db/postgresql:* )
56 + rrdtool? ( net-analyzer/rrdtool )
57 + sasl? ( dev-libs/cyrus-sasl )
58 + ssl? (
59 + !libressl? ( >=dev-libs/openssl-0.9.7:0=[kerberos(-)?] )
60 + libressl? ( dev-libs/libressl:= )
61 + )
62 + sqlite? ( dev-db/sqlite:3 )
63 + webdav? (
64 + dev-libs/libxml2
65 + sys-fs/e2fsprogs
66 + )
67 + xattr? ( kernel_linux? ( sys-apps/attr ) )
68 + zlib? ( >=sys-libs/zlib-1.1 )"
69 +
70 +DEPEND="${COMMON_DEPEND}
71 + doc? ( dev-python/docutils )
72 + test? (
73 + virtual/perl-Test-Harness
74 + dev-libs/fcgi
75 + )"
76 +
77 +RDEPEND="${OMMON_DEPEND}
78 + selinux? ( sec-policy/selinux-apache )
79 +"
80 +
81 +# update certain parts of lighttpd.conf based on conditionals
82 +update_config() {
83 + local config="${D}/etc/lighttpd/lighttpd.conf"
84 +
85 + # enable php/mod_fastcgi settings
86 + use php && { sed -i -e 's|#.*\(include.*fastcgi.*$\)|\1|' ${config} || die; }
87 +
88 + # enable stat() caching
89 + use fam && { sed -i -e 's|#\(.*stat-cache.*$\)|\1|' ${config} || die; }
90 +
91 + # automatically listen on IPv6 if built with USE=ipv6. Bug #234987
92 + use ipv6 && { sed -i -e 's|# server.use-ipv6|server.use-ipv6|' ${config} || die; }
93 +}
94 +
95 +# remove non-essential stuff (for USE=minimal)
96 +remove_non_essential() {
97 + local libdir="${D}/usr/$(get_libdir)/${PN}"
98 +
99 + # text docs
100 + use doc || rm -fr "${D}"/usr/share/doc/${PF}/txt
101 +
102 + # non-essential modules
103 + rm -f \
104 + ${libdir}/mod_{compress,evhost,expire,proxy,scgi,secdownload,simple_vhost,status,setenv,trigger*,usertrack}.* || die
105 +
106 + # allow users to keep some based on USE flags
107 + use pcre || rm -f ${libdir}/mod_{ssi,re{direct,write}}.*
108 + use webdav || rm -f ${libdir}/mod_webdav.*
109 + use mysql || rm -f ${libdir}/mod_mysql_vhost.*
110 + use lua || rm -f ${libdir}/mod_{cml,magnet}.*
111 + use rrdtool || rm -f ${libdir}/mod_rrdtool.*
112 + use zlib || rm -f ${libdir}/mod_compress.*
113 +}
114 +
115 +pkg_setup() {
116 + if ! use pcre ; then
117 + ewarn "It is highly recommended that you build ${PN}"
118 + ewarn "with perl regular expressions support via USE=pcre."
119 + ewarn "Otherwise you lose support for some core options such"
120 + ewarn "as conditionals and modules such as mod_re{write,direct}"
121 + ewarn "and mod_ssi."
122 + fi
123 +
124 + enewgroup lighttpd
125 + enewuser lighttpd -1 -1 /var/www/localhost/htdocs lighttpd
126 +
127 + DOC_CONTENTS="IPv6 migration guide:\n
128 + http://redmine.lighttpd.net/projects/lighttpd/wiki/IPv6-Config"
129 +}
130 +
131 +src_prepare() {
132 + default
133 + use memcached && append-ldflags -pthread
134 + #dev-python/docutils installs rst2html.py not rst2html
135 + sed -i -e 's|\(rst2html\)|\1.py|g' doc/outdated/Makefile.am || \
136 + die "sed doc/Makefile.am failed"
137 + eautoreconf
138 +}
139 +
140 +src_configure() {
141 + econf --libdir=/usr/$(get_libdir)/${PN} \
142 + --enable-lfs \
143 + $(use_enable ipv6) \
144 + $(use_enable mmap) \
145 + $(use_with bzip2) \
146 + $(use_with dbi) \
147 + $(use_with fam) \
148 + $(use_with gdbm) \
149 + $(use_with geoip ) \
150 + $(use_with kerberos krb5) \
151 + $(use_with ldap) \
152 + $(use_with libev) \
153 + $(use_with lua) \
154 + $(use_with memcached) \
155 + $(use_with mysql) \
156 + $(use_with pcre) \
157 + $(use_with postgres pgsql) \
158 + $(use_with sasl) \
159 + $(use_with ssl openssl) \
160 + $(use_with sqlite sqlite) \
161 + $(use_with webdav webdav-props) \
162 + $(use_with webdav webdav-locks) \
163 + $(use_with xattr attr) \
164 + $(use_with zlib)
165 +}
166 +
167 +src_compile() {
168 + emake
169 +
170 + if use doc ; then
171 + einfo "Building HTML documentation"
172 + cd doc || die
173 + emake html
174 + fi
175 +}
176 +
177 +src_test() {
178 + if [[ ${EUID} -eq 0 ]]; then
179 + default_src_test
180 + else
181 + ewarn "test skipped, please re-run as root if you wish to test ${PN}"
182 + fi
183 +}
184 +
185 +src_install() {
186 + default
187 +
188 + find "${D}" -name '*.la' -delete || die
189 +
190 + # init script stuff
191 + newinitd "${FILESDIR}"/lighttpd.initd lighttpd
192 + newconfd "${FILESDIR}"/lighttpd.confd lighttpd
193 + use fam && has_version app-admin/fam && \
194 + { sed -i 's/after famd/need famd/g' "${D}"/etc/init.d/lighttpd || die; }
195 +
196 + # configs
197 + insinto /etc/lighttpd
198 + doins "${FILESDIR}"/conf/lighttpd.conf
199 + doins "${FILESDIR}"/conf/mime-types.conf
200 + doins "${FILESDIR}"/conf/mod_cgi.conf
201 + doins "${FILESDIR}"/conf/mod_fastcgi.conf
202 +
203 + # update lighttpd.conf directives based on conditionals
204 + update_config
205 +
206 + # docs
207 + dodoc AUTHORS README NEWS doc/scripts/*.sh
208 + newdoc doc/config//lighttpd.conf lighttpd.conf.distrib
209 + use ipv6 && readme.gentoo_create_doc
210 +
211 + use doc && dodoc -r doc
212 +
213 + docinto txt
214 + dodoc doc/outdated/*.txt
215 +
216 + # logrotate
217 + insinto /etc/logrotate.d
218 + newins "${FILESDIR}"/lighttpd.logrotate-r1 lighttpd
219 +
220 + keepdir /var/l{ib,og}/lighttpd /var/www/localhost/htdocs
221 + fowners lighttpd:lighttpd /var/l{ib,og}/lighttpd
222 + fperms 0750 /var/l{ib,og}/lighttpd
223 +
224 + #spawn-fcgi may optionally be installed via www-servers/spawn-fcgi
225 + rm -f "${D}"/usr/bin/spawn-fcgi "${D}"/usr/share/man/man1/spawn-fcgi.* || die
226 +
227 + use minimal && remove_non_essential
228 +
229 + systemd_dounit "${FILESDIR}/${PN}.service"
230 + systemd_dotmpfilesd "${FILESDIR}/${PN}.tmpfiles.conf"
231 +}
232 +
233 +pkg_postinst () {
234 + use ipv6 && readme.gentoo_print_elog
235 +
236 + if [[ -f ${ROOT}etc/conf.d/spawn-fcgi.conf ]] ; then
237 + einfo "spawn-fcgi is now provided by www-servers/spawn-fcgi."
238 + einfo "spawn-fcgi's init script configuration is now located"
239 + einfo "at /etc/conf.d/spawn-fcgi."
240 + fi
241 +
242 + if [[ -f ${ROOT}etc/lighttpd.conf ]] ; then
243 + elog "Gentoo has a customized configuration,"
244 + elog "which is now located in /etc/lighttpd. Please migrate your"
245 + elog "existing configuration."
246 + fi
247 +}