Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: profiles/desc/, www-servers/apache/
Date: Thu, 03 Sep 2020 19:36:41
Message-Id: 1599161791.1e3f42ca3b6f2a826a250f4340a316a156da84b2.polynomial-c@gentoo
1 commit: 1e3f42ca3b6f2a826a250f4340a316a156da84b2
2 Author: Jaco Kroon <jaco <AT> uls <DOT> co <DOT> za>
3 AuthorDate: Thu Sep 3 11:35:24 2020 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 3 19:36:31 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1e3f42ca
7
8 www-servers/apache: add mod_socache_memcache
9
10 Closes: https://bugs.gentoo.org/740202
11 Signed-off-by: Jaco Kroon <jaco <AT> uls.co.za>
12 Closes: https://github.com/gentoo/gentoo/pull/17395
13 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
14
15 profiles/desc/apache2_modules.desc | 1 +
16 www-servers/apache/apache-2.4.46-r1.ebuild | 274 +++++++++++++++++++++++++++++
17 2 files changed, 275 insertions(+)
18
19 diff --git a/profiles/desc/apache2_modules.desc b/profiles/desc/apache2_modules.desc
20 index 630aa0a522d..1b3ff2610ad 100644
21 --- a/profiles/desc/apache2_modules.desc
22 +++ b/profiles/desc/apache2_modules.desc
23 @@ -89,6 +89,7 @@ session_cookie - Provides support for the storage of user sessions on the remote
24 session_dbd - Provides support for the storage of user sessions within a SQL database using the mod_dbd module
25 setenvif - Allows the setting of environment variables based on characteristics of the request
26 slotmem_shm - Slot-based shared memory provider
27 +socache_memcache - A shared object cache provider using memcached
28 socache_shmcb - A shared object cache provider using a high-performance cyclic buffer inside a shared memory segment
29 speling - Attempts to correct mistaken URLs that users might have entered by ignoring capitalization and by allowing up to one misspelling
30 status - Provides information on server activity and performance
31
32 diff --git a/www-servers/apache/apache-2.4.46-r1.ebuild b/www-servers/apache/apache-2.4.46-r1.ebuild
33 new file mode 100644
34 index 00000000000..f2ea863d642
35 --- /dev/null
36 +++ b/www-servers/apache/apache-2.4.46-r1.ebuild
37 @@ -0,0 +1,274 @@
38 +# Copyright 1999-2020 Gentoo Authors
39 +# Distributed under the terms of the GNU General Public License v2
40 +
41 +EAPI=6
42 +
43 +# latest gentoo apache files
44 +GENTOO_PATCHSTAMP="20190402"
45 +GENTOO_DEVELOPER="polynomial-c"
46 +GENTOO_PATCHNAME="gentoo-apache-2.4.39"
47 +
48 +# IUSE/USE_EXPAND magic
49 +IUSE_MPMS_FORK="prefork"
50 +IUSE_MPMS_THREAD="event worker"
51 +
52 +# << obsolete modules:
53 +# authn_default authz_default mem_cache
54 +# mem_cache is replaced by cache_disk
55 +# ?? buggy modules
56 +# proxy_scgi: startup error: undefined symbol "ap_proxy_release_connection", no fix found
57 +# >> added modules for reason:
58 +# compat: compatibility with 2.2 access control
59 +# authz_host: new module for access control
60 +# authn_core: functionality provided by authn_alias in previous versions
61 +# authz_core: new module, provides core authorization capabilities
62 +# cache_disk: replacement for mem_cache
63 +# lbmethod_byrequests: Split off from mod_proxy_balancer in 2.3
64 +# lbmethod_bytraffic: Split off from mod_proxy_balancer in 2.3
65 +# lbmethod_bybusyness: Split off from mod_proxy_balancer in 2.3
66 +# lbmethod_heartbeat: Split off from mod_proxy_balancer in 2.3
67 +# slotmem_shm: Slot-based shared memory provider (for lbmethod_byrequests).
68 +# socache_shmcb: shared object cache provider. Default config with ssl needs it
69 +# unixd: fixes startup error: Invalid command 'User'
70 +IUSE_MODULES="access_compat actions alias asis auth_basic auth_digest auth_form
71 +authn_alias authn_anon authn_core authn_dbd authn_dbm authn_file authn_socache authz_core
72 +authz_dbd authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex
73 +brotli cache cache_disk cache_socache cern_meta charset_lite cgi cgid dav dav_fs dav_lock
74 +dbd deflate dir dumpio env expires ext_filter file_cache filter headers http2
75 +ident imagemap include info lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness
76 +lbmethod_heartbeat log_config log_forensic logio macro md mime mime_magic negotiation
77 +proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_html proxy_http proxy_scgi
78 +proxy_http2 proxy_fcgi proxy_wstunnel rewrite ratelimit remoteip reqtimeout
79 +session session_cookie session_crypto session_dbd setenvif slotmem_shm speling
80 +socache_memcache socache_shmcb status substitute unique_id userdir usertrack
81 +unixd version vhost_alias watchdog xml2enc"
82 +# The following are also in the source as of this version, but are not available
83 +# for user selection:
84 +# bucketeer case_filter case_filter_in echo http isapi optional_fn_export
85 +# optional_fn_import optional_hook_export optional_hook_import
86 +
87 +# inter-module dependencies
88 +# TODO: this may still be incomplete
89 +MODULE_DEPENDS="
90 + auth_form:session
91 + brotli:filter
92 + dav_fs:dav
93 + dav_lock:dav
94 + deflate:filter
95 + cache_disk:cache
96 + ext_filter:filter
97 + file_cache:cache
98 + lbmethod_byrequests:proxy_balancer
99 + lbmethod_byrequests:slotmem_shm
100 + lbmethod_bytraffic:proxy_balancer
101 + lbmethod_bybusyness:proxy_balancer
102 + lbmethod_heartbeat:proxy_balancer
103 + log_forensic:log_config
104 + logio:log_config
105 + cache_disk:cache
106 + cache_socache:cache
107 + md:watchdog
108 + mime_magic:mime
109 + proxy_ajp:proxy
110 + proxy_balancer:proxy
111 + proxy_balancer:slotmem_shm
112 + proxy_connect:proxy
113 + proxy_ftp:proxy
114 + proxy_html:proxy
115 + proxy_html:xml2enc
116 + proxy_http:proxy
117 + proxy_http2:proxy
118 + proxy_scgi:proxy
119 + proxy_fcgi:proxy
120 + proxy_wstunnel:proxy
121 + session_cookie:session
122 + session_dbd:dbd
123 + session_dbd:session
124 + socache_memcache:cache
125 + substitute:filter
126 +"
127 +
128 +# module<->define mappings
129 +MODULE_DEFINES="
130 + auth_digest:AUTH_DIGEST
131 + authnz_ldap:AUTHNZ_LDAP
132 + cache:CACHE
133 + cache_disk:CACHE
134 + cache_socache:CACHE
135 + dav:DAV
136 + dav_fs:DAV
137 + dav_lock:DAV
138 + file_cache:CACHE
139 + http2:HTTP2
140 + info:INFO
141 + ldap:LDAP
142 + md:SSL
143 + proxy:PROXY
144 + proxy_ajp:PROXY
145 + proxy_balancer:PROXY
146 + proxy_connect:PROXY
147 + proxy_ftp:PROXY
148 + proxy_html:PROXY
149 + proxy_http:PROXY
150 + proxy_fcgi:PROXY
151 + proxy_scgi:PROXY
152 + proxy_wstunnel:PROXY
153 + socache_shmcb:SSL
154 + socache_memcache:CACHE
155 + ssl:SSL
156 + status:STATUS
157 + suexec:SUEXEC
158 + userdir:USERDIR
159 +"
160 +
161 +# critical modules for the default config
162 +MODULE_CRITICAL="
163 + authn_core
164 + authz_core
165 + authz_host
166 + dir
167 + mime
168 + unixd
169 +"
170 +inherit apache-2 systemd tmpfiles toolchain-funcs
171 +
172 +DESCRIPTION="The Apache Web Server"
173 +HOMEPAGE="https://httpd.apache.org/"
174 +
175 +# some helper scripts are Apache-1.1, thus both are here
176 +LICENSE="Apache-2.0 Apache-1.1"
177 +SLOT="2"
178 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x64-macos ~x86-macos ~m68k-mint ~sparc64-solaris ~x64-solaris"
179 +
180 +# Enable http2 by default (bug #563452)
181 +# FIXME: Move to apache-2.eclass once this has reached stable.
182 +IUSE="${IUSE/apache2_modules_http2/+apache2_modules_http2}"
183 +# New suexec options (since 2.4.34)
184 +IUSE="${IUSE} +suexec-caps suexec-syslog split-usr"
185 +
186 +CDEPEND="apache2_modules_brotli? ( >=app-arch/brotli-0.6.0:= )
187 + apache2_modules_http2? ( >=net-libs/nghttp2-1.2.1 )
188 + apache2_modules_proxy_http2? ( >=net-libs/nghttp2-1.2.1 )
189 + apache2_modules_md? ( >=dev-libs/jansson-2.10 )
190 + apache2_modules_session_crypto? (
191 + libressl? ( dev-libs/apr-util[libressl] )
192 + !libressl? ( dev-libs/apr-util[openssl] )
193 + )"
194 +
195 +DEPEND+="${CDEPEND}
196 + suexec? ( suexec-caps? ( sys-libs/libcap ) )"
197 +RDEPEND+="${CDEPEND}"
198 +
199 +REQUIRED_USE="apache2_modules_http2? ( ssl )
200 + apache2_modules_md? ( ssl )"
201 +
202 +PATCHES=(
203 + "${FILESDIR}/${PN}-2.4.41-libressl.patch" #668060
204 +)
205 +
206 +pkg_setup() {
207 + # dependend critical modules which are not allowed in global scope due
208 + # to USE flag conditionals (bug #499260)
209 + use ssl && MODULE_CRITICAL+=" socache_shmcb"
210 + use doc && MODULE_CRITICAL+=" alias negotiation setenvif"
211 + apache-2_pkg_setup
212 +}
213 +
214 +src_configure() {
215 + # Brain dead check.
216 + tc-is-cross-compiler && export ap_cv_void_ptr_lt_long="no"
217 +
218 + apache-2_src_configure
219 +}
220 +
221 +src_compile() {
222 + if tc-is-cross-compiler; then
223 + # This header is the same across targets, so use the build compiler.
224 + pushd server >/dev/null
225 + emake gen_test_char
226 + tc-export_build_env BUILD_CC
227 + ${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_CPPFLAGS} ${BUILD_LDFLAGS} \
228 + gen_test_char.c -o gen_test_char $(apr-1-config --includes) || die
229 + popd >/dev/null
230 + fi
231 +
232 + default
233 +}
234 +
235 +src_install() {
236 + apache-2_src_install
237 + local i
238 + local apache_tools_prune_list=(
239 + /usr/bin/{htdigest,logresolve,htpasswd,htdbm,ab,httxt2dbm}
240 + /usr/sbin/{checkgid,fcgistarter,htcacheclean,rotatelogs}
241 + /usr/share/man/man1/{logresolve.1,htdbm.1,htdigest.1,htpasswd.1,dbmmanage.1,ab.1}
242 + /usr/share/man/man8/{rotatelogs.8,htcacheclean.8}
243 + )
244 + for i in ${apache_tools_prune_list[@]} ; do
245 + rm "${ED%/}"/${i} || die "Failed to prune apache-tools bits"
246 + done
247 +
248 + # install apxs in /usr/bin (bug #502384) and put a symlink into the
249 + # old location until all ebuilds and eclasses have been modified to
250 + # use the new location.
251 + dobin support/apxs
252 + use split-usr && dosym ../bin/apxs /usr/sbin/apxs
253 +
254 + # Note: wait for mod_systemd to be included in some forthcoming release,
255 + # Then apache2.4.service can be used and systemd support controlled
256 + # through --enable-systemd
257 + systemd_newunit "${FILESDIR}/apache2.2-hardened.service" "apache2.service"
258 + systemd_dotmpfilesd "${FILESDIR}/apache.conf"
259 + #insinto /etc/apache2/modules.d
260 + #doins "${FILESDIR}/00_systemd.conf"
261 +
262 + # Install http2 module config
263 + insinto /etc/apache2/modules.d
264 + doins "${FILESDIR}"/41_mod_http2.conf
265 +
266 + # Fix path to apache libdir
267 + sed "s|@LIBDIR@|$(get_libdir)|" -i "${ED%/}"/usr/sbin/apache2ctl || die
268 +}
269 +
270 +pkg_postinst() {
271 + apache-2_pkg_postinst || die "apache-2_pkg_postinst failed"
272 +
273 + tmpfiles_process apache.conf #662544
274 +
275 + # warnings that default config might not work out of the box
276 + local mod cmod
277 + for mod in ${MODULE_CRITICAL} ; do
278 + if ! use "apache2_modules_${mod}"; then
279 + echo
280 + ewarn "Warning: Critical module not installed!"
281 + ewarn "Modules 'authn_core', 'authz_core' and 'unixd'"
282 + ewarn "are highly recomended but might not be in the base profile yet."
283 + ewarn "Default config for ssl needs module 'socache_shmcb'."
284 + ewarn "Enabling the following flags is highly recommended:"
285 + for cmod in ${MODULE_CRITICAL} ; do
286 + use "apache2_modules_${cmod}" || \
287 + ewarn "+ apache2_modules_${cmod}"
288 + done
289 + echo
290 + break
291 + fi
292 + done
293 + # warning for proxy_balancer and missing load balancing scheduler
294 + if use apache2_modules_proxy_balancer; then
295 + local lbset=
296 + for mod in lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat; do
297 + if use "apache2_modules_${mod}"; then
298 + lbset=1 && break
299 + fi
300 + done
301 + if [ ! ${lbset} ] ; then
302 + echo
303 + ewarn "Info: Missing load balancing scheduler algorithm module"
304 + ewarn "(They were split off from proxy_balancer in 2.3)"
305 + ewarn "In order to get the ability of load balancing, at least"
306 + ewarn "one of these modules has to be present:"
307 + ewarn "lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat"
308 + echo
309 + fi
310 + fi
311 +}