Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 502384 | Differences between
and this patch

Collapse All | Expand All

(-)a/www-servers/apache/Manifest (-2 lines)
Lines 1-7 Link Here
1
DIST gentoo-apache-2.4.46-r6-20210212.tar.bz2 25854 BLAKE2B 001f16c1beac8c90fd407bb2f77417f886296baf02acf0f6d81dc0f10c209270db7005f58d845d309dec8332773556da88db41a57c6ecc86f24b8a5141ba07d0 SHA512 976dde952277542efca70831b67da32b8bf636a346adeeb6e0bc5a65b3543a7ca4fb182bc01204f747b583dd753607d184d91ef46a93d5e2f3ab55ed787860a2
1
DIST gentoo-apache-2.4.46-r6-20210212.tar.bz2 25854 BLAKE2B 001f16c1beac8c90fd407bb2f77417f886296baf02acf0f6d81dc0f10c209270db7005f58d845d309dec8332773556da88db41a57c6ecc86f24b8a5141ba07d0 SHA512 976dde952277542efca70831b67da32b8bf636a346adeeb6e0bc5a65b3543a7ca4fb182bc01204f747b583dd753607d184d91ef46a93d5e2f3ab55ed787860a2
2
DIST gentoo-apache-2.4.57-r2-20230903.tar.bz2 25595 BLAKE2B 030d7624293b85d35c02b317e78e0ac8736cfd9b4116b66727262bfd1003e28e604010526a766f0b5fa2bf359e5cfe0e6eee6ffbea05eeb41e51772913692d85 SHA512 334304d4d35e5d9e39b58af4594e3f57f2e4f6f11f5944715b0dd63c92717c1255dd3e4fed96d914487a15b8faf1792914087b7240b0f23ab6d0960972013d1e
3
DIST gentoo-apache-2.4.57-r3-20230903.tar.bz2 27356 BLAKE2B 793c6a94062ea7a68acbe0b739e9b317390c16e57a8ae4cd85bd03ae1663c25050a796c199dc958c9eb7913e677698cba042b3fb0b28dc5c90c5da49c503fbba SHA512 82e2c36fbc14f70f4e4b48eebe83d52082e05994d8ec095aec392adfea71f4b8abee60a320e36c188ee9b1d0113a5880b4780bdbd6230e47909ed115de0de2cb
4
DIST gentoo-apache-2.4.57-r5-20231011.tar.bz2 27081 BLAKE2B 7d98c850cda8b43901b4373e36889e4e951615e2e2769baa564f44e180fba0a74f0af45d2aa552b70ac1609aa3430e240118f2656c5285d31c1dd5edad9f3b6d SHA512 6c445212aaa211a9ad24599763e1d42b5f88394976f8f488175ce3ec3ea7e83b93f87d3c0c4ffc82b4a13ae575e78fba114bc5bacae9324be962eba48d3bc146
2
DIST gentoo-apache-2.4.57-r5-20231011.tar.bz2 27081 BLAKE2B 7d98c850cda8b43901b4373e36889e4e951615e2e2769baa564f44e180fba0a74f0af45d2aa552b70ac1609aa3430e240118f2656c5285d31c1dd5edad9f3b6d SHA512 6c445212aaa211a9ad24599763e1d42b5f88394976f8f488175ce3ec3ea7e83b93f87d3c0c4ffc82b4a13ae575e78fba114bc5bacae9324be962eba48d3bc146
5
DIST gentoo-apache-2.4.58-20231019.tar.bz2 26224 BLAKE2B 370f36dcbe9d10ed0dd415c2e28016c7897246b5c3f830e849e765c18a08be145c8a363f122dff2c4b8d5b1e53ff504a79d7512a58135899a539136b580524ed SHA512 60f68eb4168a86ee33525e7c90cf5af8da586ed31d12cc294ea6bf3bcb9f254ea7e1a4ca5db4846a0e92b97c1326f095aa3a9d5fdb9ed92c1c4726c5a825ab36
3
DIST gentoo-apache-2.4.58-20231019.tar.bz2 26224 BLAKE2B 370f36dcbe9d10ed0dd415c2e28016c7897246b5c3f830e849e765c18a08be145c8a363f122dff2c4b8d5b1e53ff504a79d7512a58135899a539136b580524ed SHA512 60f68eb4168a86ee33525e7c90cf5af8da586ed31d12cc294ea6bf3bcb9f254ea7e1a4ca5db4846a0e92b97c1326f095aa3a9d5fdb9ed92c1c4726c5a825ab36
6
DIST httpd-2.4.57.tar.bz2 7457022 BLAKE2B b33b51a741acd308ef4d4bdd2444d43eca9db68676fa67ec907eeea7384554f3f9a5608fc43dcf5819498264bbe36f176f30be9809474307642b70720036b88c SHA512 4d1e0a274ee90bdfb5f38d4a7d73a7367ed1c6388e26280e640014e49abc0df03683705b88dcfe2ec2da313dda4c7b4a3b86daffa1911f58e224eba89d82d155
4
DIST httpd-2.4.57.tar.bz2 7457022 BLAKE2B b33b51a741acd308ef4d4bdd2444d43eca9db68676fa67ec907eeea7384554f3f9a5608fc43dcf5819498264bbe36f176f30be9809474307642b70720036b88c SHA512 4d1e0a274ee90bdfb5f38d4a7d73a7367ed1c6388e26280e640014e49abc0df03683705b88dcfe2ec2da313dda4c7b4a3b86daffa1911f58e224eba89d82d155
7
DIST httpd-2.4.58.tar.bz2 7485817 BLAKE2B 2105b8fada99f1dda55201ed89ed5326f0edb078d352cbff44f02cde80d129b65b63e07366a9a744ba474be5687fa8d3d2d8ddc64ac914b47166607f3f4a9de2 SHA512 d6e73bf413a507ec16b621ff635e178206207a9e9810ce3944b3dc98d39cde8f225307110167fc9da5822175796c8cb66f98be5b9f0d8b76dcd83a401d39b2c1
5
DIST httpd-2.4.58.tar.bz2 7485817 BLAKE2B 2105b8fada99f1dda55201ed89ed5326f0edb078d352cbff44f02cde80d129b65b63e07366a9a744ba474be5687fa8d3d2d8ddc64ac914b47166607f3f4a9de2 SHA512 d6e73bf413a507ec16b621ff635e178206207a9e9810ce3944b3dc98d39cde8f225307110167fc9da5822175796c8cb66f98be5b9f0d8b76dcd83a401d39b2c1
(-)a/www-servers/apache/apache-2.4.57-r1.ebuild (-260 lines)
Lines 1-260 Link Here
1
# Copyright 1999-2023 Gentoo Authors
2
# Distributed under the terms of the GNU General Public License v2
3
4
EAPI=7
5
6
# latest gentoo apache files
7
GENTOO_PATCHSTAMP="20210212"
8
GENTOO_DEVELOPER="polynomial-c"
9
GENTOO_PATCHNAME="gentoo-apache-2.4.46-r6"
10
11
# IUSE/USE_EXPAND magic
12
IUSE_MPMS_FORK="prefork"
13
IUSE_MPMS_THREAD="event worker"
14
15
# << obsolete modules:
16
# authn_default authz_default mem_cache
17
# mem_cache is replaced by cache_disk
18
# ?? buggy modules
19
# proxy_scgi: startup error: undefined symbol "ap_proxy_release_connection", no fix found
20
# >> added modules for reason:
21
# compat: compatibility with 2.2 access control
22
# authz_host: new module for access control
23
# authn_core: functionality provided by authn_alias in previous versions
24
# authz_core: new module, provides core authorization capabilities
25
# cache_disk: replacement for mem_cache
26
# lbmethod_byrequests: Split off from mod_proxy_balancer in 2.3
27
# lbmethod_bytraffic: Split off from mod_proxy_balancer in 2.3
28
# lbmethod_bybusyness: Split off from mod_proxy_balancer in 2.3
29
# lbmethod_heartbeat: Split off from mod_proxy_balancer in 2.3
30
# slotmem_shm: Slot-based shared memory provider (for lbmethod_byrequests).
31
# socache_shmcb: shared object cache provider. Default config with ssl needs it
32
# unixd: fixes startup error: Invalid command 'User'
33
IUSE_MODULES="access_compat actions alias allowmethods asis auth_basic auth_digest auth_form
34
authn_anon authn_core authn_dbd authn_dbm authn_file authn_socache authz_core
35
authz_dbd authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex
36
brotli cache cache_disk cache_socache cern_meta charset_lite cgi cgid dav dav_fs dav_lock
37
dbd deflate dir dumpio env expires ext_filter file_cache filter headers http2
38
ident imagemap include info lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness
39
lbmethod_heartbeat log_config log_forensic logio lua macro md mime mime_magic negotiation
40
proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_hcheck proxy_html proxy_http proxy_scgi
41
proxy_http2 proxy_fcgi proxy_uwsgi proxy_wstunnel rewrite ratelimit remoteip reqtimeout
42
session session_cookie session_crypto session_dbd setenvif slotmem_shm socache_memcache
43
socache_shmcb speling status substitute systemd tls unique_id userdir usertrack
44
unixd version vhost_alias watchdog xml2enc"
45
# The following are also in the source as of this version, but are not available
46
# for user selection:
47
# bucketeer case_filter case_filter_in echo http isapi optional_fn_export
48
# optional_fn_import optional_hook_export optional_hook_import
49
50
# inter-module dependencies
51
# TODO: this may still be incomplete
52
MODULE_DEPENDS="
53
	auth_form:session
54
	brotli:filter
55
	dav_fs:dav
56
	dav_lock:dav
57
	deflate:filter
58
	cache_disk:cache
59
	ext_filter:filter
60
	file_cache:cache
61
	lbmethod_byrequests:proxy_balancer
62
	lbmethod_byrequests:slotmem_shm
63
	lbmethod_bytraffic:proxy_balancer
64
	lbmethod_bybusyness:proxy_balancer
65
	lbmethod_heartbeat:proxy_balancer
66
	log_forensic:log_config
67
	logio:log_config
68
	cache_disk:cache
69
	cache_socache:cache
70
	md:watchdog
71
	mime_magic:mime
72
	proxy_ajp:proxy
73
	proxy_balancer:proxy
74
	proxy_balancer:slotmem_shm
75
	proxy_connect:proxy
76
	proxy_ftp:proxy
77
	proxy_hcheck:proxy
78
	proxy_hcheck:watchdog
79
	proxy_html:proxy
80
	proxy_html:xml2enc
81
	proxy_http:proxy
82
	proxy_http2:proxy
83
	proxy_scgi:proxy
84
	proxy_uwsgi:proxy
85
	proxy_fcgi:proxy
86
	proxy_wstunnel:proxy
87
	session_cookie:session
88
	session_dbd:dbd
89
	session_dbd:session
90
	socache_memcache:cache
91
	substitute:filter
92
"
93
94
# module<->define mappings
95
MODULE_DEFINES="
96
	auth_digest:AUTH_DIGEST
97
	authnz_ldap:AUTHNZ_LDAP
98
	cache:CACHE
99
	cache_disk:CACHE
100
	cache_socache:CACHE
101
	dav:DAV
102
	dav_fs:DAV
103
	dav_lock:DAV
104
	file_cache:CACHE
105
	http2:HTTP2
106
	info:INFO
107
	ldap:LDAP
108
	lua:LUA
109
	md:SSL
110
	proxy:PROXY
111
	proxy_ajp:PROXY
112
	proxy_balancer:PROXY
113
	proxy_connect:PROXY
114
	proxy_ftp:PROXY
115
	proxy_html:PROXY
116
	proxy_http:PROXY
117
	proxy_hcheck:PROXY
118
	proxy_fcgi:PROXY
119
	proxy_scgi:PROXY
120
	proxy_wstunnel:PROXY
121
	socache_shmcb:SSL
122
	socache_memcache:CACHE
123
	ssl:SSL
124
	status:STATUS
125
	suexec:SUEXEC
126
	systemd:SYSTEMD
127
	userdir:USERDIR
128
"
129
130
# critical modules for the default config
131
MODULE_CRITICAL="
132
	authn_core
133
	authz_core
134
	authz_host
135
	dir
136
	mime
137
	unixd
138
"
139
inherit apache-2 systemd tmpfiles toolchain-funcs
140
141
DESCRIPTION="The Apache Web Server"
142
HOMEPAGE="https://httpd.apache.org/"
143
144
# some helper scripts are Apache-1.1, thus both are here
145
LICENSE="Apache-2.0 Apache-1.1"
146
SLOT="2"
147
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x64-macos ~x64-solaris"
148
149
PATCHES=(
150
	"${FILESDIR}"/${PN}-2.4.54-no-which.patch # bug #844868
151
	"${FILESDIR}"/${PN}-2.4.54-libtool.patch # bug #858836
152
	"${FILESDIR}"/${P}-rustls-ffi-0.10.0.patch # bug #906523
153
)
154
155
pkg_setup() {
156
	# dependent critical modules which are not allowed in global scope due
157
	# to USE flag conditionals (bug #499260)
158
	use ssl && MODULE_CRITICAL+=" socache_shmcb"
159
	use doc && MODULE_CRITICAL+=" alias negotiation setenvif"
160
	apache-2_pkg_setup
161
}
162
163
src_configure() {
164
	# Brain dead check.
165
	tc-is-cross-compiler && export ap_cv_void_ptr_lt_long="no"
166
167
	apache-2_src_configure
168
}
169
170
src_compile() {
171
	if tc-is-cross-compiler ; then
172
		# This header is the same across targets, so use the build compiler.
173
		pushd server >/dev/null
174
		emake gen_test_char
175
		tc-export_build_env BUILD_CC
176
		${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_CPPFLAGS} ${BUILD_LDFLAGS} \
177
			gen_test_char.c -o gen_test_char $(apr-1-config --includes) || die
178
		popd >/dev/null
179
	fi
180
181
	default
182
}
183
184
src_install() {
185
	apache-2_src_install
186
	local i
187
	local apache_tools_prune_list=(
188
		/usr/bin/{htdigest,logresolve,htpasswd,htdbm,ab,httxt2dbm}
189
		/usr/sbin/{checkgid,fcgistarter,htcacheclean,rotatelogs}
190
		/usr/share/man/man1/{logresolve.1,htdbm.1,htdigest.1,htpasswd.1,dbmmanage.1,ab.1}
191
		/usr/share/man/man8/{rotatelogs.8,htcacheclean.8}
192
	)
193
	for i in ${apache_tools_prune_list[@]} ; do
194
		rm "${ED}"/${i} || die "Failed to prune apache-tools bits"
195
	done
196
197
	# install apxs in /usr/bin (bug #502384) and put a symlink into the
198
	# old location until all ebuilds and eclasses have been modified to
199
	# use the new location.
200
	dobin support/apxs
201
	use split-usr && dosym ../bin/apxs /usr/sbin/apxs
202
203
	# Note: wait for mod_systemd to be included in some forthcoming release,
204
	# Then apache2.4.service can be used and systemd support controlled
205
	# through --enable-systemd
206
	systemd_newunit "${FILESDIR}/apache2.4-hardened.service" "apache2.service"
207
	dotmpfiles "${FILESDIR}/apache.conf"
208
	#insinto /etc/apache2/modules.d
209
	#doins "${FILESDIR}/00_systemd.conf"
210
211
	# Install http2 module config
212
	insinto /etc/apache2/modules.d
213
	doins "${FILESDIR}"/41_mod_http2.conf
214
215
	# Fix path to apache libdir
216
	sed "s|@LIBDIR@|$(get_libdir)|" -i "${ED}"/usr/sbin/apache2ctl || die
217
}
218
219
pkg_postinst() {
220
	apache-2_pkg_postinst || die "apache-2_pkg_postinst failed"
221
222
	tmpfiles_process apache.conf #662544
223
224
	# warnings that default config might not work out of the box
225
	local mod cmod
226
	for mod in ${MODULE_CRITICAL} ; do
227
		if ! use "apache2_modules_${mod}"; then
228
			echo
229
			ewarn "Warning: Critical module not installed!"
230
			ewarn "Modules 'authn_core', 'authz_core' and 'unixd'"
231
			ewarn "are highly recomended but might not be in the base profile yet."
232
			ewarn "Default config for ssl needs module 'socache_shmcb'."
233
			ewarn "Enabling the following flags is highly recommended:"
234
			for cmod in ${MODULE_CRITICAL} ; do
235
				use "apache2_modules_${cmod}" || \
236
					ewarn "+ apache2_modules_${cmod}"
237
			done
238
			echo
239
			break
240
		fi
241
	done
242
	# warning for proxy_balancer and missing load balancing scheduler
243
	if use apache2_modules_proxy_balancer; then
244
		local lbset=
245
		for mod in lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat; do
246
			if use "apache2_modules_${mod}"; then
247
				lbset=1 && break
248
			fi
249
		done
250
		if [[ ! ${lbset} ]] ; then
251
			echo
252
			ewarn "Info: Missing load balancing scheduler algorithm module"
253
			ewarn "(They were split off from proxy_balancer in 2.3)"
254
			ewarn "In order to get the ability of load balancing, at least"
255
			ewarn "one of these modules has to be present:"
256
			ewarn "lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat"
257
			echo
258
		fi
259
	fi
260
}
(-)a/www-servers/apache/apache-2.4.57-r2.ebuild (-260 lines)
Lines 1-260 Link Here
1
# Copyright 1999-2023 Gentoo Authors
2
# Distributed under the terms of the GNU General Public License v2
3
4
EAPI=7
5
6
# latest gentoo apache files
7
GENTOO_PATCHSTAMP="20230903"
8
GENTOO_DEVELOPER="graaff"
9
GENTOO_PATCHNAME="gentoo-apache-2.4.57-r2"
10
11
# IUSE/USE_EXPAND magic
12
IUSE_MPMS_FORK="prefork"
13
IUSE_MPMS_THREAD="event worker"
14
15
# << obsolete modules:
16
# authn_default authz_default mem_cache
17
# mem_cache is replaced by cache_disk
18
# ?? buggy modules
19
# proxy_scgi: startup error: undefined symbol "ap_proxy_release_connection", no fix found
20
# >> added modules for reason:
21
# compat: compatibility with 2.2 access control
22
# authz_host: new module for access control
23
# authn_core: functionality provided by authn_alias in previous versions
24
# authz_core: new module, provides core authorization capabilities
25
# cache_disk: replacement for mem_cache
26
# lbmethod_byrequests: Split off from mod_proxy_balancer in 2.3
27
# lbmethod_bytraffic: Split off from mod_proxy_balancer in 2.3
28
# lbmethod_bybusyness: Split off from mod_proxy_balancer in 2.3
29
# lbmethod_heartbeat: Split off from mod_proxy_balancer in 2.3
30
# slotmem_shm: Slot-based shared memory provider (for lbmethod_byrequests).
31
# socache_shmcb: shared object cache provider. Default config with ssl needs it
32
# unixd: fixes startup error: Invalid command 'User'
33
IUSE_MODULES="access_compat actions alias allowmethods asis auth_basic auth_digest auth_form
34
authn_anon authn_core authn_dbd authn_dbm authn_file authn_socache authz_core
35
authz_dbd authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex
36
brotli cache cache_disk cache_socache cern_meta charset_lite cgi cgid dav dav_fs dav_lock
37
dbd deflate dir dumpio env expires ext_filter file_cache filter headers http2
38
ident imagemap include info lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness
39
lbmethod_heartbeat log_config log_forensic logio lua macro md mime mime_magic negotiation
40
proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_hcheck proxy_html proxy_http proxy_scgi
41
proxy_http2 proxy_fcgi proxy_uwsgi proxy_wstunnel rewrite ratelimit remoteip reqtimeout
42
session session_cookie session_crypto session_dbd setenvif slotmem_shm socache_memcache
43
socache_shmcb speling status substitute systemd tls unique_id userdir usertrack
44
unixd version vhost_alias watchdog xml2enc"
45
# The following are also in the source as of this version, but are not available
46
# for user selection:
47
# bucketeer case_filter case_filter_in echo http isapi optional_fn_export
48
# optional_fn_import optional_hook_export optional_hook_import
49
50
# inter-module dependencies
51
# TODO: this may still be incomplete
52
MODULE_DEPENDS="
53
	auth_form:session
54
	brotli:filter
55
	dav_fs:dav
56
	dav_lock:dav
57
	deflate:filter
58
	cache_disk:cache
59
	ext_filter:filter
60
	file_cache:cache
61
	lbmethod_byrequests:proxy_balancer
62
	lbmethod_byrequests:slotmem_shm
63
	lbmethod_bytraffic:proxy_balancer
64
	lbmethod_bybusyness:proxy_balancer
65
	lbmethod_heartbeat:proxy_balancer
66
	log_forensic:log_config
67
	logio:log_config
68
	cache_disk:cache
69
	cache_socache:cache
70
	md:watchdog
71
	mime_magic:mime
72
	proxy_ajp:proxy
73
	proxy_balancer:proxy
74
	proxy_balancer:slotmem_shm
75
	proxy_connect:proxy
76
	proxy_ftp:proxy
77
	proxy_hcheck:proxy
78
	proxy_hcheck:watchdog
79
	proxy_html:proxy
80
	proxy_html:xml2enc
81
	proxy_http:proxy
82
	proxy_http2:proxy
83
	proxy_scgi:proxy
84
	proxy_uwsgi:proxy
85
	proxy_fcgi:proxy
86
	proxy_wstunnel:proxy
87
	session_cookie:session
88
	session_dbd:dbd
89
	session_dbd:session
90
	socache_memcache:cache
91
	substitute:filter
92
"
93
94
# module<->define mappings
95
MODULE_DEFINES="
96
	auth_digest:AUTH_DIGEST
97
	authnz_ldap:AUTHNZ_LDAP
98
	cache:CACHE
99
	cache_disk:CACHE
100
	cache_socache:CACHE
101
	dav:DAV
102
	dav_fs:DAV
103
	dav_lock:DAV
104
	file_cache:CACHE
105
	http2:HTTP2
106
	info:INFO
107
	ldap:LDAP
108
	lua:LUA
109
	md:SSL
110
	proxy:PROXY
111
	proxy_ajp:PROXY
112
	proxy_balancer:PROXY
113
	proxy_connect:PROXY
114
	proxy_ftp:PROXY
115
	proxy_html:PROXY
116
	proxy_http:PROXY
117
	proxy_hcheck:PROXY
118
	proxy_fcgi:PROXY
119
	proxy_scgi:PROXY
120
	proxy_wstunnel:PROXY
121
	socache_shmcb:SSL
122
	socache_memcache:CACHE
123
	ssl:SSL
124
	status:STATUS
125
	suexec:SUEXEC
126
	systemd:SYSTEMD
127
	userdir:USERDIR
128
"
129
130
# critical modules for the default config
131
MODULE_CRITICAL="
132
	authn_core
133
	authz_core
134
	authz_host
135
	dir
136
	mime
137
	unixd
138
"
139
inherit apache-2 systemd tmpfiles toolchain-funcs
140
141
DESCRIPTION="The Apache Web Server"
142
HOMEPAGE="https://httpd.apache.org/"
143
144
# some helper scripts are Apache-1.1, thus both are here
145
LICENSE="Apache-2.0 Apache-1.1"
146
SLOT="2"
147
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x64-macos ~x64-solaris"
148
149
PATCHES=(
150
	"${FILESDIR}"/${PN}-2.4.54-no-which.patch # bug #844868
151
	"${FILESDIR}"/${PN}-2.4.54-libtool.patch # bug #858836
152
	"${FILESDIR}"/${P}-rustls-ffi-0.10.0.patch # bug #906523
153
)
154
155
pkg_setup() {
156
	# dependent critical modules which are not allowed in global scope due
157
	# to USE flag conditionals (bug #499260)
158
	use ssl && MODULE_CRITICAL+=" socache_shmcb"
159
	use doc && MODULE_CRITICAL+=" alias negotiation setenvif"
160
	apache-2_pkg_setup
161
}
162
163
src_configure() {
164
	# Brain dead check.
165
	tc-is-cross-compiler && export ap_cv_void_ptr_lt_long="no"
166
167
	apache-2_src_configure
168
}
169
170
src_compile() {
171
	if tc-is-cross-compiler ; then
172
		# This header is the same across targets, so use the build compiler.
173
		pushd server >/dev/null
174
		emake gen_test_char
175
		tc-export_build_env BUILD_CC
176
		${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_CPPFLAGS} ${BUILD_LDFLAGS} \
177
			gen_test_char.c -o gen_test_char $(apr-1-config --includes) || die
178
		popd >/dev/null
179
	fi
180
181
	default
182
}
183
184
src_install() {
185
	apache-2_src_install
186
	local i
187
	local apache_tools_prune_list=(
188
		/usr/bin/{htdigest,logresolve,htpasswd,htdbm,ab,httxt2dbm}
189
		/usr/sbin/{checkgid,fcgistarter,htcacheclean,rotatelogs}
190
		/usr/share/man/man1/{logresolve.1,htdbm.1,htdigest.1,htpasswd.1,dbmmanage.1,ab.1}
191
		/usr/share/man/man8/{rotatelogs.8,htcacheclean.8}
192
	)
193
	for i in ${apache_tools_prune_list[@]} ; do
194
		rm "${ED}"/${i} || die "Failed to prune apache-tools bits"
195
	done
196
197
	# install apxs in /usr/bin (bug #502384) and put a symlink into the
198
	# old location until all ebuilds and eclasses have been modified to
199
	# use the new location.
200
	dobin support/apxs
201
	use split-usr && dosym ../bin/apxs /usr/sbin/apxs
202
203
	# Note: wait for mod_systemd to be included in some forthcoming release,
204
	# Then apache2.4.service can be used and systemd support controlled
205
	# through --enable-systemd
206
	systemd_newunit "${FILESDIR}/apache2.4-hardened.service" "apache2.service"
207
	dotmpfiles "${FILESDIR}/apache.conf"
208
	#insinto /etc/apache2/modules.d
209
	#doins "${FILESDIR}/00_systemd.conf"
210
211
	# Install http2 module config
212
	insinto /etc/apache2/modules.d
213
	doins "${FILESDIR}"/41_mod_http2.conf
214
215
	# Fix path to apache libdir
216
	sed "s|@LIBDIR@|$(get_libdir)|" -i "${ED}"/usr/sbin/apache2ctl || die
217
}
218
219
pkg_postinst() {
220
	apache-2_pkg_postinst || die "apache-2_pkg_postinst failed"
221
222
	tmpfiles_process apache.conf #662544
223
224
	# warnings that default config might not work out of the box
225
	local mod cmod
226
	for mod in ${MODULE_CRITICAL} ; do
227
		if ! use "apache2_modules_${mod}"; then
228
			echo
229
			ewarn "Warning: Critical module not installed!"
230
			ewarn "Modules 'authn_core', 'authz_core' and 'unixd'"
231
			ewarn "are highly recomended but might not be in the base profile yet."
232
			ewarn "Default config for ssl needs module 'socache_shmcb'."
233
			ewarn "Enabling the following flags is highly recommended:"
234
			for cmod in ${MODULE_CRITICAL} ; do
235
				use "apache2_modules_${cmod}" || \
236
					ewarn "+ apache2_modules_${cmod}"
237
			done
238
			echo
239
			break
240
		fi
241
	done
242
	# warning for proxy_balancer and missing load balancing scheduler
243
	if use apache2_modules_proxy_balancer; then
244
		local lbset=
245
		for mod in lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat; do
246
			if use "apache2_modules_${mod}"; then
247
				lbset=1 && break
248
			fi
249
		done
250
		if [[ ! ${lbset} ]] ; then
251
			echo
252
			ewarn "Info: Missing load balancing scheduler algorithm module"
253
			ewarn "(They were split off from proxy_balancer in 2.3)"
254
			ewarn "In order to get the ability of load balancing, at least"
255
			ewarn "one of these modules has to be present:"
256
			ewarn "lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat"
257
			echo
258
		fi
259
	fi
260
}
(-)a/www-servers/apache/apache-2.4.57-r3.ebuild (-254 lines)
Lines 1-254 Link Here
1
# Copyright 1999-2023 Gentoo Authors
2
# Distributed under the terms of the GNU General Public License v2
3
4
EAPI=7
5
6
# latest gentoo apache files
7
GENTOO_PATCHSTAMP="20230903"
8
GENTOO_DEVELOPER="graaff"
9
GENTOO_PATCHNAME="gentoo-apache-2.4.57-r3"
10
11
# IUSE/USE_EXPAND magic
12
IUSE_MPMS_FORK="prefork"
13
IUSE_MPMS_THREAD="event worker"
14
15
# << obsolete modules:
16
# authn_default authz_default mem_cache
17
# mem_cache is replaced by cache_disk
18
# ?? buggy modules
19
# proxy_scgi: startup error: undefined symbol "ap_proxy_release_connection", no fix found
20
# >> added modules for reason:
21
# compat: compatibility with 2.2 access control
22
# authz_host: new module for access control
23
# authn_core: functionality provided by authn_alias in previous versions
24
# authz_core: new module, provides core authorization capabilities
25
# cache_disk: replacement for mem_cache
26
# lbmethod_byrequests: Split off from mod_proxy_balancer in 2.3
27
# lbmethod_bytraffic: Split off from mod_proxy_balancer in 2.3
28
# lbmethod_bybusyness: Split off from mod_proxy_balancer in 2.3
29
# lbmethod_heartbeat: Split off from mod_proxy_balancer in 2.3
30
# slotmem_shm: Slot-based shared memory provider (for lbmethod_byrequests).
31
# socache_shmcb: shared object cache provider. Default config with ssl needs it
32
# unixd: fixes startup error: Invalid command 'User'
33
IUSE_MODULES="access_compat actions alias allowmethods asis auth_basic auth_digest auth_form
34
authn_anon authn_core authn_dbd authn_dbm authn_file authn_socache authz_core
35
authz_dbd authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex
36
brotli cache cache_disk cache_socache cern_meta charset_lite cgi cgid dav dav_fs dav_lock
37
dbd deflate dir dumpio env expires ext_filter file_cache filter headers http2
38
ident imagemap include info lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness
39
lbmethod_heartbeat log_config log_forensic logio lua macro md mime mime_magic negotiation
40
proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_hcheck proxy_html proxy_http proxy_scgi
41
proxy_http2 proxy_fcgi proxy_uwsgi proxy_wstunnel rewrite ratelimit remoteip reqtimeout
42
session session_cookie session_crypto session_dbd setenvif slotmem_shm socache_memcache
43
socache_shmcb speling status substitute systemd tls unique_id userdir usertrack
44
unixd version vhost_alias watchdog xml2enc"
45
# The following are also in the source as of this version, but are not available
46
# for user selection:
47
# bucketeer case_filter case_filter_in echo http isapi optional_fn_export
48
# optional_fn_import optional_hook_export optional_hook_import
49
50
# inter-module dependencies
51
# TODO: this may still be incomplete
52
MODULE_DEPENDS="
53
	auth_form:session
54
	brotli:filter
55
	dav_fs:dav
56
	dav_lock:dav
57
	deflate:filter
58
	cache_disk:cache
59
	ext_filter:filter
60
	file_cache:cache
61
	lbmethod_byrequests:proxy_balancer
62
	lbmethod_byrequests:slotmem_shm
63
	lbmethod_bytraffic:proxy_balancer
64
	lbmethod_bybusyness:proxy_balancer
65
	lbmethod_heartbeat:proxy_balancer
66
	log_forensic:log_config
67
	logio:log_config
68
	cache_disk:cache
69
	cache_socache:cache
70
	md:watchdog
71
	mime_magic:mime
72
	proxy_ajp:proxy
73
	proxy_balancer:proxy
74
	proxy_balancer:slotmem_shm
75
	proxy_connect:proxy
76
	proxy_ftp:proxy
77
	proxy_hcheck:proxy
78
	proxy_hcheck:watchdog
79
	proxy_html:proxy
80
	proxy_html:xml2enc
81
	proxy_http:proxy
82
	proxy_http2:proxy
83
	proxy_scgi:proxy
84
	proxy_uwsgi:proxy
85
	proxy_fcgi:proxy
86
	proxy_wstunnel:proxy
87
	session_cookie:session
88
	session_dbd:dbd
89
	session_dbd:session
90
	socache_memcache:cache
91
	substitute:filter
92
"
93
94
# module<->define mappings
95
MODULE_DEFINES="
96
	auth_digest:AUTH_DIGEST
97
	authnz_ldap:AUTHNZ_LDAP
98
	cache:CACHE
99
	cache_disk:CACHE
100
	cache_socache:CACHE
101
	dav:DAV
102
	dav_fs:DAV
103
	dav_lock:DAV
104
	file_cache:CACHE
105
	http2:HTTP2
106
	info:INFO
107
	ldap:LDAP
108
	lua:LUA
109
	md:SSL
110
	proxy:PROXY
111
	proxy_ajp:PROXY
112
	proxy_balancer:PROXY
113
	proxy_connect:PROXY
114
	proxy_ftp:PROXY
115
	proxy_html:PROXY
116
	proxy_http:PROXY
117
	proxy_hcheck:PROXY
118
	proxy_fcgi:PROXY
119
	proxy_scgi:PROXY
120
	proxy_wstunnel:PROXY
121
	socache_shmcb:SSL
122
	socache_memcache:CACHE
123
	ssl:SSL
124
	status:STATUS
125
	suexec:SUEXEC
126
	systemd:SYSTEMD
127
	userdir:USERDIR
128
"
129
130
# critical modules for the default config
131
MODULE_CRITICAL="
132
	authn_core
133
	authz_core
134
	authz_host
135
	dir
136
	mime
137
	unixd
138
"
139
inherit apache-2 systemd tmpfiles toolchain-funcs
140
141
DESCRIPTION="The Apache Web Server"
142
HOMEPAGE="https://httpd.apache.org/"
143
144
# some helper scripts are Apache-1.1, thus both are here
145
LICENSE="Apache-2.0 Apache-1.1"
146
SLOT="2"
147
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x64-macos ~x64-solaris"
148
149
pkg_setup() {
150
	# dependent critical modules which are not allowed in global scope due
151
	# to USE flag conditionals (bug #499260)
152
	use ssl && MODULE_CRITICAL+=" socache_shmcb"
153
	use doc && MODULE_CRITICAL+=" alias negotiation setenvif"
154
	apache-2_pkg_setup
155
}
156
157
src_configure() {
158
	# Brain dead check.
159
	tc-is-cross-compiler && export ap_cv_void_ptr_lt_long="no"
160
161
	apache-2_src_configure
162
}
163
164
src_compile() {
165
	if tc-is-cross-compiler ; then
166
		# This header is the same across targets, so use the build compiler.
167
		pushd server >/dev/null
168
		emake gen_test_char
169
		tc-export_build_env BUILD_CC
170
		${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_CPPFLAGS} ${BUILD_LDFLAGS} \
171
			gen_test_char.c -o gen_test_char $(apr-1-config --includes) || die
172
		popd >/dev/null
173
	fi
174
175
	default
176
}
177
178
src_install() {
179
	apache-2_src_install
180
	local i
181
	local apache_tools_prune_list=(
182
		/usr/bin/{htdigest,logresolve,htpasswd,htdbm,ab,httxt2dbm}
183
		/usr/sbin/{checkgid,fcgistarter,htcacheclean,rotatelogs}
184
		/usr/share/man/man1/{logresolve.1,htdbm.1,htdigest.1,htpasswd.1,dbmmanage.1,ab.1}
185
		/usr/share/man/man8/{rotatelogs.8,htcacheclean.8}
186
	)
187
	for i in ${apache_tools_prune_list[@]} ; do
188
		rm "${ED}"/${i} || die "Failed to prune apache-tools bits"
189
	done
190
191
	# install apxs in /usr/bin (bug #502384) and put a symlink into the
192
	# old location until all ebuilds and eclasses have been modified to
193
	# use the new location.
194
	dobin support/apxs
195
	use split-usr && dosym ../bin/apxs /usr/sbin/apxs
196
197
	# Note: wait for mod_systemd to be included in some forthcoming release,
198
	# Then apache2.4.service can be used and systemd support controlled
199
	# through --enable-systemd
200
	systemd_newunit "${FILESDIR}/apache2.4-hardened.service" "apache2.service"
201
	dotmpfiles "${FILESDIR}/apache.conf"
202
	#insinto /etc/apache2/modules.d
203
	#doins "${FILESDIR}/00_systemd.conf"
204
205
	# Install http2 module config
206
	insinto /etc/apache2/modules.d
207
	doins "${FILESDIR}"/41_mod_http2.conf
208
209
	# Fix path to apache libdir
210
	sed "s|@LIBDIR@|$(get_libdir)|" -i "${ED}"/usr/sbin/apache2ctl || die
211
}
212
213
pkg_postinst() {
214
	apache-2_pkg_postinst || die "apache-2_pkg_postinst failed"
215
216
	tmpfiles_process apache.conf #662544
217
218
	# warnings that default config might not work out of the box
219
	local mod cmod
220
	for mod in ${MODULE_CRITICAL} ; do
221
		if ! use "apache2_modules_${mod}"; then
222
			echo
223
			ewarn "Warning: Critical module not installed!"
224
			ewarn "Modules 'authn_core', 'authz_core' and 'unixd'"
225
			ewarn "are highly recomended but might not be in the base profile yet."
226
			ewarn "Default config for ssl needs module 'socache_shmcb'."
227
			ewarn "Enabling the following flags is highly recommended:"
228
			for cmod in ${MODULE_CRITICAL} ; do
229
				use "apache2_modules_${cmod}" || \
230
					ewarn "+ apache2_modules_${cmod}"
231
			done
232
			echo
233
			break
234
		fi
235
	done
236
	# warning for proxy_balancer and missing load balancing scheduler
237
	if use apache2_modules_proxy_balancer; then
238
		local lbset=
239
		for mod in lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat; do
240
			if use "apache2_modules_${mod}"; then
241
				lbset=1 && break
242
			fi
243
		done
244
		if [[ ! ${lbset} ]] ; then
245
			echo
246
			ewarn "Info: Missing load balancing scheduler algorithm module"
247
			ewarn "(They were split off from proxy_balancer in 2.3)"
248
			ewarn "In order to get the ability of load balancing, at least"
249
			ewarn "one of these modules has to be present:"
250
			ewarn "lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat"
251
			echo
252
		fi
253
	fi
254
}
(-)a/www-servers/apache/apache-2.4.57-r4.ebuild (-258 lines)
Lines 1-256 Link Here
1
# Copyright 1999-2023 Gentoo Authors
2
# Distributed under the terms of the GNU General Public License v2
3
4
EAPI=7
5
6
# latest gentoo apache files
7
GENTOO_PATCHSTAMP="20230903"
8
GENTOO_DEVELOPER="graaff"
9
GENTOO_PATCHNAME="gentoo-apache-2.4.57-r3"
10
11
# IUSE/USE_EXPAND magic
12
IUSE_MPMS_FORK="prefork"
13
IUSE_MPMS_THREAD="event worker"
14
15
# << obsolete modules:
16
# authn_default authz_default mem_cache
17
# mem_cache is replaced by cache_disk
18
# ?? buggy modules
19
# proxy_scgi: startup error: undefined symbol "ap_proxy_release_connection", no fix found
20
# >> added modules for reason:
21
# compat: compatibility with 2.2 access control
22
# authz_host: new module for access control
23
# authn_core: functionality provided by authn_alias in previous versions
24
# authz_core: new module, provides core authorization capabilities
25
# cache_disk: replacement for mem_cache
26
# lbmethod_byrequests: Split off from mod_proxy_balancer in 2.3
27
# lbmethod_bytraffic: Split off from mod_proxy_balancer in 2.3
28
# lbmethod_bybusyness: Split off from mod_proxy_balancer in 2.3
29
# lbmethod_heartbeat: Split off from mod_proxy_balancer in 2.3
30
# slotmem_shm: Slot-based shared memory provider (for lbmethod_byrequests).
31
# socache_shmcb: shared object cache provider. Default config with ssl needs it
32
# unixd: fixes startup error: Invalid command 'User'
33
IUSE_MODULES="access_compat actions alias allowmethods asis auth_basic auth_digest auth_form
34
authn_anon authn_core authn_dbd authn_dbm authn_file authn_socache authz_core
35
authz_dbd authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex
36
brotli cache cache_disk cache_socache cern_meta charset_lite cgi cgid dav dav_fs dav_lock
37
dbd deflate dir dumpio env expires ext_filter file_cache filter headers http2
38
ident imagemap include info lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness
39
lbmethod_heartbeat log_config log_forensic logio lua macro md mime mime_magic negotiation
40
proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_hcheck proxy_html proxy_http proxy_scgi
41
proxy_http2 proxy_fcgi proxy_uwsgi proxy_wstunnel rewrite ratelimit remoteip reqtimeout
42
session session_cookie session_crypto session_dbd setenvif slotmem_shm socache_memcache
43
socache_shmcb speling status substitute systemd tls unique_id userdir usertrack
44
unixd version vhost_alias watchdog xml2enc"
45
# The following are also in the source as of this version, but are not available
46
# for user selection:
47
# bucketeer case_filter case_filter_in echo http isapi optional_fn_export
48
# optional_fn_import optional_hook_export optional_hook_import
49
50
# inter-module dependencies
51
# TODO: this may still be incomplete
52
MODULE_DEPENDS="
53
	auth_form:session
54
	brotli:filter
55
	dav_fs:dav
56
	dav_lock:dav
57
	deflate:filter
58
	cache_disk:cache
59
	ext_filter:filter
60
	file_cache:cache
61
	lbmethod_byrequests:proxy_balancer
62
	lbmethod_byrequests:slotmem_shm
63
	lbmethod_bytraffic:proxy_balancer
64
	lbmethod_bybusyness:proxy_balancer
65
	lbmethod_heartbeat:proxy_balancer
66
	log_forensic:log_config
67
	logio:log_config
68
	cache_disk:cache
69
	cache_socache:cache
70
	md:watchdog
71
	mime_magic:mime
72
	proxy_ajp:proxy
73
	proxy_balancer:proxy
74
	proxy_balancer:slotmem_shm
75
	proxy_connect:proxy
76
	proxy_ftp:proxy
77
	proxy_hcheck:proxy
78
	proxy_hcheck:watchdog
79
	proxy_html:proxy
80
	proxy_html:xml2enc
81
	proxy_http:proxy
82
	proxy_http2:proxy
83
	proxy_scgi:proxy
84
	proxy_uwsgi:proxy
85
	proxy_fcgi:proxy
86
	proxy_wstunnel:proxy
87
	session_cookie:session
88
	session_dbd:dbd
89
	session_dbd:session
90
	socache_memcache:cache
91
	substitute:filter
92
"
93
94
# module<->define mappings
95
MODULE_DEFINES="
96
	auth_digest:AUTH_DIGEST
97
	authnz_ldap:AUTHNZ_LDAP
98
	cache:CACHE
99
	cache_disk:CACHE
100
	cache_socache:CACHE
101
	dav:DAV
102
	dav_fs:DAV
103
	dav_lock:DAV
104
	file_cache:CACHE
105
	http2:HTTP2
106
	info:INFO
107
	ldap:LDAP
108
	lua:LUA
109
	md:SSL
110
	proxy:PROXY
111
	proxy_ajp:PROXY
112
	proxy_balancer:PROXY
113
	proxy_connect:PROXY
114
	proxy_fcgi:PROXY
115
	proxy_ftp:PROXY
116
	proxy_hcheck:PROXY
117
	proxy_html:PROXY
118
	proxy_http:PROXY
119
	proxy_http2:PROXY
120
	proxy_scgi:PROXY
121
	proxy_uwsgi:PROXY
122
	proxy_wstunnel:PROXY
123
	socache_shmcb:SSL
124
	socache_memcache:CACHE
125
	ssl:SSL
126
	status:STATUS
127
	suexec:SUEXEC
128
	systemd:SYSTEMD
129
	userdir:USERDIR
130
"
131
132
# critical modules for the default config
133
MODULE_CRITICAL="
134
	authn_core
135
	authz_core
136
	authz_host
137
	dir
138
	mime
139
	unixd
140
"
141
inherit apache-2 systemd tmpfiles toolchain-funcs
142
143
DESCRIPTION="The Apache Web Server"
144
HOMEPAGE="https://httpd.apache.org/"
145
146
# some helper scripts are Apache-1.1, thus both are here
147
LICENSE="Apache-2.0 Apache-1.1"
148
SLOT="2"
149
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x64-macos ~x64-solaris"
150
151
pkg_setup() {
152
	# dependent critical modules which are not allowed in global scope due
153
	# to USE flag conditionals (bug #499260)
154
	use ssl && MODULE_CRITICAL+=" socache_shmcb"
155
	use doc && MODULE_CRITICAL+=" alias negotiation setenvif"
156
	apache-2_pkg_setup
157
}
158
159
src_configure() {
160
	# Brain dead check.
161
	tc-is-cross-compiler && export ap_cv_void_ptr_lt_long="no"
162
163
	apache-2_src_configure
164
}
165
166
src_compile() {
167
	if tc-is-cross-compiler ; then
168
		# This header is the same across targets, so use the build compiler.
169
		pushd server >/dev/null
170
		emake gen_test_char
171
		tc-export_build_env BUILD_CC
172
		${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_CPPFLAGS} ${BUILD_LDFLAGS} \
173
			gen_test_char.c -o gen_test_char $(apr-1-config --includes) || die
174
		popd >/dev/null
175
	fi
176
177
	default
178
}
179
180
src_install() {
181
	apache-2_src_install
182
	local i
183
	local apache_tools_prune_list=(
184
		/usr/bin/{htdigest,logresolve,htpasswd,htdbm,ab,httxt2dbm}
185
		/usr/sbin/{checkgid,fcgistarter,htcacheclean,rotatelogs}
186
		/usr/share/man/man1/{logresolve.1,htdbm.1,htdigest.1,htpasswd.1,dbmmanage.1,ab.1}
187
		/usr/share/man/man8/{rotatelogs.8,htcacheclean.8}
188
	)
189
	for i in ${apache_tools_prune_list[@]} ; do
190
		rm "${ED}"/${i} || die "Failed to prune apache-tools bits"
191
	done
192
193
	# install apxs in /usr/bin (bug #502384) and put a symlink into the
194
	# old location until all ebuilds and eclasses have been modified to
195
	# use the new location.
196
	dobin support/apxs
197
	use split-usr && dosym ../bin/apxs /usr/sbin/apxs
198
199
	# Note: wait for mod_systemd to be included in some forthcoming release,
200
	# Then apache2.4.service can be used and systemd support controlled
201
	# through --enable-systemd
202
	systemd_newunit "${FILESDIR}/apache2.4-hardened.service" "apache2.service"
203
	dotmpfiles "${FILESDIR}/apache.conf"
204
	#insinto /etc/apache2/modules.d
205
	#doins "${FILESDIR}/00_systemd.conf"
206
207
	# Install http2 module config
208
	insinto /etc/apache2/modules.d
209
	doins "${FILESDIR}"/41_mod_http2.conf
210
211
	# Fix path to apache libdir
212
	sed "s|@LIBDIR@|$(get_libdir)|" -i "${ED}"/usr/sbin/apache2ctl || die
213
}
214
215
pkg_postinst() {
216
	apache-2_pkg_postinst || die "apache-2_pkg_postinst failed"
217
218
	tmpfiles_process apache.conf #662544
219
220
	# warnings that default config might not work out of the box
221
	local mod cmod
222
	for mod in ${MODULE_CRITICAL} ; do
223
		if ! use "apache2_modules_${mod}"; then
224
			echo
225
			ewarn "Warning: Critical module not installed!"
226
			ewarn "Modules 'authn_core', 'authz_core' and 'unixd'"
227
			ewarn "are highly recomended but might not be in the base profile yet."
228
			ewarn "Default config for ssl needs module 'socache_shmcb'."
229
			ewarn "Enabling the following flags is highly recommended:"
230
			for cmod in ${MODULE_CRITICAL} ; do
231
				use "apache2_modules_${cmod}" || \
232
					ewarn "+ apache2_modules_${cmod}"
233
			done
234
			echo
235
			break
236
		fi
237
	done
238
	# warning for proxy_balancer and missing load balancing scheduler
239
	if use apache2_modules_proxy_balancer; then
240
		local lbset=
241
		for mod in lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat; do
242
			if use "apache2_modules_${mod}"; then
243
				lbset=1 && break
244
			fi
245
		done
246
		if [[ ! ${lbset} ]] ; then
247
			echo
248
			ewarn "Info: Missing load balancing scheduler algorithm module"
249
			ewarn "(They were split off from proxy_balancer in 2.3)"
250
			ewarn "In order to get the ability of load balancing, at least"
251
			ewarn "one of these modules has to be present:"
252
			ewarn "lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat"
253
			echo
254
		fi
255
	fi
256
}
257
- 
258
--
259
eclass/apache-2.eclass                     | 2 +-
0
eclass/apache-2.eclass                     | 2 +-
260
www-servers/apache/apache-2.4.57-r5.ebuild | 3 +++
1
www-servers/apache/apache-2.4.57-r5.ebuild | 3 +++
261
www-servers/apache/apache-2.4.57.ebuild    | 3 +++
2
www-servers/apache/apache-2.4.57.ebuild    | 3 +++
262
www-servers/apache/apache-2.4.58-r1.ebuild | 3 +++
3
www-servers/apache/apache-2.4.58-r1.ebuild | 3 +++
263
www-servers/apache/apache-2.4.58.ebuild    | 3 +++
4
www-servers/apache/apache-2.4.58.ebuild    | 3 +++
264
5 files changed, 13 insertions(+), 1 deletion(-)
5
5 files changed, 13 insertions(+), 1 deletion(-)
(-)a/eclass/apache-2.eclass (-1 / +1 lines)
Lines 1-716 Link Here
1
# Copyright 1999-2023 Gentoo Authors
1
# Copyright 1999-2023 Gentoo Authors
2
# Distributed under the terms of the GNU General Public License v2
2
# Distributed under the terms of the GNU General Public License v2
3
3
4
# @ECLASS: apache-2.eclass
4
# @ECLASS: apache-2.eclass
5
# @MAINTAINER:
5
# @MAINTAINER:
6
# apache-bugs@gentoo.org
6
# apache-bugs@gentoo.org
7
# @AUTHOR:
7
# @AUTHOR:
8
# polynomial-c@gentoo.org
8
# polynomial-c@gentoo.org
9
# @SUPPORTED_EAPIS: 7
9
# @SUPPORTED_EAPIS: 7
10
# @BLURB: Provides a common set of functions for apache-2.x ebuilds
10
# @BLURB: Provides a common set of functions for apache-2.x ebuilds
11
# @DESCRIPTION:
11
# @DESCRIPTION:
12
# This eclass handles apache-2.x ebuild functions such as LoadModule generation
12
# This eclass handles apache-2.x ebuild functions such as LoadModule generation
13
# and inter-module dependency checking.
13
# and inter-module dependency checking.
14
14
15
LUA_COMPAT=( lua5-{1..4} )
15
LUA_COMPAT=( lua5-{1..4} )
16
inherit autotools flag-o-matic lua-single multilib ssl-cert toolchain-funcs
16
inherit autotools flag-o-matic lua-single multilib ssl-cert toolchain-funcs
17
17
18
[[ ${CATEGORY}/${PN} != www-servers/apache ]] \
18
[[ ${CATEGORY}/${PN} != www-servers/apache ]] \
19
	&& die "Do not use this eclass with anything else than www-servers/apache ebuilds!"
19
	&& die "Do not use this eclass with anything else than www-servers/apache ebuilds!"
20
20
21
case ${EAPI} in
21
case ${EAPI} in
22
	7) ;;
22
	7) ;;
23
	*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
23
	*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
24
esac
24
esac
25
25
26
# settings which are version specific go in here:
26
# settings which are version specific go in here:
27
case $(ver_cut 1-2) in
27
case $(ver_cut 1-2) in
28
	2.4)
28
	2.4)
29
		DEFAULT_MPM_THREADED="event" #509922
29
		DEFAULT_MPM_THREADED="event" #509922
30
	;;
30
	;;
31
	*)
31
	*)
32
		die "Unknown MAJOR.MINOR apache version."
32
		die "Unknown MAJOR.MINOR apache version."
33
	;;
33
	;;
34
esac
34
esac
35
35
36
# ==============================================================================
36
# ==============================================================================
37
# INTERNAL VARIABLES
37
# INTERNAL VARIABLES
38
# ==============================================================================
38
# ==============================================================================
39
39
40
# @ECLASS_VARIABLE: GENTOO_PATCHNAME
40
# @ECLASS_VARIABLE: GENTOO_PATCHNAME
41
# @DESCRIPTION:
41
# @DESCRIPTION:
42
# This internal variable contains the prefix for the patch tarball.
42
# This internal variable contains the prefix for the patch tarball.
43
# Defaults to the full name and version (including revision) of the package.
43
# Defaults to the full name and version (including revision) of the package.
44
# If you want to override this in an ebuild, use:
44
# If you want to override this in an ebuild, use:
45
# ORIG_PR="(revision of Gentoo stuff you want)"
45
# ORIG_PR="(revision of Gentoo stuff you want)"
46
# GENTOO_PATCHNAME="gentoo-${PN}-${PV}${ORIG_PR:+-${ORIG_PR}}"
46
# GENTOO_PATCHNAME="gentoo-${PN}-${PV}${ORIG_PR:+-${ORIG_PR}}"
47
[[ -n "${GENTOO_PATCHNAME}" ]] || GENTOO_PATCHNAME="gentoo-${PF}"
47
[[ -n "${GENTOO_PATCHNAME}" ]] || GENTOO_PATCHNAME="gentoo-${PF}"
48
48
49
# @ECLASS_VARIABLE: GENTOO_PATCHDIR
49
# @ECLASS_VARIABLE: GENTOO_PATCHDIR
50
# @DESCRIPTION:
50
# @DESCRIPTION:
51
# This internal variable contains the working directory where patches and config
51
# This internal variable contains the working directory where patches and config
52
# files are located.
52
# files are located.
53
# Defaults to the patchset name appended to the working directory.
53
# Defaults to the patchset name appended to the working directory.
54
[[ -n "${GENTOO_PATCHDIR}" ]] || GENTOO_PATCHDIR="${WORKDIR}/${GENTOO_PATCHNAME}"
54
[[ -n "${GENTOO_PATCHDIR}" ]] || GENTOO_PATCHDIR="${WORKDIR}/${GENTOO_PATCHNAME}"
55
55
56
# @VARIABLE: GENTOO_DEVELOPER
56
# @VARIABLE: GENTOO_DEVELOPER
57
# @DESCRIPTION:
57
# @DESCRIPTION:
58
# This variable needs to be set in the ebuild and contains the name of the
58
# This variable needs to be set in the ebuild and contains the name of the
59
# gentoo developer who created the patch tarball
59
# gentoo developer who created the patch tarball
60
60
61
# @VARIABLE: GENTOO_PATCHSTAMP
61
# @VARIABLE: GENTOO_PATCHSTAMP
62
# @DESCRIPTION:
62
# @DESCRIPTION:
63
# This variable needs to be set in the ebuild and contains the date the patch
63
# This variable needs to be set in the ebuild and contains the date the patch
64
# tarball was created at in YYYYMMDD format
64
# tarball was created at in YYYYMMDD format
65
65
66
# @VARIABLE: GENTOO_PATCH_A
66
# @VARIABLE: GENTOO_PATCH_A
67
# @DESCRIPTION:
67
# @DESCRIPTION:
68
# This variable should contain the entire filename of patch tarball.
68
# This variable should contain the entire filename of patch tarball.
69
# Defaults to the name of the patchset, with a datestamp.
69
# Defaults to the name of the patchset, with a datestamp.
70
[[ -n "${GENTOO_PATCH_A}" ]] || GENTOO_PATCH_A="${GENTOO_PATCHNAME}-${GENTOO_PATCHSTAMP}.tar.bz2"
70
[[ -n "${GENTOO_PATCH_A}" ]] || GENTOO_PATCH_A="${GENTOO_PATCHNAME}-${GENTOO_PATCHSTAMP}.tar.bz2"
71
71
72
SRC_URI="mirror://apache/httpd/httpd-${PV}.tar.bz2
72
SRC_URI="mirror://apache/httpd/httpd-${PV}.tar.bz2
73
	https://dev.gentoo.org/~${GENTOO_DEVELOPER}/dist/apache/${GENTOO_PATCH_A}"
73
	https://dev.gentoo.org/~${GENTOO_DEVELOPER}/dist/apache/${GENTOO_PATCH_A}"
74
74
75
# @VARIABLE: IUSE_MPMS_FORK
75
# @VARIABLE: IUSE_MPMS_FORK
76
# @DESCRIPTION:
76
# @DESCRIPTION:
77
# This variable needs to be set in the ebuild and contains a list of forking
77
# This variable needs to be set in the ebuild and contains a list of forking
78
# (i.e.  non-threaded) MPMs
78
# (i.e.  non-threaded) MPMs
79
79
80
# @VARIABLE: IUSE_MPMS_THREAD
80
# @VARIABLE: IUSE_MPMS_THREAD
81
# @DESCRIPTION:
81
# @DESCRIPTION:
82
# This variable needs to be set in the ebuild and contains a list of threaded
82
# This variable needs to be set in the ebuild and contains a list of threaded
83
# MPMs
83
# MPMs
84
84
85
# @VARIABLE: IUSE_MODULES
85
# @VARIABLE: IUSE_MODULES
86
# @DESCRIPTION:
86
# @DESCRIPTION:
87
# This variable needs to be set in the ebuild and contains a list of available
87
# This variable needs to be set in the ebuild and contains a list of available
88
# built-in modules
88
# built-in modules
89
89
90
IUSE_MPMS="${IUSE_MPMS_FORK} ${IUSE_MPMS_THREAD}"
90
IUSE_MPMS="${IUSE_MPMS_FORK} ${IUSE_MPMS_THREAD}"
91
IUSE="${IUSE} debug doc gdbm ldap selinux ssl static suexec +suexec-caps suexec-syslog split-usr threads"
91
IUSE="${IUSE} debug doc gdbm ldap selinux ssl static suexec +suexec-caps suexec-syslog threads"
92
92
93
for module in ${IUSE_MODULES} ; do
93
for module in ${IUSE_MODULES} ; do
94
	case ${module} in
94
	case ${module} in
95
		# Enable http2 by default (bug #563452)
95
		# Enable http2 by default (bug #563452)
96
		http2)
96
		http2)
97
			IUSE+=" +apache2_modules_${module}"
97
			IUSE+=" +apache2_modules_${module}"
98
		;;
98
		;;
99
		systemd)
99
		systemd)
100
			IUSE+=" systemd"
100
			IUSE+=" systemd"
101
		;;
101
		;;
102
		*)
102
		*)
103
			IUSE+=" apache2_modules_${module}"
103
			IUSE+=" apache2_modules_${module}"
104
		;;
104
		;;
105
	esac
105
	esac
106
done
106
done
107
107
108
_apache2_set_mpms() {
108
_apache2_set_mpms() {
109
	local mpm
109
	local mpm
110
	local ompm
110
	local ompm
111
111
112
	for mpm in ${IUSE_MPMS} ; do
112
	for mpm in ${IUSE_MPMS} ; do
113
		IUSE="${IUSE} apache2_mpms_${mpm}"
113
		IUSE="${IUSE} apache2_mpms_${mpm}"
114
114
115
		REQUIRED_USE+=" apache2_mpms_${mpm}? ("
115
		REQUIRED_USE+=" apache2_mpms_${mpm}? ("
116
		for ompm in ${IUSE_MPMS} ; do
116
		for ompm in ${IUSE_MPMS} ; do
117
			if [[ "${mpm}" != "${ompm}" ]] ; then
117
			if [[ "${mpm}" != "${ompm}" ]] ; then
118
				REQUIRED_USE+=" !apache2_mpms_${ompm}"
118
				REQUIRED_USE+=" !apache2_mpms_${ompm}"
119
			fi
119
			fi
120
		done
120
		done
121
121
122
		if has ${mpm} ${IUSE_MPMS_FORK} ; then
122
		if has ${mpm} ${IUSE_MPMS_FORK} ; then
123
			REQUIRED_USE+=" !threads"
123
			REQUIRED_USE+=" !threads"
124
		else
124
		else
125
			REQUIRED_USE+=" threads"
125
			REQUIRED_USE+=" threads"
126
		fi
126
		fi
127
		REQUIRED_USE+=" )"
127
		REQUIRED_USE+=" )"
128
	done
128
	done
129
129
130
	REQUIRED_USE+=" apache2_mpms_prefork? ( !apache2_modules_http2 )"
130
	REQUIRED_USE+=" apache2_mpms_prefork? ( !apache2_modules_http2 )"
131
}
131
}
132
_apache2_set_mpms
132
_apache2_set_mpms
133
unset -f _apache2_set_mpms
133
unset -f _apache2_set_mpms
134
134
135
NGHTTP2_VERSION=1.2.1
135
NGHTTP2_VERSION=1.2.1
136
if ver_test ${PV} -ge 2.4.55 ; then
136
if ver_test ${PV} -ge 2.4.55 ; then
137
	NGHTTP2_VERSION=1.50.0
137
	NGHTTP2_VERSION=1.50.0
138
fi
138
fi
139
139
140
# Dependencies
140
# Dependencies
141
RDEPEND="
141
RDEPEND="
142
	acct-group/apache
142
	acct-group/apache
143
	acct-user/apache
143
	acct-user/apache
144
	dev-lang/perl
144
	dev-lang/perl
145
	>=dev-libs/apr-1.5.1:=
145
	>=dev-libs/apr-1.5.1:=
146
	=dev-libs/apr-util-1*:=[gdbm=,ldap?]
146
	=dev-libs/apr-util-1*:=[gdbm=,ldap?]
147
	dev-libs/libpcre2
147
	dev-libs/libpcre2
148
	virtual/libcrypt:=
148
	virtual/libcrypt:=
149
	apache2_modules_brotli? ( >=app-arch/brotli-0.6.0:= )
149
	apache2_modules_brotli? ( >=app-arch/brotli-0.6.0:= )
150
	apache2_modules_deflate? ( sys-libs/zlib )
150
	apache2_modules_deflate? ( sys-libs/zlib )
151
	apache2_modules_http2? (
151
	apache2_modules_http2? (
152
		>=net-libs/nghttp2-${NGHTTP2_VERSION}:=
152
		>=net-libs/nghttp2-${NGHTTP2_VERSION}:=
153
		kernel_linux? ( sys-apps/util-linux )
153
		kernel_linux? ( sys-apps/util-linux )
154
	)
154
	)
155
	apache2_modules_lua? ( ${LUA_DEPS} )
155
	apache2_modules_lua? ( ${LUA_DEPS} )
156
	apache2_modules_md? ( >=dev-libs/jansson-2.10:= )
156
	apache2_modules_md? ( >=dev-libs/jansson-2.10:= )
157
	apache2_modules_mime? ( app-misc/mime-types )
157
	apache2_modules_mime? ( app-misc/mime-types )
158
	apache2_modules_proxy_http2? (
158
	apache2_modules_proxy_http2? (
159
		>=net-libs/nghttp2-${NGHTTP2_VERSION}:=
159
		>=net-libs/nghttp2-${NGHTTP2_VERSION}:=
160
		kernel_linux? ( sys-apps/util-linux )
160
		kernel_linux? ( sys-apps/util-linux )
161
	)
161
	)
162
	apache2_modules_session_crypto? (
162
	apache2_modules_session_crypto? (
163
		dev-libs/apr-util[openssl]
163
		dev-libs/apr-util[openssl]
164
	)
164
	)
165
	apache2_modules_tls? ( >=net-libs/rustls-ffi-0.9.2:= )
165
	apache2_modules_tls? ( >=net-libs/rustls-ffi-0.9.2:= )
166
	gdbm? ( sys-libs/gdbm:= )
166
	gdbm? ( sys-libs/gdbm:= )
167
	ldap? ( net-nds/openldap:= )
167
	ldap? ( net-nds/openldap:= )
168
	selinux? ( sec-policy/selinux-apache )
168
	selinux? ( sec-policy/selinux-apache )
169
	ssl? (
169
	ssl? (
170
		>=dev-libs/openssl-1.0.2:=
170
		>=dev-libs/openssl-1.0.2:=
171
		kernel_linux? ( sys-apps/util-linux )
171
		kernel_linux? ( sys-apps/util-linux )
172
	)
172
	)
173
	systemd? ( sys-apps/systemd )
173
	systemd? ( sys-apps/systemd )
174
"
174
"
175
DEPEND="${RDEPEND}"
175
DEPEND="${RDEPEND}"
176
BDEPEND="
176
BDEPEND="
177
	virtual/pkgconfig
177
	virtual/pkgconfig
178
	suexec? ( suexec-caps? ( sys-libs/libcap ) )
178
	suexec? ( suexec-caps? ( sys-libs/libcap ) )
179
"
179
"
180
PDEPEND="~app-admin/apache-tools-${PV}"
180
PDEPEND="~app-admin/apache-tools-${PV}"
181
181
182
REQUIRED_USE+="
182
REQUIRED_USE+="
183
	apache2_modules_http2? ( ssl )
183
	apache2_modules_http2? ( ssl )
184
	apache2_modules_lua? ( ${LUA_REQUIRED_USE} )
184
	apache2_modules_lua? ( ${LUA_REQUIRED_USE} )
185
	apache2_modules_md? ( ssl )
185
	apache2_modules_md? ( ssl )
186
"
186
"
187
187
188
S="${WORKDIR}/httpd-${PV}"
188
S="${WORKDIR}/httpd-${PV}"
189
189
190
# @VARIABLE: MODULE_DEPENDS
190
# @VARIABLE: MODULE_DEPENDS
191
# @DESCRIPTION:
191
# @DESCRIPTION:
192
# This variable needs to be set in the ebuild and contains a space-separated
192
# This variable needs to be set in the ebuild and contains a space-separated
193
# list of dependency tokens each with a module and the module it depends on
193
# list of dependency tokens each with a module and the module it depends on
194
# separated by a colon
194
# separated by a colon
195
195
196
# now extend REQUIRED_USE to reflect the module dependencies to portage
196
# now extend REQUIRED_USE to reflect the module dependencies to portage
197
_apache2_set_module_depends() {
197
_apache2_set_module_depends() {
198
	local dep
198
	local dep
199
199
200
	for dep in ${MODULE_DEPENDS} ; do
200
	for dep in ${MODULE_DEPENDS} ; do
201
		REQUIRED_USE+=" apache2_modules_${dep%:*}? ( apache2_modules_${dep#*:} )"
201
		REQUIRED_USE+=" apache2_modules_${dep%:*}? ( apache2_modules_${dep#*:} )"
202
	done
202
	done
203
}
203
}
204
_apache2_set_module_depends
204
_apache2_set_module_depends
205
unset -f _apache2_set_module_depends
205
unset -f _apache2_set_module_depends
206
206
207
# ==============================================================================
207
# ==============================================================================
208
# INTERNAL FUNCTIONS
208
# INTERNAL FUNCTIONS
209
# ==============================================================================
209
# ==============================================================================
210
210
211
# @ECLASS_VARIABLE: MY_MPM
211
# @ECLASS_VARIABLE: MY_MPM
212
# @DESCRIPTION:
212
# @DESCRIPTION:
213
# This internal variable contains the selected MPM after a call to setup_mpm()
213
# This internal variable contains the selected MPM after a call to setup_mpm()
214
214
215
# @FUNCTION: setup_mpm
215
# @FUNCTION: setup_mpm
216
# @DESCRIPTION:
216
# @DESCRIPTION:
217
# This internal function makes sure that only one of APACHE2_MPMS was selected
217
# This internal function makes sure that only one of APACHE2_MPMS was selected
218
# or a default based on USE=threads is selected if APACHE2_MPMS is empty
218
# or a default based on USE=threads is selected if APACHE2_MPMS is empty
219
setup_mpm() {
219
setup_mpm() {
220
	MY_MPM=""
220
	MY_MPM=""
221
	for x in ${IUSE_MPMS} ; do
221
	for x in ${IUSE_MPMS} ; do
222
		if use apache2_mpms_${x} ; then
222
		if use apache2_mpms_${x} ; then
223
			# there can at most be one MPM selected because of REQUIRED_USE constraints
223
			# there can at most be one MPM selected because of REQUIRED_USE constraints
224
			MY_MPM=${x}
224
			MY_MPM=${x}
225
			elog
225
			elog
226
			elog "Selected MPM: ${MY_MPM}"
226
			elog "Selected MPM: ${MY_MPM}"
227
			elog
227
			elog
228
			break
228
			break
229
		fi
229
		fi
230
	done
230
	done
231
231
232
	if [[ -z "${MY_MPM}" ]] ; then
232
	if [[ -z "${MY_MPM}" ]] ; then
233
		if use threads ; then
233
		if use threads ; then
234
			MY_MPM=${DEFAULT_MPM_THREADED}
234
			MY_MPM=${DEFAULT_MPM_THREADED}
235
			elog
235
			elog
236
			elog "Selected default threaded MPM: ${MY_MPM}"
236
			elog "Selected default threaded MPM: ${MY_MPM}"
237
			elog
237
			elog
238
		else
238
		else
239
			MY_MPM=prefork
239
			MY_MPM=prefork
240
			elog
240
			elog
241
			elog "Selected default MPM: ${MY_MPM}"
241
			elog "Selected default MPM: ${MY_MPM}"
242
			elog
242
			elog
243
		fi
243
		fi
244
	fi
244
	fi
245
}
245
}
246
246
247
# @VARIABLE: MODULE_CRITICAL
247
# @VARIABLE: MODULE_CRITICAL
248
# @DESCRIPTION:
248
# @DESCRIPTION:
249
# This variable needs to be set in the ebuild and contains a space-separated
249
# This variable needs to be set in the ebuild and contains a space-separated
250
# list of modules critical for the default apache. A user may still
250
# list of modules critical for the default apache. A user may still
251
# disable these modules for custom minimal installation at their own risk.
251
# disable these modules for custom minimal installation at their own risk.
252
252
253
# @FUNCTION: check_module_critical
253
# @FUNCTION: check_module_critical
254
# @DESCRIPTION:
254
# @DESCRIPTION:
255
# This internal function warns the user about modules critical for the default
255
# This internal function warns the user about modules critical for the default
256
# apache configuration.
256
# apache configuration.
257
check_module_critical() {
257
check_module_critical() {
258
	local unsupported=0
258
	local unsupported=0
259
259
260
	for m in ${MODULE_CRITICAL} ; do
260
	for m in ${MODULE_CRITICAL} ; do
261
		if ! has ${m} ${MY_MODS[@]} ; then
261
		if ! has ${m} ${MY_MODS[@]} ; then
262
			ewarn "Module '${m}' is required in the default apache configuration."
262
			ewarn "Module '${m}' is required in the default apache configuration."
263
			unsupported=1
263
			unsupported=1
264
		fi
264
		fi
265
	done
265
	done
266
266
267
	if [[ ${unsupported} -ne 0 ]] ; then
267
	if [[ ${unsupported} -ne 0 ]] ; then
268
		ewarn
268
		ewarn
269
		ewarn "You have disabled one or more required modules"
269
		ewarn "You have disabled one or more required modules"
270
		ewarn "for the default apache configuration."
270
		ewarn "for the default apache configuration."
271
		ewarn "Although this is not an error, please be"
271
		ewarn "Although this is not an error, please be"
272
		ewarn "aware that this setup is UNSUPPORTED."
272
		ewarn "aware that this setup is UNSUPPORTED."
273
		ewarn
273
		ewarn
274
	fi
274
	fi
275
}
275
}
276
276
277
# @ECLASS_VARIABLE: MY_CONF
277
# @ECLASS_VARIABLE: MY_CONF
278
# @DESCRIPTION:
278
# @DESCRIPTION:
279
# This internal variable contains the econf options for the current module
279
# This internal variable contains the econf options for the current module
280
# selection after a call to setup_modules()
280
# selection after a call to setup_modules()
281
281
282
# @ECLASS_VARIABLE: MY_MODS
282
# @ECLASS_VARIABLE: MY_MODS
283
# @DESCRIPTION:
283
# @DESCRIPTION:
284
# This internal variable contains a sorted, space separated list of currently
284
# This internal variable contains a sorted, space separated list of currently
285
# selected modules after a call to setup_modules()
285
# selected modules after a call to setup_modules()
286
286
287
# @FUNCTION: setup_modules
287
# @FUNCTION: setup_modules
288
# @DESCRIPTION:
288
# @DESCRIPTION:
289
# This internal function selects all built-in modules based on USE flags and
289
# This internal function selects all built-in modules based on USE flags and
290
# APACHE2_MODULES USE_EXPAND flags
290
# APACHE2_MODULES USE_EXPAND flags
291
setup_modules() {
291
setup_modules() {
292
	local mod_type= x=
292
	local mod_type= x=
293
293
294
	if use static ; then
294
	if use static ; then
295
		mod_type="static"
295
		mod_type="static"
296
	else
296
	else
297
		mod_type="shared"
297
		mod_type="shared"
298
	fi
298
	fi
299
299
300
	MY_CONF=( --enable-so=static --disable-static )
300
	MY_CONF=( --enable-so=static --disable-static )
301
	MY_MODS=()
301
	MY_MODS=()
302
302
303
	if use ldap ; then
303
	if use ldap ; then
304
		MY_CONF+=(
304
		MY_CONF+=(
305
			--enable-authnz_ldap=${mod_type}
305
			--enable-authnz_ldap=${mod_type}
306
			--enable-ldap=${mod_type}
306
			--enable-ldap=${mod_type}
307
		)
307
		)
308
		MY_MODS+=( ldap authnz_ldap )
308
		MY_MODS+=( ldap authnz_ldap )
309
	else
309
	else
310
		MY_CONF+=( --disable-authnz_ldap --disable-ldap )
310
		MY_CONF+=( --disable-authnz_ldap --disable-ldap )
311
	fi
311
	fi
312
312
313
	if use ssl ; then
313
	if use ssl ; then
314
		MY_CONF+=( --with-ssl --enable-ssl=${mod_type} )
314
		MY_CONF+=( --with-ssl --enable-ssl=${mod_type} )
315
		MY_MODS+=( ssl )
315
		MY_MODS+=( ssl )
316
	else
316
	else
317
		MY_CONF+=( --without-ssl --disable-ssl )
317
		MY_CONF+=( --without-ssl --disable-ssl )
318
	fi
318
	fi
319
319
320
	if use suexec ; then
320
	if use suexec ; then
321
		elog "You can manipulate several configure options of suexec"
321
		elog "You can manipulate several configure options of suexec"
322
		elog "through the following environment variables:"
322
		elog "through the following environment variables:"
323
		elog
323
		elog
324
		elog " SUEXEC_SAFEPATH: Default PATH for suexec (default: '${EPREFIX}/usr/local/bin:${EPREFIX}/usr/bin:${EPREFIX}/bin')"
324
		elog " SUEXEC_SAFEPATH: Default PATH for suexec (default: '${EPREFIX}/usr/local/bin:${EPREFIX}/usr/bin:${EPREFIX}/bin')"
325
		if ! use suexec-syslog ; then
325
		if ! use suexec-syslog ; then
326
			elog "  SUEXEC_LOGFILE: Path to the suexec logfile (default: '${EPREFIX}/var/log/apache2/suexec_log')"
326
			elog "  SUEXEC_LOGFILE: Path to the suexec logfile (default: '${EPREFIX}/var/log/apache2/suexec_log')"
327
		fi
327
		fi
328
		elog "   SUEXEC_CALLER: Name of the user Apache is running as (default: apache)"
328
		elog "   SUEXEC_CALLER: Name of the user Apache is running as (default: apache)"
329
		elog "  SUEXEC_DOCROOT: Directory in which suexec will run scripts (default: '${EPREFIX}/var/www')"
329
		elog "  SUEXEC_DOCROOT: Directory in which suexec will run scripts (default: '${EPREFIX}/var/www')"
330
		elog "   SUEXEC_MINUID: Minimum UID, which is allowed to run scripts via suexec (default: 1000)"
330
		elog "   SUEXEC_MINUID: Minimum UID, which is allowed to run scripts via suexec (default: 1000)"
331
		elog "   SUEXEC_MINGID: Minimum GID, which is allowed to run scripts via suexec (default: 100)"
331
		elog "   SUEXEC_MINGID: Minimum GID, which is allowed to run scripts via suexec (default: 100)"
332
		elog "  SUEXEC_USERDIR: User subdirectories (like /home/user/html) (default: public_html)"
332
		elog "  SUEXEC_USERDIR: User subdirectories (like /home/user/html) (default: public_html)"
333
		elog "    SUEXEC_UMASK: Umask for the suexec process (default: 077)"
333
		elog "    SUEXEC_UMASK: Umask for the suexec process (default: 077)"
334
		elog
334
		elog
335
335
336
		MY_CONF+=( --with-suexec-safepath="${SUEXEC_SAFEPATH:-${EPREFIX}/usr/local/bin:${EPREFIX}/usr/bin:${EPREFIX}/bin}" )
336
		MY_CONF+=( --with-suexec-safepath="${SUEXEC_SAFEPATH:-${EPREFIX}/usr/local/bin:${EPREFIX}/usr/bin:${EPREFIX}/bin}" )
337
		MY_CONF+=( $(use_with !suexec-syslog suexec-logfile "${SUEXEC_LOGFILE:-${EPREFIX}/var/log/apache2/suexec_log}") )
337
		MY_CONF+=( $(use_with !suexec-syslog suexec-logfile "${SUEXEC_LOGFILE:-${EPREFIX}/var/log/apache2/suexec_log}") )
338
		MY_CONF+=( $(use_with suexec-syslog) )
338
		MY_CONF+=( $(use_with suexec-syslog) )
339
		if use suexec-syslog && use suexec-caps ; then
339
		if use suexec-syslog && use suexec-caps ; then
340
			MY_CONF+=( --enable-suexec-capabilities )
340
			MY_CONF+=( --enable-suexec-capabilities )
341
		fi
341
		fi
342
		MY_CONF+=( --with-suexec-bin="${EPREFIX}/usr/sbin/suexec" )
342
		MY_CONF+=( --with-suexec-bin="${EPREFIX}/usr/sbin/suexec" )
343
		MY_CONF+=( --with-suexec-userdir=${SUEXEC_USERDIR:-public_html} )
343
		MY_CONF+=( --with-suexec-userdir=${SUEXEC_USERDIR:-public_html} )
344
		MY_CONF+=( --with-suexec-caller=${SUEXEC_CALLER:-apache} )
344
		MY_CONF+=( --with-suexec-caller=${SUEXEC_CALLER:-apache} )
345
		MY_CONF+=( --with-suexec-docroot="${SUEXEC_DOCROOT:-${EPREFIX}/var/www}" )
345
		MY_CONF+=( --with-suexec-docroot="${SUEXEC_DOCROOT:-${EPREFIX}/var/www}" )
346
		MY_CONF+=( --with-suexec-uidmin=${SUEXEC_MINUID:-1000} )
346
		MY_CONF+=( --with-suexec-uidmin=${SUEXEC_MINUID:-1000} )
347
		MY_CONF+=( --with-suexec-gidmin=${SUEXEC_MINGID:-100} )
347
		MY_CONF+=( --with-suexec-gidmin=${SUEXEC_MINGID:-100} )
348
		MY_CONF+=( --with-suexec-umask=${SUEXEC_UMASK:-077} )
348
		MY_CONF+=( --with-suexec-umask=${SUEXEC_UMASK:-077} )
349
		MY_CONF+=( --enable-suexec=${mod_type} )
349
		MY_CONF+=( --enable-suexec=${mod_type} )
350
		MY_MODS+=( suexec )
350
		MY_MODS+=( suexec )
351
	else
351
	else
352
		MY_CONF+=( --disable-suexec )
352
		MY_CONF+=( --disable-suexec )
353
	fi
353
	fi
354
354
355
	if use systemd ; then
355
	if use systemd ; then
356
		MY_CONF+=( --enable-systemd=${mod_type} )
356
		MY_CONF+=( --enable-systemd=${mod_type} )
357
		MY_MODS+=( systemd )
357
		MY_MODS+=( systemd )
358
	fi
358
	fi
359
359
360
	for x in ${IUSE_MODULES/ systemd} ; do
360
	for x in ${IUSE_MODULES/ systemd} ; do
361
		if use apache2_modules_${x} ; then
361
		if use apache2_modules_${x} ; then
362
			MY_CONF+=( --enable-${x}=${mod_type} )
362
			MY_CONF+=( --enable-${x}=${mod_type} )
363
			MY_MODS+=( ${x} )
363
			MY_MODS+=( ${x} )
364
		else
364
		else
365
			MY_CONF+=( --disable-${x} )
365
			MY_CONF+=( --disable-${x} )
366
		fi
366
		fi
367
	done
367
	done
368
368
369
	# sort and uniquify MY_MODS
369
	# sort and uniquify MY_MODS
370
	MY_MODS=( $(echo ${MY_MODS[@]} | tr ' ' '\n' | sort -u) )
370
	MY_MODS=( $(echo ${MY_MODS[@]} | tr ' ' '\n' | sort -u) )
371
	check_module_critical
371
	check_module_critical
372
}
372
}
373
373
374
# @VARIABLE: MODULE_DEFINES
374
# @VARIABLE: MODULE_DEFINES
375
# @DESCRIPTION:
375
# @DESCRIPTION:
376
# This variable needs to be set in the ebuild and contains a space-separated
376
# This variable needs to be set in the ebuild and contains a space-separated
377
# list of tokens each mapping a module to a runtime define which can be
377
# list of tokens each mapping a module to a runtime define which can be
378
# specified in APACHE2_OPTS in /etc/conf.d/apache2 to enable this particular
378
# specified in APACHE2_OPTS in /etc/conf.d/apache2 to enable this particular
379
# module.
379
# module.
380
380
381
# @FUNCTION: generate_load_module
381
# @FUNCTION: generate_load_module
382
# @DESCRIPTION:
382
# @DESCRIPTION:
383
# This internal function generates the LoadModule lines for httpd.conf based on
383
# This internal function generates the LoadModule lines for httpd.conf based on
384
# the current module selection and MODULE_DEFINES
384
# the current module selection and MODULE_DEFINES
385
generate_load_module() {
385
generate_load_module() {
386
	local def= endit=0 m= mod_lines= mod_dir="${ED}/usr/$(get_libdir)/apache2/modules"
386
	local def= endit=0 m= mod_lines= mod_dir="${ED}/usr/$(get_libdir)/apache2/modules"
387
387
388
	if use static; then
388
	if use static; then
389
		sed -i -e "/%%LOAD_MODULE%%/d" \
389
		sed -i -e "/%%LOAD_MODULE%%/d" \
390
			"${GENTOO_PATCHDIR}"/conf/httpd.conf
390
			"${GENTOO_PATCHDIR}"/conf/httpd.conf
391
		return
391
		return
392
	fi
392
	fi
393
393
394
	for m in ${MY_MODS[@]} ; do
394
	for m in ${MY_MODS[@]} ; do
395
		if [[ -e "${mod_dir}/mod_${m}.so" ]] ; then
395
		if [[ -e "${mod_dir}/mod_${m}.so" ]] ; then
396
			for def in ${MODULE_DEFINES} ; do
396
			for def in ${MODULE_DEFINES} ; do
397
				if [[ "${m}" == "${def%:*}" ]] ; then
397
				if [[ "${m}" == "${def%:*}" ]] ; then
398
					mod_lines="${mod_lines}\n<IfDefine ${def#*:}>"
398
					mod_lines="${mod_lines}\n<IfDefine ${def#*:}>"
399
					endit=1
399
					endit=1
400
				fi
400
				fi
401
			done
401
			done
402
402
403
			mod_lines="${mod_lines}\nLoadModule ${m}_module modules/mod_${m}.so"
403
			mod_lines="${mod_lines}\nLoadModule ${m}_module modules/mod_${m}.so"
404
404
405
			if [[ ${endit} -ne 0 ]] ; then
405
			if [[ ${endit} -ne 0 ]] ; then
406
				mod_lines="${mod_lines}\n</IfDefine>"
406
				mod_lines="${mod_lines}\n</IfDefine>"
407
				endit=0
407
				endit=0
408
			fi
408
			fi
409
		fi
409
		fi
410
	done
410
	done
411
411
412
	sed -i -e "s:%%LOAD_MODULE%%:${mod_lines}:" \
412
	sed -i -e "s:%%LOAD_MODULE%%:${mod_lines}:" \
413
		"${GENTOO_PATCHDIR}"/conf/httpd.conf
413
		"${GENTOO_PATCHDIR}"/conf/httpd.conf
414
}
414
}
415
415
416
# @FUNCTION: check_upgrade
416
# @FUNCTION: check_upgrade
417
# @DESCRIPTION:
417
# @DESCRIPTION:
418
# This internal function checks if the previous configuration file for built-in
418
# This internal function checks if the previous configuration file for built-in
419
# modules exists in ROOT and prevents upgrade in this case. Users are supposed
419
# modules exists in ROOT and prevents upgrade in this case. Users are supposed
420
# to convert this file to the new APACHE2_MODULES USE_EXPAND variable and remove
420
# to convert this file to the new APACHE2_MODULES USE_EXPAND variable and remove
421
# it afterwards.
421
# it afterwards.
422
check_upgrade() {
422
check_upgrade() {
423
	if [[ -e "${EROOT}"etc/apache2/apache2-builtin-mods ]]; then
423
	if [[ -e "${EROOT}"etc/apache2/apache2-builtin-mods ]]; then
424
		eerror "The previous configuration file for built-in modules"
424
		eerror "The previous configuration file for built-in modules"
425
		eerror "(${EROOT}etc/apache2/apache2-builtin-mods) exists on your"
425
		eerror "(${EROOT}etc/apache2/apache2-builtin-mods) exists on your"
426
		eerror "system."
426
		eerror "system."
427
		eerror
427
		eerror
428
		eerror "Please read https://wiki.gentoo.org/wiki/Project:Apache/Upgrading"
428
		eerror "Please read https://wiki.gentoo.org/wiki/Project:Apache/Upgrading"
429
		eerror "for detailed information how to convert this file to the new"
429
		eerror "for detailed information how to convert this file to the new"
430
		eerror "APACHE2_MODULES USE_EXPAND variable."
430
		eerror "APACHE2_MODULES USE_EXPAND variable."
431
		eerror
431
		eerror
432
		die "upgrade not possible with existing ${ROOT}etc/apache2/apache2-builtin-mods"
432
		die "upgrade not possible with existing ${ROOT}etc/apache2/apache2-builtin-mods"
433
	fi
433
	fi
434
}
434
}
435
435
436
# ==============================================================================
436
# ==============================================================================
437
# EXPORTED FUNCTIONS
437
# EXPORTED FUNCTIONS
438
# ==============================================================================
438
# ==============================================================================
439
439
440
# @FUNCTION: apache-2_pkg_setup
440
# @FUNCTION: apache-2_pkg_setup
441
# @DESCRIPTION:
441
# @DESCRIPTION:
442
# This function selects built-in modules, the MPM and other configure options,
442
# This function selects built-in modules, the MPM and other configure options,
443
# creates the apache user and group and informs about CONFIG_SYSVIPC being
443
# creates the apache user and group and informs about CONFIG_SYSVIPC being
444
# needed (we don't depend on kernel sources and therefore cannot check).
444
# needed (we don't depend on kernel sources and therefore cannot check).
445
apache-2_pkg_setup() {
445
apache-2_pkg_setup() {
446
	check_upgrade
446
	check_upgrade
447
447
448
	setup_mpm
448
	setup_mpm
449
	setup_modules
449
	setup_modules
450
450
451
	if use debug; then
451
	if use debug; then
452
		MY_CONF+=( --enable-exception-hook )
452
		MY_CONF+=( --enable-exception-hook )
453
	fi
453
	fi
454
454
455
	elog "Please note that you need SysV IPC support in your kernel."
455
	elog "Please note that you need SysV IPC support in your kernel."
456
	elog "Make sure CONFIG_SYSVIPC=y is set."
456
	elog "Make sure CONFIG_SYSVIPC=y is set."
457
	elog
457
	elog
458
458
459
	if use apache2_modules_lua ; then
459
	if use apache2_modules_lua ; then
460
		lua-single_pkg_setup
460
		lua-single_pkg_setup
461
	fi
461
	fi
462
}
462
}
463
463
464
# @FUNCTION: apache-2_src_prepare
464
# @FUNCTION: apache-2_src_prepare
465
# @DESCRIPTION:
465
# @DESCRIPTION:
466
# This function applies patches, configures a custom file-system layout and
466
# This function applies patches, configures a custom file-system layout and
467
# rebuilds the configure scripts.
467
# rebuilds the configure scripts.
468
apache-2_src_prepare() {
468
apache-2_src_prepare() {
469
	#fix prefix in conf files etc (bug #433736)
469
	#fix prefix in conf files etc (bug #433736)
470
	use !prefix || sed -e "s@/\(usr\|var\|etc\|run\)/@${EPREFIX}&@g" \
470
	use !prefix || sed -e "s@/\(usr\|var\|etc\|run\)/@${EPREFIX}&@g" \
471
		-i "${GENTOO_PATCHDIR}"/conf/httpd.conf "${GENTOO_PATCHDIR}"/scripts/* \
471
		-i "${GENTOO_PATCHDIR}"/conf/httpd.conf "${GENTOO_PATCHDIR}"/scripts/* \
472
		"${GENTOO_PATCHDIR}"/docs/*.example "${GENTOO_PATCHDIR}"/patches/*.layout \
472
		"${GENTOO_PATCHDIR}"/docs/*.example "${GENTOO_PATCHDIR}"/patches/*.layout \
473
		"${GENTOO_PATCHDIR}"/init/* "${GENTOO_PATCHDIR}"/conf/vhosts.d/* \
473
		"${GENTOO_PATCHDIR}"/init/* "${GENTOO_PATCHDIR}"/conf/vhosts.d/* \
474
		"${GENTOO_PATCHDIR}"/conf/modules.d/* || die
474
		"${GENTOO_PATCHDIR}"/conf/modules.d/* || die
475
475
476
	# 03_all_gentoo-apache-tools.patch injects -Wl,-z,now, which is not a good
476
	# 03_all_gentoo-apache-tools.patch injects -Wl,-z,now, which is not a good
477
	# idea for everyone
477
	# idea for everyone
478
	case ${CHOST} in
478
	case ${CHOST} in
479
		*-linux-gnu|*-solaris*)
479
		*-linux-gnu|*-solaris*)
480
			# do nothing, these use GNU binutils
480
			# do nothing, these use GNU binutils
481
			:
481
			:
482
		;;
482
		;;
483
		*-darwin*)
483
		*-darwin*)
484
			sed -i -e 's/-Wl,-z,now/-Wl,-bind_at_load/g' \
484
			sed -i -e 's/-Wl,-z,now/-Wl,-bind_at_load/g' \
485
				"${GENTOO_PATCHDIR}"/patches/03_all_gentoo_apache-tools.patch \
485
				"${GENTOO_PATCHDIR}"/patches/03_all_gentoo_apache-tools.patch \
486
				|| die
486
				|| die
487
		;;
487
		;;
488
		*)
488
		*)
489
			# patch it out to be like upstream
489
			# patch it out to be like upstream
490
			sed -i -e 's/-Wl,-z,now//g' \
490
			sed -i -e 's/-Wl,-z,now//g' \
491
				"${GENTOO_PATCHDIR}"/patches/03_all_gentoo_apache-tools.patch \
491
				"${GENTOO_PATCHDIR}"/patches/03_all_gentoo_apache-tools.patch \
492
				|| die
492
				|| die
493
		;;
493
		;;
494
	esac
494
	esac
495
495
496
	# Use correct multilib libdir in gentoo patches
496
	# Use correct multilib libdir in gentoo patches
497
	sed -i -e "s:/usr/lib:/usr/$(get_libdir):g" \
497
	sed -i -e "s:/usr/lib:/usr/$(get_libdir):g" \
498
		"${GENTOO_PATCHDIR}"/{conf/httpd.conf,init/*,patches/config.layout} \
498
		"${GENTOO_PATCHDIR}"/{conf/httpd.conf,init/*,patches/config.layout} \
499
		|| die "libdir sed failed"
499
		|| die "libdir sed failed"
500
500
501
	eapply "${GENTOO_PATCHDIR}"/patches/*.patch
501
	eapply "${GENTOO_PATCHDIR}"/patches/*.patch
502
	default
502
	default
503
503
504
	# Don't rename configure.in _before_ any possible user patches!
504
	# Don't rename configure.in _before_ any possible user patches!
505
	if [[ -f "configure.in" ]] ; then
505
	if [[ -f "configure.in" ]] ; then
506
		einfo "Renaming configure.in to configure.ac"
506
		einfo "Renaming configure.in to configure.ac"
507
		mv configure.{in,ac} || die
507
		mv configure.{in,ac} || die
508
	fi
508
	fi
509
509
510
	# setup the filesystem layout config
510
	# setup the filesystem layout config
511
	cat "${GENTOO_PATCHDIR}"/patches/config.layout >> "${S}"/config.layout || \
511
	cat "${GENTOO_PATCHDIR}"/patches/config.layout >> "${S}"/config.layout || \
512
		die "Failed preparing config.layout!"
512
		die "Failed preparing config.layout!"
513
	sed -i -e "s:version:${PF}:g" "${S}"/config.layout || die
513
	sed -i -e "s:version:${PF}:g" "${S}"/config.layout || die
514
514
515
	# apache2.8 instead of httpd.8 (bug #194828)
515
	# apache2.8 instead of httpd.8 (bug #194828)
516
	mv docs/man/{httpd,apache2}.8 || die
516
	mv docs/man/{httpd,apache2}.8 || die
517
	sed -i -e 's/httpd\.8/apache2.8/g' Makefile.in || die
517
	sed -i -e 's/httpd\.8/apache2.8/g' Makefile.in || die
518
518
519
	# patched-in MPMs need the build environment rebuilt
519
	# patched-in MPMs need the build environment rebuilt
520
	sed -i -e '/sinclude/d' configure.ac || die
520
	sed -i -e '/sinclude/d' configure.ac || die
521
	AT_M4DIR=build eautoreconf
521
	AT_M4DIR=build eautoreconf
522
522
523
	# ${T} must be not group-writable, else grsec TPE will block it
523
	# ${T} must be not group-writable, else grsec TPE will block it
524
	chmod g-w "${T}" || die
524
	chmod g-w "${T}" || die
525
525
526
	# This package really should upgrade to using pcre's .pc file.
526
	# This package really should upgrade to using pcre's .pc file.
527
	cat <<-\EOF > "${T}"/pcre2-config
527
	cat <<-\EOF > "${T}"/pcre2-config
528
	#!/usr/bin/env bash
528
	#!/usr/bin/env bash
529
	flags=()
529
	flags=()
530
	for flag; do
530
	for flag; do
531
		if [[ ${flag} == "--version" ]]; then
531
		if [[ ${flag} == "--version" ]]; then
532
			flags+=( --modversion )
532
			flags+=( --modversion )
533
		else
533
		else
534
			flags+=( "${flag}" )
534
			flags+=( "${flag}" )
535
		fi
535
		fi
536
	done
536
	done
537
	exec ${PKG_CONFIG} libpcre2-8 "${flags[@]}"
537
	exec ${PKG_CONFIG} libpcre2-8 "${flags[@]}"
538
	EOF
538
	EOF
539
	chmod a+x "${T}"/pcre2-config || die
539
	chmod a+x "${T}"/pcre2-config || die
540
}
540
}
541
541
542
# @FUNCTION: apache-2_src_configure
542
# @FUNCTION: apache-2_src_configure
543
# @DESCRIPTION:
543
# @DESCRIPTION:
544
# This function adds compiler flags and runs econf and emake based on MY_MPM and
544
# This function adds compiler flags and runs econf and emake based on MY_MPM and
545
# MY_CONF
545
# MY_CONF
546
apache-2_src_configure() {
546
apache-2_src_configure() {
547
	tc-export PKG_CONFIG
547
	tc-export PKG_CONFIG
548
	export ac_cv_path_PKGCONFIG="${PKG_CONFIG}"
548
	export ac_cv_path_PKGCONFIG="${PKG_CONFIG}"
549
549
550
	# Sanity check in case people have bad mounts/TPE settings. #500928
550
	# Sanity check in case people have bad mounts/TPE settings. #500928
551
	if ! "${T}"/pcre2-config --help &>/dev/null ; then
551
	if ! "${T}"/pcre2-config --help &>/dev/null ; then
552
		eerror "Could not execute ${T}/pcre2-config; do you have bad mount"
552
		eerror "Could not execute ${T}/pcre2-config; do you have bad mount"
553
		eerror "permissions in ${T} or have TPE turned on in your kernel?"
553
		eerror "permissions in ${T} or have TPE turned on in your kernel?"
554
		die "check your runtime settings #500928"
554
		die "check your runtime settings #500928"
555
	fi
555
	fi
556
556
557
	# Instead of filtering --as-needed (bug #128505), append --no-as-needed
557
	# Instead of filtering --as-needed (bug #128505), append --no-as-needed
558
	# Thanks to Harald van Dijk
558
	# Thanks to Harald van Dijk
559
	append-ldflags $(no-as-needed)
559
	append-ldflags $(no-as-needed)
560
560
561
	# peruser MPM debugging with -X is nearly impossible
561
	# peruser MPM debugging with -X is nearly impossible
562
	if has peruser ${IUSE_MPMS} && use apache2_mpms_peruser ; then
562
	if has peruser ${IUSE_MPMS} && use apache2_mpms_peruser ; then
563
		use debug && append-flags -DMPM_PERUSER_DEBUG
563
		use debug && append-flags -DMPM_PERUSER_DEBUG
564
	fi
564
	fi
565
565
566
	# econf overwrites the stuff from config.layout, so we have to put them into
566
	# econf overwrites the stuff from config.layout, so we have to put them into
567
	# our myconf line too
567
	# our myconf line too
568
	MY_CONF+=(
568
	MY_CONF+=(
569
		--includedir="${EPREFIX}"/usr/include/apache2
569
		--includedir="${EPREFIX}"/usr/include/apache2
570
		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/apache2/modules
570
		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/apache2/modules
571
		--datadir="${EPREFIX}"/var/www/localhost
571
		--datadir="${EPREFIX}"/var/www/localhost
572
		--sysconfdir="${EPREFIX}"/etc/apache2
572
		--sysconfdir="${EPREFIX}"/etc/apache2
573
		--localstatedir="${EPREFIX}"/var
573
		--localstatedir="${EPREFIX}"/var
574
		--with-mpm=${MY_MPM}
574
		--with-mpm=${MY_MPM}
575
		--with-apr="${SYSROOT}${EPREFIX}"/usr
575
		--with-apr="${SYSROOT}${EPREFIX}"/usr
576
		--with-apr-util="${SYSROOT}${EPREFIX}"/usr
576
		--with-apr-util="${SYSROOT}${EPREFIX}"/usr
577
		--with-z="${EPREFIX}"/usr
577
		--with-z="${EPREFIX}"/usr
578
		--with-port=80
578
		--with-port=80
579
		--with-program-name=apache2
579
		--with-program-name=apache2
580
		--enable-layout=Gentoo
580
		--enable-layout=Gentoo
581
	)
581
	)
582
582
583
	export ac_cv_prog_ac_ct_PCRE_CONFIG="${T}"/pcre2-config
583
	export ac_cv_prog_ac_ct_PCRE_CONFIG="${T}"/pcre2-config
584
584
585
	MY_CONF+=(
585
	MY_CONF+=(
586
		--without-pcre
586
		--without-pcre
587
		--with-pcre2="${T}"/pcre2-config
587
		--with-pcre2="${T}"/pcre2-config
588
	)
588
	)
589
589
590
	econf "${MY_CONF[@]}"
590
	econf "${MY_CONF[@]}"
591
591
592
	sed -i -e 's:apache2\.conf:httpd.conf:' include/ap_config_auto.h || die
592
	sed -i -e 's:apache2\.conf:httpd.conf:' include/ap_config_auto.h || die
593
}
593
}
594
594
595
# @FUNCTION: apache-2_src_install
595
# @FUNCTION: apache-2_src_install
596
# @DESCRIPTION:
596
# @DESCRIPTION:
597
# This function runs `emake install' and generates, installs and adapts the gentoo
597
# This function runs `emake install' and generates, installs and adapts the gentoo
598
# specific configuration files found in the tarball
598
# specific configuration files found in the tarball
599
apache-2_src_install() {
599
apache-2_src_install() {
600
	emake DESTDIR="${D}" MKINSTALLDIRS="mkdir -p" install
600
	emake DESTDIR="${D}" MKINSTALLDIRS="mkdir -p" install
601
601
602
	# install our configuration files
602
	# install our configuration files
603
	keepdir /etc/apache2/vhosts.d
603
	keepdir /etc/apache2/vhosts.d
604
	keepdir /etc/apache2/modules.d
604
	keepdir /etc/apache2/modules.d
605
605
606
	generate_load_module
606
	generate_load_module
607
	insinto /etc/apache2
607
	insinto /etc/apache2
608
	doins -r "${GENTOO_PATCHDIR}"/conf/*
608
	doins -r "${GENTOO_PATCHDIR}"/conf/*
609
	use apache2_modules_mime_magic && doins docs/conf/magic
609
	use apache2_modules_mime_magic && doins docs/conf/magic
610
610
611
	insinto /etc/logrotate.d
611
	insinto /etc/logrotate.d
612
	newins "${GENTOO_PATCHDIR}"/scripts/apache2-logrotate apache2
612
	newins "${GENTOO_PATCHDIR}"/scripts/apache2-logrotate apache2
613
613
614
	# generate a sane default APACHE2_OPTS
614
	# generate a sane default APACHE2_OPTS
615
	APACHE2_OPTS="-D DEFAULT_VHOST -D INFO"
615
	APACHE2_OPTS="-D DEFAULT_VHOST -D INFO"
616
	use doc && APACHE2_OPTS+=" -D MANUAL"
616
	use doc && APACHE2_OPTS+=" -D MANUAL"
617
	use ssl && APACHE2_OPTS+=" -D SSL -D SSL_DEFAULT_VHOST"
617
	use ssl && APACHE2_OPTS+=" -D SSL -D SSL_DEFAULT_VHOST"
618
	use suexec && APACHE2_OPTS+=" -D SUEXEC"
618
	use suexec && APACHE2_OPTS+=" -D SUEXEC"
619
	if has negotiation ${APACHE2_MODULES} && use apache2_modules_negotiation; then
619
	if has negotiation ${APACHE2_MODULES} && use apache2_modules_negotiation; then
620
		APACHE2_OPTS+=" -D LANGUAGE"
620
		APACHE2_OPTS+=" -D LANGUAGE"
621
	fi
621
	fi
622
622
623
	sed -i -e "s:APACHE2_OPTS=\".*\":APACHE2_OPTS=\"${APACHE2_OPTS}\":" \
623
	sed -i -e "s:APACHE2_OPTS=\".*\":APACHE2_OPTS=\"${APACHE2_OPTS}\":" \
624
		"${GENTOO_PATCHDIR}"/init/apache2.confd || die
624
		"${GENTOO_PATCHDIR}"/init/apache2.confd || die
625
625
626
	newconfd "${GENTOO_PATCHDIR}"/init/apache2.confd apache2
626
	newconfd "${GENTOO_PATCHDIR}"/init/apache2.confd apache2
627
	newinitd "${GENTOO_PATCHDIR}"/init/apache2.initd apache2
627
	newinitd "${GENTOO_PATCHDIR}"/init/apache2.initd apache2
628
628
629
	# install apache2ctl wrapper for our init script if available
629
	# install apache2ctl wrapper for our init script if available
630
	if test -e "${GENTOO_PATCHDIR}"/scripts/apache2ctl; then
630
	if test -e "${GENTOO_PATCHDIR}"/scripts/apache2ctl; then
631
		exeinto /usr/sbin
631
		exeinto /usr/sbin
632
		doexe "${GENTOO_PATCHDIR}"/scripts/apache2ctl
632
		doexe "${GENTOO_PATCHDIR}"/scripts/apache2ctl
633
	else
633
	else
634
		dosym /etc/init.d/apache2 /usr/sbin/apache2ctl
634
		dosym /etc/init.d/apache2 /usr/sbin/apache2ctl
635
	fi
635
	fi
636
636
637
	# provide legacy symlink for apxs, bug 177697
637
	# provide legacy symlink for apxs, bug 177697
638
	dosym apxs /usr/sbin/apxs2
638
	dosym apxs /usr/sbin/apxs2
639
639
640
	# install some documentation
640
	# install some documentation
641
	dodoc ABOUT_APACHE CHANGES LAYOUT README README.platforms VERSIONING
641
	dodoc ABOUT_APACHE CHANGES LAYOUT README README.platforms VERSIONING
642
	dodoc "${GENTOO_PATCHDIR}"/docs/*
642
	dodoc "${GENTOO_PATCHDIR}"/docs/*
643
643
644
	# drop in a convenient link to the manual
644
	# drop in a convenient link to the manual
645
	if use doc ; then
645
	if use doc ; then
646
		sed -i -e "s:VERSION:${PVR}:" \
646
		sed -i -e "s:VERSION:${PVR}:" \
647
			"${ED}/etc/apache2/modules.d/00_apache_manual.conf" \
647
			"${ED}/etc/apache2/modules.d/00_apache_manual.conf" \
648
			|| die
648
			|| die
649
		docompress -x /usr/share/doc/${PF}/manual # 503640
649
		docompress -x /usr/share/doc/${PF}/manual # 503640
650
	else
650
	else
651
		rm -f "${ED}/etc/apache2/modules.d/00_apache_manual.conf" \
651
		rm -f "${ED}/etc/apache2/modules.d/00_apache_manual.conf" \
652
			|| die
652
			|| die
653
		rm -rf "${ED}/usr/share/doc/${PF}/manual" || die
653
		rm -rf "${ED}/usr/share/doc/${PF}/manual" || die
654
	fi
654
	fi
655
655
656
	# the default icons and error pages get stored in
656
	# the default icons and error pages get stored in
657
	# /usr/share/apache2/{error,icons}
657
	# /usr/share/apache2/{error,icons}
658
	dodir /usr/share/apache2
658
	dodir /usr/share/apache2
659
	mv -f "${ED}/var/www/localhost/error" \
659
	mv -f "${ED}/var/www/localhost/error" \
660
		"${ED}/usr/share/apache2/error" || die
660
		"${ED}/usr/share/apache2/error" || die
661
	mv -f "${ED}/var/www/localhost/icons" \
661
	mv -f "${ED}/var/www/localhost/icons" \
662
		"${ED}/usr/share/apache2/icons" || die
662
		"${ED}/usr/share/apache2/icons" || die
663
	rm -rf "${ED}/var/www/localhost/" || die
663
	rm -rf "${ED}/var/www/localhost/" || die
664
664
665
	# set some sane permissions for suexec
665
	# set some sane permissions for suexec
666
	if use suexec ; then
666
	if use suexec ; then
667
		if ! use suexec-syslog || ! use suexec-caps ; then
667
		if ! use suexec-syslog || ! use suexec-caps ; then
668
			fowners 0:${SUEXEC_CALLER:-apache} /usr/sbin/suexec
668
			fowners 0:${SUEXEC_CALLER:-apache} /usr/sbin/suexec
669
			fperms 4710 /usr/sbin/suexec
669
			fperms 4710 /usr/sbin/suexec
670
			# provide legacy symlink for suexec, bug 177697
670
			# provide legacy symlink for suexec, bug 177697
671
			dosym /usr/sbin/suexec /usr/sbin/suexec2
671
			dosym /usr/sbin/suexec /usr/sbin/suexec2
672
		fi
672
		fi
673
	fi
673
	fi
674
674
675
	# empty dirs
675
	# empty dirs
676
	local i
676
	local i
677
	for i in /var/lib/dav /var/log/apache2 ; do
677
	for i in /var/lib/dav /var/log/apache2 ; do
678
		keepdir ${i}
678
		keepdir ${i}
679
		fowners apache:apache ${i}
679
		fowners apache:apache ${i}
680
		fperms 0750 ${i}
680
		fperms 0750 ${i}
681
	done
681
	done
682
}
682
}
683
683
684
# @FUNCTION: apache-2_pkg_postinst
684
# @FUNCTION: apache-2_pkg_postinst
685
# @DESCRIPTION:
685
# @DESCRIPTION:
686
# This function creates test certificates if SSL is enabled and installs the
686
# This function creates test certificates if SSL is enabled and installs the
687
# default index.html to /var/www/localhost if it does not exist. We do this here
687
# default index.html to /var/www/localhost if it does not exist. We do this here
688
# because the default webroot is a copy of the files that exist elsewhere and we
688
# because the default webroot is a copy of the files that exist elsewhere and we
689
# don't want them to be managed/removed by portage when apache is upgraded.
689
# don't want them to be managed/removed by portage when apache is upgraded.
690
apache-2_pkg_postinst() {
690
apache-2_pkg_postinst() {
691
	if use ssl && [[ ! -e "${EROOT}/etc/ssl/apache2/server.pem" ]]; then
691
	if use ssl && [[ ! -e "${EROOT}/etc/ssl/apache2/server.pem" ]]; then
692
		SSL_ORGANIZATION="${SSL_ORGANIZATION:-Apache HTTP Server}"
692
		SSL_ORGANIZATION="${SSL_ORGANIZATION:-Apache HTTP Server}"
693
		install_cert /etc/ssl/apache2/server
693
		install_cert /etc/ssl/apache2/server
694
		ewarn
694
		ewarn
695
		ewarn "The location of SSL certificates has changed. If you are"
695
		ewarn "The location of SSL certificates has changed. If you are"
696
		ewarn "upgrading from ${CATEGORY}/${PN}-2.2.13 or earlier (or remerged"
696
		ewarn "upgrading from ${CATEGORY}/${PN}-2.2.13 or earlier (or remerged"
697
		ewarn "*any* apache version), you might want to move your old"
697
		ewarn "*any* apache version), you might want to move your old"
698
		ewarn "certificates from /etc/apache2/ssl/ to /etc/ssl/apache2/ and"
698
		ewarn "certificates from /etc/apache2/ssl/ to /etc/ssl/apache2/ and"
699
		ewarn "update your config files."
699
		ewarn "update your config files."
700
		ewarn
700
		ewarn
701
	fi
701
	fi
702
702
703
	if [[ ! -e "${EROOT}/var/www/localhost" ]] ; then
703
	if [[ ! -e "${EROOT}/var/www/localhost" ]] ; then
704
		mkdir -p "${EROOT}/var/www/localhost/htdocs"
704
		mkdir -p "${EROOT}/var/www/localhost/htdocs"
705
		echo "<html><body><h1>It works!</h1></body></html>" > "${EROOT}/var/www/localhost/htdocs/index.html"
705
		echo "<html><body><h1>It works!</h1></body></html>" > "${EROOT}/var/www/localhost/htdocs/index.html"
706
	fi
706
	fi
707
707
708
	echo
708
	echo
709
	elog "Attention: cgi and cgid modules are now handled via APACHE2_MODULES flags"
709
	elog "Attention: cgi and cgid modules are now handled via APACHE2_MODULES flags"
710
	elog "in make.conf. Make sure to enable those in order to compile them."
710
	elog "in make.conf. Make sure to enable those in order to compile them."
711
	elog "In general, you should use 'cgid' with threaded MPMs and 'cgi' otherwise."
711
	elog "In general, you should use 'cgid' with threaded MPMs and 'cgi' otherwise."
712
	echo
712
	echo
713
713
714
}
714
}
715
715
716
EXPORT_FUNCTIONS pkg_setup src_prepare src_configure src_install pkg_postinst
716
EXPORT_FUNCTIONS pkg_setup src_prepare src_configure src_install pkg_postinst
(-)a/www-servers/apache/apache-2.4.57-r5.ebuild (+3 lines)
Lines 1-256 Link Here
1
# Copyright 1999-2023 Gentoo Authors
1
# Copyright 1999-2023 Gentoo Authors
2
# Distributed under the terms of the GNU General Public License v2
2
# Distributed under the terms of the GNU General Public License v2
3
3
4
EAPI=7
4
EAPI=7
5
5
6
# latest gentoo apache files
6
# latest gentoo apache files
7
GENTOO_PATCHSTAMP="20231011"
7
GENTOO_PATCHSTAMP="20231011"
8
GENTOO_DEVELOPER="graaff"
8
GENTOO_DEVELOPER="graaff"
9
GENTOO_PATCHNAME="gentoo-apache-2.4.57-r5"
9
GENTOO_PATCHNAME="gentoo-apache-2.4.57-r5"
10
10
11
# ancient hack: bug #502384
12
IUSE="split-usr"
13
11
# IUSE/USE_EXPAND magic
14
# IUSE/USE_EXPAND magic
12
IUSE_MPMS_FORK="prefork"
15
IUSE_MPMS_FORK="prefork"
13
IUSE_MPMS_THREAD="event worker"
16
IUSE_MPMS_THREAD="event worker"
14
17
15
# << obsolete modules:
18
# << obsolete modules:
16
# authn_default authz_default mem_cache
19
# authn_default authz_default mem_cache
17
# mem_cache is replaced by cache_disk
20
# mem_cache is replaced by cache_disk
18
# ?? buggy modules
21
# ?? buggy modules
19
# proxy_scgi: startup error: undefined symbol "ap_proxy_release_connection", no fix found
22
# proxy_scgi: startup error: undefined symbol "ap_proxy_release_connection", no fix found
20
# >> added modules for reason:
23
# >> added modules for reason:
21
# compat: compatibility with 2.2 access control
24
# compat: compatibility with 2.2 access control
22
# authz_host: new module for access control
25
# authz_host: new module for access control
23
# authn_core: functionality provided by authn_alias in previous versions
26
# authn_core: functionality provided by authn_alias in previous versions
24
# authz_core: new module, provides core authorization capabilities
27
# authz_core: new module, provides core authorization capabilities
25
# cache_disk: replacement for mem_cache
28
# cache_disk: replacement for mem_cache
26
# lbmethod_byrequests: Split off from mod_proxy_balancer in 2.3
29
# lbmethod_byrequests: Split off from mod_proxy_balancer in 2.3
27
# lbmethod_bytraffic: Split off from mod_proxy_balancer in 2.3
30
# lbmethod_bytraffic: Split off from mod_proxy_balancer in 2.3
28
# lbmethod_bybusyness: Split off from mod_proxy_balancer in 2.3
31
# lbmethod_bybusyness: Split off from mod_proxy_balancer in 2.3
29
# lbmethod_heartbeat: Split off from mod_proxy_balancer in 2.3
32
# lbmethod_heartbeat: Split off from mod_proxy_balancer in 2.3
30
# slotmem_shm: Slot-based shared memory provider (for lbmethod_byrequests).
33
# slotmem_shm: Slot-based shared memory provider (for lbmethod_byrequests).
31
# socache_shmcb: shared object cache provider. Default config with ssl needs it
34
# socache_shmcb: shared object cache provider. Default config with ssl needs it
32
# unixd: fixes startup error: Invalid command 'User'
35
# unixd: fixes startup error: Invalid command 'User'
33
IUSE_MODULES="access_compat actions alias allowmethods asis auth_basic auth_digest auth_form
36
IUSE_MODULES="access_compat actions alias allowmethods asis auth_basic auth_digest auth_form
34
authn_anon authn_core authn_dbd authn_dbm authn_file authn_socache authz_core
37
authn_anon authn_core authn_dbd authn_dbm authn_file authn_socache authz_core
35
authz_dbd authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex
38
authz_dbd authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex
36
brotli cache cache_disk cache_socache cern_meta charset_lite cgi cgid dav dav_fs dav_lock
39
brotli cache cache_disk cache_socache cern_meta charset_lite cgi cgid dav dav_fs dav_lock
37
dbd deflate dir dumpio env expires ext_filter file_cache filter headers http2
40
dbd deflate dir dumpio env expires ext_filter file_cache filter headers http2
38
ident imagemap include info lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness
41
ident imagemap include info lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness
39
lbmethod_heartbeat log_config log_forensic logio lua macro md mime mime_magic negotiation
42
lbmethod_heartbeat log_config log_forensic logio lua macro md mime mime_magic negotiation
40
proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_hcheck proxy_html proxy_http proxy_scgi
43
proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_hcheck proxy_html proxy_http proxy_scgi
41
proxy_http2 proxy_fcgi proxy_uwsgi proxy_wstunnel rewrite ratelimit remoteip reqtimeout
44
proxy_http2 proxy_fcgi proxy_uwsgi proxy_wstunnel rewrite ratelimit remoteip reqtimeout
42
session session_cookie session_crypto session_dbd setenvif slotmem_shm socache_memcache
45
session session_cookie session_crypto session_dbd setenvif slotmem_shm socache_memcache
43
socache_shmcb speling status substitute systemd tls unique_id userdir usertrack
46
socache_shmcb speling status substitute systemd tls unique_id userdir usertrack
44
unixd version vhost_alias watchdog xml2enc"
47
unixd version vhost_alias watchdog xml2enc"
45
# The following are also in the source as of this version, but are not available
48
# The following are also in the source as of this version, but are not available
46
# for user selection:
49
# for user selection:
47
# bucketeer case_filter case_filter_in echo http isapi optional_fn_export
50
# bucketeer case_filter case_filter_in echo http isapi optional_fn_export
48
# optional_fn_import optional_hook_export optional_hook_import
51
# optional_fn_import optional_hook_export optional_hook_import
49
52
50
# inter-module dependencies
53
# inter-module dependencies
51
# TODO: this may still be incomplete
54
# TODO: this may still be incomplete
52
MODULE_DEPENDS="
55
MODULE_DEPENDS="
53
	auth_form:session
56
	auth_form:session
54
	brotli:filter
57
	brotli:filter
55
	dav_fs:dav
58
	dav_fs:dav
56
	dav_lock:dav
59
	dav_lock:dav
57
	deflate:filter
60
	deflate:filter
58
	cache_disk:cache
61
	cache_disk:cache
59
	ext_filter:filter
62
	ext_filter:filter
60
	file_cache:cache
63
	file_cache:cache
61
	lbmethod_byrequests:proxy_balancer
64
	lbmethod_byrequests:proxy_balancer
62
	lbmethod_byrequests:slotmem_shm
65
	lbmethod_byrequests:slotmem_shm
63
	lbmethod_bytraffic:proxy_balancer
66
	lbmethod_bytraffic:proxy_balancer
64
	lbmethod_bybusyness:proxy_balancer
67
	lbmethod_bybusyness:proxy_balancer
65
	lbmethod_heartbeat:proxy_balancer
68
	lbmethod_heartbeat:proxy_balancer
66
	log_forensic:log_config
69
	log_forensic:log_config
67
	logio:log_config
70
	logio:log_config
68
	cache_disk:cache
71
	cache_disk:cache
69
	cache_socache:cache
72
	cache_socache:cache
70
	md:watchdog
73
	md:watchdog
71
	mime_magic:mime
74
	mime_magic:mime
72
	proxy_ajp:proxy
75
	proxy_ajp:proxy
73
	proxy_balancer:proxy
76
	proxy_balancer:proxy
74
	proxy_balancer:slotmem_shm
77
	proxy_balancer:slotmem_shm
75
	proxy_connect:proxy
78
	proxy_connect:proxy
76
	proxy_ftp:proxy
79
	proxy_ftp:proxy
77
	proxy_hcheck:proxy
80
	proxy_hcheck:proxy
78
	proxy_hcheck:watchdog
81
	proxy_hcheck:watchdog
79
	proxy_html:proxy
82
	proxy_html:proxy
80
	proxy_html:xml2enc
83
	proxy_html:xml2enc
81
	proxy_http:proxy
84
	proxy_http:proxy
82
	proxy_http2:proxy
85
	proxy_http2:proxy
83
	proxy_scgi:proxy
86
	proxy_scgi:proxy
84
	proxy_uwsgi:proxy
87
	proxy_uwsgi:proxy
85
	proxy_fcgi:proxy
88
	proxy_fcgi:proxy
86
	proxy_wstunnel:proxy
89
	proxy_wstunnel:proxy
87
	session_cookie:session
90
	session_cookie:session
88
	session_dbd:dbd
91
	session_dbd:dbd
89
	session_dbd:session
92
	session_dbd:session
90
	socache_memcache:cache
93
	socache_memcache:cache
91
	substitute:filter
94
	substitute:filter
92
"
95
"
93
96
94
# module<->define mappings
97
# module<->define mappings
95
MODULE_DEFINES="
98
MODULE_DEFINES="
96
	auth_digest:AUTH_DIGEST
99
	auth_digest:AUTH_DIGEST
97
	authnz_ldap:AUTHNZ_LDAP
100
	authnz_ldap:AUTHNZ_LDAP
98
	cache:CACHE
101
	cache:CACHE
99
	cache_disk:CACHE
102
	cache_disk:CACHE
100
	cache_socache:CACHE
103
	cache_socache:CACHE
101
	dav:DAV
104
	dav:DAV
102
	dav_fs:DAV
105
	dav_fs:DAV
103
	dav_lock:DAV
106
	dav_lock:DAV
104
	file_cache:CACHE
107
	file_cache:CACHE
105
	http2:HTTP2
108
	http2:HTTP2
106
	info:INFO
109
	info:INFO
107
	ldap:LDAP
110
	ldap:LDAP
108
	lua:LUA
111
	lua:LUA
109
	md:SSL
112
	md:SSL
110
	proxy:PROXY
113
	proxy:PROXY
111
	proxy_ajp:PROXY
114
	proxy_ajp:PROXY
112
	proxy_balancer:PROXY
115
	proxy_balancer:PROXY
113
	proxy_connect:PROXY
116
	proxy_connect:PROXY
114
	proxy_fcgi:PROXY
117
	proxy_fcgi:PROXY
115
	proxy_ftp:PROXY
118
	proxy_ftp:PROXY
116
	proxy_hcheck:PROXY
119
	proxy_hcheck:PROXY
117
	proxy_html:PROXY
120
	proxy_html:PROXY
118
	proxy_http:PROXY
121
	proxy_http:PROXY
119
	proxy_http2:PROXY
122
	proxy_http2:PROXY
120
	proxy_scgi:PROXY
123
	proxy_scgi:PROXY
121
	proxy_uwsgi:PROXY
124
	proxy_uwsgi:PROXY
122
	proxy_wstunnel:PROXY
125
	proxy_wstunnel:PROXY
123
	socache_shmcb:SSL
126
	socache_shmcb:SSL
124
	socache_memcache:CACHE
127
	socache_memcache:CACHE
125
	ssl:SSL
128
	ssl:SSL
126
	status:STATUS
129
	status:STATUS
127
	suexec:SUEXEC
130
	suexec:SUEXEC
128
	systemd:SYSTEMD
131
	systemd:SYSTEMD
129
	userdir:USERDIR
132
	userdir:USERDIR
130
"
133
"
131
134
132
# critical modules for the default config
135
# critical modules for the default config
133
MODULE_CRITICAL="
136
MODULE_CRITICAL="
134
	authn_core
137
	authn_core
135
	authz_core
138
	authz_core
136
	authz_host
139
	authz_host
137
	dir
140
	dir
138
	mime
141
	mime
139
	unixd
142
	unixd
140
"
143
"
141
inherit apache-2 systemd tmpfiles toolchain-funcs
144
inherit apache-2 systemd tmpfiles toolchain-funcs
142
145
143
DESCRIPTION="The Apache Web Server"
146
DESCRIPTION="The Apache Web Server"
144
HOMEPAGE="https://httpd.apache.org/"
147
HOMEPAGE="https://httpd.apache.org/"
145
148
146
# some helper scripts are Apache-1.1, thus both are here
149
# some helper scripts are Apache-1.1, thus both are here
147
LICENSE="Apache-2.0 Apache-1.1"
150
LICENSE="Apache-2.0 Apache-1.1"
148
SLOT="2"
151
SLOT="2"
149
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x64-macos ~x64-solaris"
152
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x64-macos ~x64-solaris"
150
153
151
pkg_setup() {
154
pkg_setup() {
152
	# dependent critical modules which are not allowed in global scope due
155
	# dependent critical modules which are not allowed in global scope due
153
	# to USE flag conditionals (bug #499260)
156
	# to USE flag conditionals (bug #499260)
154
	use ssl && MODULE_CRITICAL+=" socache_shmcb"
157
	use ssl && MODULE_CRITICAL+=" socache_shmcb"
155
	use doc && MODULE_CRITICAL+=" alias negotiation setenvif"
158
	use doc && MODULE_CRITICAL+=" alias negotiation setenvif"
156
	apache-2_pkg_setup
159
	apache-2_pkg_setup
157
}
160
}
158
161
159
src_configure() {
162
src_configure() {
160
	# Brain dead check.
163
	# Brain dead check.
161
	tc-is-cross-compiler && export ap_cv_void_ptr_lt_long="no"
164
	tc-is-cross-compiler && export ap_cv_void_ptr_lt_long="no"
162
165
163
	apache-2_src_configure
166
	apache-2_src_configure
164
}
167
}
165
168
166
src_compile() {
169
src_compile() {
167
	if tc-is-cross-compiler ; then
170
	if tc-is-cross-compiler ; then
168
		# This header is the same across targets, so use the build compiler.
171
		# This header is the same across targets, so use the build compiler.
169
		pushd server >/dev/null
172
		pushd server >/dev/null
170
		emake gen_test_char
173
		emake gen_test_char
171
		tc-export_build_env BUILD_CC
174
		tc-export_build_env BUILD_CC
172
		${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_CPPFLAGS} ${BUILD_LDFLAGS} \
175
		${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_CPPFLAGS} ${BUILD_LDFLAGS} \
173
			gen_test_char.c -o gen_test_char $(apr-1-config --includes) || die
176
			gen_test_char.c -o gen_test_char $(apr-1-config --includes) || die
174
		popd >/dev/null
177
		popd >/dev/null
175
	fi
178
	fi
176
179
177
	default
180
	default
178
}
181
}
179
182
180
src_install() {
183
src_install() {
181
	apache-2_src_install
184
	apache-2_src_install
182
	local i
185
	local i
183
	local apache_tools_prune_list=(
186
	local apache_tools_prune_list=(
184
		/usr/bin/{htdigest,logresolve,htpasswd,htdbm,ab,httxt2dbm}
187
		/usr/bin/{htdigest,logresolve,htpasswd,htdbm,ab,httxt2dbm}
185
		/usr/sbin/{checkgid,fcgistarter,htcacheclean,rotatelogs}
188
		/usr/sbin/{checkgid,fcgistarter,htcacheclean,rotatelogs}
186
		/usr/share/man/man1/{logresolve.1,htdbm.1,htdigest.1,htpasswd.1,dbmmanage.1,ab.1}
189
		/usr/share/man/man1/{logresolve.1,htdbm.1,htdigest.1,htpasswd.1,dbmmanage.1,ab.1}
187
		/usr/share/man/man8/{rotatelogs.8,htcacheclean.8}
190
		/usr/share/man/man8/{rotatelogs.8,htcacheclean.8}
188
	)
191
	)
189
	for i in ${apache_tools_prune_list[@]} ; do
192
	for i in ${apache_tools_prune_list[@]} ; do
190
		rm "${ED}"/${i} || die "Failed to prune apache-tools bits"
193
		rm "${ED}"/${i} || die "Failed to prune apache-tools bits"
191
	done
194
	done
192
195
193
	# install apxs in /usr/bin (bug #502384) and put a symlink into the
196
	# install apxs in /usr/bin (bug #502384) and put a symlink into the
194
	# old location until all ebuilds and eclasses have been modified to
197
	# old location until all ebuilds and eclasses have been modified to
195
	# use the new location.
198
	# use the new location.
196
	dobin support/apxs
199
	dobin support/apxs
197
	use split-usr && dosym ../bin/apxs /usr/sbin/apxs
200
	use split-usr && dosym ../bin/apxs /usr/sbin/apxs
198
201
199
	# Note: wait for mod_systemd to be included in some forthcoming release,
202
	# Note: wait for mod_systemd to be included in some forthcoming release,
200
	# Then apache2.4.service can be used and systemd support controlled
203
	# Then apache2.4.service can be used and systemd support controlled
201
	# through --enable-systemd
204
	# through --enable-systemd
202
	systemd_newunit "${FILESDIR}/apache2.4-hardened.service" "apache2.service"
205
	systemd_newunit "${FILESDIR}/apache2.4-hardened.service" "apache2.service"
203
	dotmpfiles "${FILESDIR}/apache.conf"
206
	dotmpfiles "${FILESDIR}/apache.conf"
204
	#insinto /etc/apache2/modules.d
207
	#insinto /etc/apache2/modules.d
205
	#doins "${FILESDIR}/00_systemd.conf"
208
	#doins "${FILESDIR}/00_systemd.conf"
206
209
207
	# Install http2 module config
210
	# Install http2 module config
208
	insinto /etc/apache2/modules.d
211
	insinto /etc/apache2/modules.d
209
	doins "${FILESDIR}"/41_mod_http2.conf
212
	doins "${FILESDIR}"/41_mod_http2.conf
210
213
211
	# Fix path to apache libdir
214
	# Fix path to apache libdir
212
	sed "s|@LIBDIR@|$(get_libdir)|" -i "${ED}"/usr/sbin/apache2ctl || die
215
	sed "s|@LIBDIR@|$(get_libdir)|" -i "${ED}"/usr/sbin/apache2ctl || die
213
}
216
}
214
217
215
pkg_postinst() {
218
pkg_postinst() {
216
	apache-2_pkg_postinst || die "apache-2_pkg_postinst failed"
219
	apache-2_pkg_postinst || die "apache-2_pkg_postinst failed"
217
220
218
	tmpfiles_process apache.conf #662544
221
	tmpfiles_process apache.conf #662544
219
222
220
	# warnings that default config might not work out of the box
223
	# warnings that default config might not work out of the box
221
	local mod cmod
224
	local mod cmod
222
	for mod in ${MODULE_CRITICAL} ; do
225
	for mod in ${MODULE_CRITICAL} ; do
223
		if ! use "apache2_modules_${mod}"; then
226
		if ! use "apache2_modules_${mod}"; then
224
			echo
227
			echo
225
			ewarn "Warning: Critical module not installed!"
228
			ewarn "Warning: Critical module not installed!"
226
			ewarn "Modules 'authn_core', 'authz_core' and 'unixd'"
229
			ewarn "Modules 'authn_core', 'authz_core' and 'unixd'"
227
			ewarn "are highly recomended but might not be in the base profile yet."
230
			ewarn "are highly recomended but might not be in the base profile yet."
228
			ewarn "Default config for ssl needs module 'socache_shmcb'."
231
			ewarn "Default config for ssl needs module 'socache_shmcb'."
229
			ewarn "Enabling the following flags is highly recommended:"
232
			ewarn "Enabling the following flags is highly recommended:"
230
			for cmod in ${MODULE_CRITICAL} ; do
233
			for cmod in ${MODULE_CRITICAL} ; do
231
				use "apache2_modules_${cmod}" || \
234
				use "apache2_modules_${cmod}" || \
232
					ewarn "+ apache2_modules_${cmod}"
235
					ewarn "+ apache2_modules_${cmod}"
233
			done
236
			done
234
			echo
237
			echo
235
			break
238
			break
236
		fi
239
		fi
237
	done
240
	done
238
	# warning for proxy_balancer and missing load balancing scheduler
241
	# warning for proxy_balancer and missing load balancing scheduler
239
	if use apache2_modules_proxy_balancer; then
242
	if use apache2_modules_proxy_balancer; then
240
		local lbset=
243
		local lbset=
241
		for mod in lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat; do
244
		for mod in lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat; do
242
			if use "apache2_modules_${mod}"; then
245
			if use "apache2_modules_${mod}"; then
243
				lbset=1 && break
246
				lbset=1 && break
244
			fi
247
			fi
245
		done
248
		done
246
		if [[ ! ${lbset} ]] ; then
249
		if [[ ! ${lbset} ]] ; then
247
			echo
250
			echo
248
			ewarn "Info: Missing load balancing scheduler algorithm module"
251
			ewarn "Info: Missing load balancing scheduler algorithm module"
249
			ewarn "(They were split off from proxy_balancer in 2.3)"
252
			ewarn "(They were split off from proxy_balancer in 2.3)"
250
			ewarn "In order to get the ability of load balancing, at least"
253
			ewarn "In order to get the ability of load balancing, at least"
251
			ewarn "one of these modules has to be present:"
254
			ewarn "one of these modules has to be present:"
252
			ewarn "lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat"
255
			ewarn "lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat"
253
			echo
256
			echo
254
		fi
257
		fi
255
	fi
258
	fi
256
}
259
}
(-)a/www-servers/apache/apache-2.4.57.ebuild (+3 lines)
Lines 1-260 Link Here
1
# Copyright 1999-2023 Gentoo Authors
1
# Copyright 1999-2023 Gentoo Authors
2
# Distributed under the terms of the GNU General Public License v2
2
# Distributed under the terms of the GNU General Public License v2
3
3
4
EAPI=7
4
EAPI=7
5
5
6
# latest gentoo apache files
6
# latest gentoo apache files
7
GENTOO_PATCHSTAMP="20210212"
7
GENTOO_PATCHSTAMP="20210212"
8
GENTOO_DEVELOPER="polynomial-c"
8
GENTOO_DEVELOPER="polynomial-c"
9
GENTOO_PATCHNAME="gentoo-apache-2.4.46-r6"
9
GENTOO_PATCHNAME="gentoo-apache-2.4.46-r6"
10
10
11
# ancient hack: bug #502384
12
IUSE="split-usr"
13
11
# IUSE/USE_EXPAND magic
14
# IUSE/USE_EXPAND magic
12
IUSE_MPMS_FORK="prefork"
15
IUSE_MPMS_FORK="prefork"
13
IUSE_MPMS_THREAD="event worker"
16
IUSE_MPMS_THREAD="event worker"
14
17
15
# << obsolete modules:
18
# << obsolete modules:
16
# authn_default authz_default mem_cache
19
# authn_default authz_default mem_cache
17
# mem_cache is replaced by cache_disk
20
# mem_cache is replaced by cache_disk
18
# ?? buggy modules
21
# ?? buggy modules
19
# proxy_scgi: startup error: undefined symbol "ap_proxy_release_connection", no fix found
22
# proxy_scgi: startup error: undefined symbol "ap_proxy_release_connection", no fix found
20
# >> added modules for reason:
23
# >> added modules for reason:
21
# compat: compatibility with 2.2 access control
24
# compat: compatibility with 2.2 access control
22
# authz_host: new module for access control
25
# authz_host: new module for access control
23
# authn_core: functionality provided by authn_alias in previous versions
26
# authn_core: functionality provided by authn_alias in previous versions
24
# authz_core: new module, provides core authorization capabilities
27
# authz_core: new module, provides core authorization capabilities
25
# cache_disk: replacement for mem_cache
28
# cache_disk: replacement for mem_cache
26
# lbmethod_byrequests: Split off from mod_proxy_balancer in 2.3
29
# lbmethod_byrequests: Split off from mod_proxy_balancer in 2.3
27
# lbmethod_bytraffic: Split off from mod_proxy_balancer in 2.3
30
# lbmethod_bytraffic: Split off from mod_proxy_balancer in 2.3
28
# lbmethod_bybusyness: Split off from mod_proxy_balancer in 2.3
31
# lbmethod_bybusyness: Split off from mod_proxy_balancer in 2.3
29
# lbmethod_heartbeat: Split off from mod_proxy_balancer in 2.3
32
# lbmethod_heartbeat: Split off from mod_proxy_balancer in 2.3
30
# slotmem_shm: Slot-based shared memory provider (for lbmethod_byrequests).
33
# slotmem_shm: Slot-based shared memory provider (for lbmethod_byrequests).
31
# socache_shmcb: shared object cache provider. Default config with ssl needs it
34
# socache_shmcb: shared object cache provider. Default config with ssl needs it
32
# unixd: fixes startup error: Invalid command 'User'
35
# unixd: fixes startup error: Invalid command 'User'
33
IUSE_MODULES="access_compat actions alias asis auth_basic auth_digest auth_form
36
IUSE_MODULES="access_compat actions alias asis auth_basic auth_digest auth_form
34
authn_anon authn_core authn_dbd authn_dbm authn_file authn_socache authz_core
37
authn_anon authn_core authn_dbd authn_dbm authn_file authn_socache authz_core
35
authz_dbd authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex
38
authz_dbd authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex
36
brotli cache cache_disk cache_socache cern_meta charset_lite cgi cgid dav dav_fs dav_lock
39
brotli cache cache_disk cache_socache cern_meta charset_lite cgi cgid dav dav_fs dav_lock
37
dbd deflate dir dumpio env expires ext_filter file_cache filter headers http2
40
dbd deflate dir dumpio env expires ext_filter file_cache filter headers http2
38
ident imagemap include info lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness
41
ident imagemap include info lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness
39
lbmethod_heartbeat log_config log_forensic logio lua macro md mime mime_magic negotiation
42
lbmethod_heartbeat log_config log_forensic logio lua macro md mime mime_magic negotiation
40
proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_hcheck proxy_html proxy_http proxy_scgi
43
proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_hcheck proxy_html proxy_http proxy_scgi
41
proxy_http2 proxy_fcgi proxy_uwsgi proxy_wstunnel rewrite ratelimit remoteip reqtimeout
44
proxy_http2 proxy_fcgi proxy_uwsgi proxy_wstunnel rewrite ratelimit remoteip reqtimeout
42
session session_cookie session_crypto session_dbd setenvif slotmem_shm socache_memcache
45
session session_cookie session_crypto session_dbd setenvif slotmem_shm socache_memcache
43
socache_shmcb speling status substitute systemd tls unique_id userdir usertrack
46
socache_shmcb speling status substitute systemd tls unique_id userdir usertrack
44
unixd version vhost_alias watchdog xml2enc"
47
unixd version vhost_alias watchdog xml2enc"
45
# The following are also in the source as of this version, but are not available
48
# The following are also in the source as of this version, but are not available
46
# for user selection:
49
# for user selection:
47
# bucketeer case_filter case_filter_in echo http isapi optional_fn_export
50
# bucketeer case_filter case_filter_in echo http isapi optional_fn_export
48
# optional_fn_import optional_hook_export optional_hook_import
51
# optional_fn_import optional_hook_export optional_hook_import
49
52
50
# inter-module dependencies
53
# inter-module dependencies
51
# TODO: this may still be incomplete
54
# TODO: this may still be incomplete
52
MODULE_DEPENDS="
55
MODULE_DEPENDS="
53
	auth_form:session
56
	auth_form:session
54
	brotli:filter
57
	brotli:filter
55
	dav_fs:dav
58
	dav_fs:dav
56
	dav_lock:dav
59
	dav_lock:dav
57
	deflate:filter
60
	deflate:filter
58
	cache_disk:cache
61
	cache_disk:cache
59
	ext_filter:filter
62
	ext_filter:filter
60
	file_cache:cache
63
	file_cache:cache
61
	lbmethod_byrequests:proxy_balancer
64
	lbmethod_byrequests:proxy_balancer
62
	lbmethod_byrequests:slotmem_shm
65
	lbmethod_byrequests:slotmem_shm
63
	lbmethod_bytraffic:proxy_balancer
66
	lbmethod_bytraffic:proxy_balancer
64
	lbmethod_bybusyness:proxy_balancer
67
	lbmethod_bybusyness:proxy_balancer
65
	lbmethod_heartbeat:proxy_balancer
68
	lbmethod_heartbeat:proxy_balancer
66
	log_forensic:log_config
69
	log_forensic:log_config
67
	logio:log_config
70
	logio:log_config
68
	cache_disk:cache
71
	cache_disk:cache
69
	cache_socache:cache
72
	cache_socache:cache
70
	md:watchdog
73
	md:watchdog
71
	mime_magic:mime
74
	mime_magic:mime
72
	proxy_ajp:proxy
75
	proxy_ajp:proxy
73
	proxy_balancer:proxy
76
	proxy_balancer:proxy
74
	proxy_balancer:slotmem_shm
77
	proxy_balancer:slotmem_shm
75
	proxy_connect:proxy
78
	proxy_connect:proxy
76
	proxy_ftp:proxy
79
	proxy_ftp:proxy
77
	proxy_hcheck:proxy
80
	proxy_hcheck:proxy
78
	proxy_hcheck:watchdog
81
	proxy_hcheck:watchdog
79
	proxy_html:proxy
82
	proxy_html:proxy
80
	proxy_html:xml2enc
83
	proxy_html:xml2enc
81
	proxy_http:proxy
84
	proxy_http:proxy
82
	proxy_http2:proxy
85
	proxy_http2:proxy
83
	proxy_scgi:proxy
86
	proxy_scgi:proxy
84
	proxy_uwsgi:proxy
87
	proxy_uwsgi:proxy
85
	proxy_fcgi:proxy
88
	proxy_fcgi:proxy
86
	proxy_wstunnel:proxy
89
	proxy_wstunnel:proxy
87
	session_cookie:session
90
	session_cookie:session
88
	session_dbd:dbd
91
	session_dbd:dbd
89
	session_dbd:session
92
	session_dbd:session
90
	socache_memcache:cache
93
	socache_memcache:cache
91
	substitute:filter
94
	substitute:filter
92
"
95
"
93
96
94
# module<->define mappings
97
# module<->define mappings
95
MODULE_DEFINES="
98
MODULE_DEFINES="
96
	auth_digest:AUTH_DIGEST
99
	auth_digest:AUTH_DIGEST
97
	authnz_ldap:AUTHNZ_LDAP
100
	authnz_ldap:AUTHNZ_LDAP
98
	cache:CACHE
101
	cache:CACHE
99
	cache_disk:CACHE
102
	cache_disk:CACHE
100
	cache_socache:CACHE
103
	cache_socache:CACHE
101
	dav:DAV
104
	dav:DAV
102
	dav_fs:DAV
105
	dav_fs:DAV
103
	dav_lock:DAV
106
	dav_lock:DAV
104
	file_cache:CACHE
107
	file_cache:CACHE
105
	http2:HTTP2
108
	http2:HTTP2
106
	info:INFO
109
	info:INFO
107
	ldap:LDAP
110
	ldap:LDAP
108
	lua:LUA
111
	lua:LUA
109
	md:SSL
112
	md:SSL
110
	proxy:PROXY
113
	proxy:PROXY
111
	proxy_ajp:PROXY
114
	proxy_ajp:PROXY
112
	proxy_balancer:PROXY
115
	proxy_balancer:PROXY
113
	proxy_connect:PROXY
116
	proxy_connect:PROXY
114
	proxy_ftp:PROXY
117
	proxy_ftp:PROXY
115
	proxy_html:PROXY
118
	proxy_html:PROXY
116
	proxy_http:PROXY
119
	proxy_http:PROXY
117
	proxy_hcheck:PROXY
120
	proxy_hcheck:PROXY
118
	proxy_fcgi:PROXY
121
	proxy_fcgi:PROXY
119
	proxy_scgi:PROXY
122
	proxy_scgi:PROXY
120
	proxy_wstunnel:PROXY
123
	proxy_wstunnel:PROXY
121
	socache_shmcb:SSL
124
	socache_shmcb:SSL
122
	socache_memcache:CACHE
125
	socache_memcache:CACHE
123
	ssl:SSL
126
	ssl:SSL
124
	status:STATUS
127
	status:STATUS
125
	suexec:SUEXEC
128
	suexec:SUEXEC
126
	systemd:SYSTEMD
129
	systemd:SYSTEMD
127
	userdir:USERDIR
130
	userdir:USERDIR
128
"
131
"
129
132
130
# critical modules for the default config
133
# critical modules for the default config
131
MODULE_CRITICAL="
134
MODULE_CRITICAL="
132
	authn_core
135
	authn_core
133
	authz_core
136
	authz_core
134
	authz_host
137
	authz_host
135
	dir
138
	dir
136
	mime
139
	mime
137
	unixd
140
	unixd
138
"
141
"
139
inherit apache-2 systemd tmpfiles toolchain-funcs
142
inherit apache-2 systemd tmpfiles toolchain-funcs
140
143
141
DESCRIPTION="The Apache Web Server"
144
DESCRIPTION="The Apache Web Server"
142
HOMEPAGE="https://httpd.apache.org/"
145
HOMEPAGE="https://httpd.apache.org/"
143
146
144
# some helper scripts are Apache-1.1, thus both are here
147
# some helper scripts are Apache-1.1, thus both are here
145
LICENSE="Apache-2.0 Apache-1.1"
148
LICENSE="Apache-2.0 Apache-1.1"
146
SLOT="2"
149
SLOT="2"
147
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x64-macos ~x64-solaris"
150
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x64-macos ~x64-solaris"
148
151
149
PATCHES=(
152
PATCHES=(
150
	"${FILESDIR}"/${PN}-2.4.54-no-which.patch # bug #844868
153
	"${FILESDIR}"/${PN}-2.4.54-no-which.patch # bug #844868
151
	"${FILESDIR}"/${PN}-2.4.54-libtool.patch # bug #858836
154
	"${FILESDIR}"/${PN}-2.4.54-libtool.patch # bug #858836
152
	"${FILESDIR}"/${P}-rustls-ffi-0.10.0.patch # bug #906523
155
	"${FILESDIR}"/${P}-rustls-ffi-0.10.0.patch # bug #906523
153
)
156
)
154
157
155
pkg_setup() {
158
pkg_setup() {
156
	# dependent critical modules which are not allowed in global scope due
159
	# dependent critical modules which are not allowed in global scope due
157
	# to USE flag conditionals (bug #499260)
160
	# to USE flag conditionals (bug #499260)
158
	use ssl && MODULE_CRITICAL+=" socache_shmcb"
161
	use ssl && MODULE_CRITICAL+=" socache_shmcb"
159
	use doc && MODULE_CRITICAL+=" alias negotiation setenvif"
162
	use doc && MODULE_CRITICAL+=" alias negotiation setenvif"
160
	apache-2_pkg_setup
163
	apache-2_pkg_setup
161
}
164
}
162
165
163
src_configure() {
166
src_configure() {
164
	# Brain dead check.
167
	# Brain dead check.
165
	tc-is-cross-compiler && export ap_cv_void_ptr_lt_long="no"
168
	tc-is-cross-compiler && export ap_cv_void_ptr_lt_long="no"
166
169
167
	apache-2_src_configure
170
	apache-2_src_configure
168
}
171
}
169
172
170
src_compile() {
173
src_compile() {
171
	if tc-is-cross-compiler ; then
174
	if tc-is-cross-compiler ; then
172
		# This header is the same across targets, so use the build compiler.
175
		# This header is the same across targets, so use the build compiler.
173
		pushd server >/dev/null
176
		pushd server >/dev/null
174
		emake gen_test_char
177
		emake gen_test_char
175
		tc-export_build_env BUILD_CC
178
		tc-export_build_env BUILD_CC
176
		${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_CPPFLAGS} ${BUILD_LDFLAGS} \
179
		${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_CPPFLAGS} ${BUILD_LDFLAGS} \
177
			gen_test_char.c -o gen_test_char $(apr-1-config --includes) || die
180
			gen_test_char.c -o gen_test_char $(apr-1-config --includes) || die
178
		popd >/dev/null
181
		popd >/dev/null
179
	fi
182
	fi
180
183
181
	default
184
	default
182
}
185
}
183
186
184
src_install() {
187
src_install() {
185
	apache-2_src_install
188
	apache-2_src_install
186
	local i
189
	local i
187
	local apache_tools_prune_list=(
190
	local apache_tools_prune_list=(
188
		/usr/bin/{htdigest,logresolve,htpasswd,htdbm,ab,httxt2dbm}
191
		/usr/bin/{htdigest,logresolve,htpasswd,htdbm,ab,httxt2dbm}
189
		/usr/sbin/{checkgid,fcgistarter,htcacheclean,rotatelogs}
192
		/usr/sbin/{checkgid,fcgistarter,htcacheclean,rotatelogs}
190
		/usr/share/man/man1/{logresolve.1,htdbm.1,htdigest.1,htpasswd.1,dbmmanage.1,ab.1}
193
		/usr/share/man/man1/{logresolve.1,htdbm.1,htdigest.1,htpasswd.1,dbmmanage.1,ab.1}
191
		/usr/share/man/man8/{rotatelogs.8,htcacheclean.8}
194
		/usr/share/man/man8/{rotatelogs.8,htcacheclean.8}
192
	)
195
	)
193
	for i in ${apache_tools_prune_list[@]} ; do
196
	for i in ${apache_tools_prune_list[@]} ; do
194
		rm "${ED}"/${i} || die "Failed to prune apache-tools bits"
197
		rm "${ED}"/${i} || die "Failed to prune apache-tools bits"
195
	done
198
	done
196
199
197
	# install apxs in /usr/bin (bug #502384) and put a symlink into the
200
	# install apxs in /usr/bin (bug #502384) and put a symlink into the
198
	# old location until all ebuilds and eclasses have been modified to
201
	# old location until all ebuilds and eclasses have been modified to
199
	# use the new location.
202
	# use the new location.
200
	dobin support/apxs
203
	dobin support/apxs
201
	use split-usr && dosym ../bin/apxs /usr/sbin/apxs
204
	use split-usr && dosym ../bin/apxs /usr/sbin/apxs
202
205
203
	# Note: wait for mod_systemd to be included in some forthcoming release,
206
	# Note: wait for mod_systemd to be included in some forthcoming release,
204
	# Then apache2.4.service can be used and systemd support controlled
207
	# Then apache2.4.service can be used and systemd support controlled
205
	# through --enable-systemd
208
	# through --enable-systemd
206
	systemd_newunit "${FILESDIR}/apache2.4-hardened.service" "apache2.service"
209
	systemd_newunit "${FILESDIR}/apache2.4-hardened.service" "apache2.service"
207
	dotmpfiles "${FILESDIR}/apache.conf"
210
	dotmpfiles "${FILESDIR}/apache.conf"
208
	#insinto /etc/apache2/modules.d
211
	#insinto /etc/apache2/modules.d
209
	#doins "${FILESDIR}/00_systemd.conf"
212
	#doins "${FILESDIR}/00_systemd.conf"
210
213
211
	# Install http2 module config
214
	# Install http2 module config
212
	insinto /etc/apache2/modules.d
215
	insinto /etc/apache2/modules.d
213
	doins "${FILESDIR}"/41_mod_http2.conf
216
	doins "${FILESDIR}"/41_mod_http2.conf
214
217
215
	# Fix path to apache libdir
218
	# Fix path to apache libdir
216
	sed "s|@LIBDIR@|$(get_libdir)|" -i "${ED}"/usr/sbin/apache2ctl || die
219
	sed "s|@LIBDIR@|$(get_libdir)|" -i "${ED}"/usr/sbin/apache2ctl || die
217
}
220
}
218
221
219
pkg_postinst() {
222
pkg_postinst() {
220
	apache-2_pkg_postinst || die "apache-2_pkg_postinst failed"
223
	apache-2_pkg_postinst || die "apache-2_pkg_postinst failed"
221
224
222
	tmpfiles_process apache.conf #662544
225
	tmpfiles_process apache.conf #662544
223
226
224
	# warnings that default config might not work out of the box
227
	# warnings that default config might not work out of the box
225
	local mod cmod
228
	local mod cmod
226
	for mod in ${MODULE_CRITICAL} ; do
229
	for mod in ${MODULE_CRITICAL} ; do
227
		if ! use "apache2_modules_${mod}"; then
230
		if ! use "apache2_modules_${mod}"; then
228
			echo
231
			echo
229
			ewarn "Warning: Critical module not installed!"
232
			ewarn "Warning: Critical module not installed!"
230
			ewarn "Modules 'authn_core', 'authz_core' and 'unixd'"
233
			ewarn "Modules 'authn_core', 'authz_core' and 'unixd'"
231
			ewarn "are highly recomended but might not be in the base profile yet."
234
			ewarn "are highly recomended but might not be in the base profile yet."
232
			ewarn "Default config for ssl needs module 'socache_shmcb'."
235
			ewarn "Default config for ssl needs module 'socache_shmcb'."
233
			ewarn "Enabling the following flags is highly recommended:"
236
			ewarn "Enabling the following flags is highly recommended:"
234
			for cmod in ${MODULE_CRITICAL} ; do
237
			for cmod in ${MODULE_CRITICAL} ; do
235
				use "apache2_modules_${cmod}" || \
238
				use "apache2_modules_${cmod}" || \
236
					ewarn "+ apache2_modules_${cmod}"
239
					ewarn "+ apache2_modules_${cmod}"
237
			done
240
			done
238
			echo
241
			echo
239
			break
242
			break
240
		fi
243
		fi
241
	done
244
	done
242
	# warning for proxy_balancer and missing load balancing scheduler
245
	# warning for proxy_balancer and missing load balancing scheduler
243
	if use apache2_modules_proxy_balancer; then
246
	if use apache2_modules_proxy_balancer; then
244
		local lbset=
247
		local lbset=
245
		for mod in lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat; do
248
		for mod in lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat; do
246
			if use "apache2_modules_${mod}"; then
249
			if use "apache2_modules_${mod}"; then
247
				lbset=1 && break
250
				lbset=1 && break
248
			fi
251
			fi
249
		done
252
		done
250
		if [[ ! ${lbset} ]] ; then
253
		if [[ ! ${lbset} ]] ; then
251
			echo
254
			echo
252
			ewarn "Info: Missing load balancing scheduler algorithm module"
255
			ewarn "Info: Missing load balancing scheduler algorithm module"
253
			ewarn "(They were split off from proxy_balancer in 2.3)"
256
			ewarn "(They were split off from proxy_balancer in 2.3)"
254
			ewarn "In order to get the ability of load balancing, at least"
257
			ewarn "In order to get the ability of load balancing, at least"
255
			ewarn "one of these modules has to be present:"
258
			ewarn "one of these modules has to be present:"
256
			ewarn "lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat"
259
			ewarn "lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat"
257
			echo
260
			echo
258
		fi
261
		fi
259
	fi
262
	fi
260
}
263
}
(-)a/www-servers/apache/apache-2.4.58-r1.ebuild (+3 lines)
Lines 1-256 Link Here
1
# Copyright 1999-2023 Gentoo Authors
1
# Copyright 1999-2023 Gentoo Authors
2
# Distributed under the terms of the GNU General Public License v2
2
# Distributed under the terms of the GNU General Public License v2
3
3
4
EAPI=7
4
EAPI=7
5
5
6
# latest gentoo apache files
6
# latest gentoo apache files
7
GENTOO_PATCHSTAMP="20231019"
7
GENTOO_PATCHSTAMP="20231019"
8
GENTOO_DEVELOPER="graaff"
8
GENTOO_DEVELOPER="graaff"
9
GENTOO_PATCHNAME="gentoo-apache-2.4.58"
9
GENTOO_PATCHNAME="gentoo-apache-2.4.58"
10
10
11
# ancient hack: bug #502384
12
IUSE="split-usr"
13
11
# IUSE/USE_EXPAND magic
14
# IUSE/USE_EXPAND magic
12
IUSE_MPMS_FORK="prefork"
15
IUSE_MPMS_FORK="prefork"
13
IUSE_MPMS_THREAD="event worker"
16
IUSE_MPMS_THREAD="event worker"
14
17
15
# << obsolete modules:
18
# << obsolete modules:
16
# authn_default authz_default mem_cache
19
# authn_default authz_default mem_cache
17
# mem_cache is replaced by cache_disk
20
# mem_cache is replaced by cache_disk
18
# ?? buggy modules
21
# ?? buggy modules
19
# proxy_scgi: startup error: undefined symbol "ap_proxy_release_connection", no fix found
22
# proxy_scgi: startup error: undefined symbol "ap_proxy_release_connection", no fix found
20
# >> added modules for reason:
23
# >> added modules for reason:
21
# compat: compatibility with 2.2 access control
24
# compat: compatibility with 2.2 access control
22
# authz_host: new module for access control
25
# authz_host: new module for access control
23
# authn_core: functionality provided by authn_alias in previous versions
26
# authn_core: functionality provided by authn_alias in previous versions
24
# authz_core: new module, provides core authorization capabilities
27
# authz_core: new module, provides core authorization capabilities
25
# cache_disk: replacement for mem_cache
28
# cache_disk: replacement for mem_cache
26
# lbmethod_byrequests: Split off from mod_proxy_balancer in 2.3
29
# lbmethod_byrequests: Split off from mod_proxy_balancer in 2.3
27
# lbmethod_bytraffic: Split off from mod_proxy_balancer in 2.3
30
# lbmethod_bytraffic: Split off from mod_proxy_balancer in 2.3
28
# lbmethod_bybusyness: Split off from mod_proxy_balancer in 2.3
31
# lbmethod_bybusyness: Split off from mod_proxy_balancer in 2.3
29
# lbmethod_heartbeat: Split off from mod_proxy_balancer in 2.3
32
# lbmethod_heartbeat: Split off from mod_proxy_balancer in 2.3
30
# slotmem_shm: Slot-based shared memory provider (for lbmethod_byrequests).
33
# slotmem_shm: Slot-based shared memory provider (for lbmethod_byrequests).
31
# socache_shmcb: shared object cache provider. Default config with ssl needs it
34
# socache_shmcb: shared object cache provider. Default config with ssl needs it
32
# unixd: fixes startup error: Invalid command 'User'
35
# unixd: fixes startup error: Invalid command 'User'
33
IUSE_MODULES="access_compat actions alias allowmethods asis auth_basic auth_digest auth_form
36
IUSE_MODULES="access_compat actions alias allowmethods asis auth_basic auth_digest auth_form
34
authn_anon authn_core authn_dbd authn_dbm authn_file authn_socache authz_core
37
authn_anon authn_core authn_dbd authn_dbm authn_file authn_socache authz_core
35
authz_dbd authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex
38
authz_dbd authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex
36
brotli cache cache_disk cache_socache cern_meta charset_lite cgi cgid dav dav_fs dav_lock
39
brotli cache cache_disk cache_socache cern_meta charset_lite cgi cgid dav dav_fs dav_lock
37
dbd deflate dir dumpio env expires ext_filter file_cache filter headers http2
40
dbd deflate dir dumpio env expires ext_filter file_cache filter headers http2
38
ident imagemap include info lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness
41
ident imagemap include info lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness
39
lbmethod_heartbeat log_config log_forensic logio lua macro md mime mime_magic negotiation
42
lbmethod_heartbeat log_config log_forensic logio lua macro md mime mime_magic negotiation
40
proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_hcheck proxy_html proxy_http proxy_scgi
43
proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_hcheck proxy_html proxy_http proxy_scgi
41
proxy_http2 proxy_fcgi proxy_uwsgi proxy_wstunnel rewrite ratelimit remoteip reqtimeout
44
proxy_http2 proxy_fcgi proxy_uwsgi proxy_wstunnel rewrite ratelimit remoteip reqtimeout
42
session session_cookie session_crypto session_dbd setenvif slotmem_shm socache_memcache
45
session session_cookie session_crypto session_dbd setenvif slotmem_shm socache_memcache
43
socache_shmcb speling status substitute systemd tls unique_id userdir usertrack
46
socache_shmcb speling status substitute systemd tls unique_id userdir usertrack
44
unixd version vhost_alias watchdog xml2enc"
47
unixd version vhost_alias watchdog xml2enc"
45
# The following are also in the source as of this version, but are not available
48
# The following are also in the source as of this version, but are not available
46
# for user selection:
49
# for user selection:
47
# bucketeer case_filter case_filter_in echo http isapi optional_fn_export
50
# bucketeer case_filter case_filter_in echo http isapi optional_fn_export
48
# optional_fn_import optional_hook_export optional_hook_import
51
# optional_fn_import optional_hook_export optional_hook_import
49
52
50
# inter-module dependencies
53
# inter-module dependencies
51
# TODO: this may still be incomplete
54
# TODO: this may still be incomplete
52
MODULE_DEPENDS="
55
MODULE_DEPENDS="
53
	auth_form:session
56
	auth_form:session
54
	brotli:filter
57
	brotli:filter
55
	dav_fs:dav
58
	dav_fs:dav
56
	dav_lock:dav
59
	dav_lock:dav
57
	deflate:filter
60
	deflate:filter
58
	cache_disk:cache
61
	cache_disk:cache
59
	ext_filter:filter
62
	ext_filter:filter
60
	file_cache:cache
63
	file_cache:cache
61
	lbmethod_byrequests:proxy_balancer
64
	lbmethod_byrequests:proxy_balancer
62
	lbmethod_byrequests:slotmem_shm
65
	lbmethod_byrequests:slotmem_shm
63
	lbmethod_bytraffic:proxy_balancer
66
	lbmethod_bytraffic:proxy_balancer
64
	lbmethod_bybusyness:proxy_balancer
67
	lbmethod_bybusyness:proxy_balancer
65
	lbmethod_heartbeat:proxy_balancer
68
	lbmethod_heartbeat:proxy_balancer
66
	log_forensic:log_config
69
	log_forensic:log_config
67
	logio:log_config
70
	logio:log_config
68
	cache_disk:cache
71
	cache_disk:cache
69
	cache_socache:cache
72
	cache_socache:cache
70
	md:watchdog
73
	md:watchdog
71
	mime_magic:mime
74
	mime_magic:mime
72
	proxy_ajp:proxy
75
	proxy_ajp:proxy
73
	proxy_balancer:proxy
76
	proxy_balancer:proxy
74
	proxy_balancer:slotmem_shm
77
	proxy_balancer:slotmem_shm
75
	proxy_connect:proxy
78
	proxy_connect:proxy
76
	proxy_ftp:proxy
79
	proxy_ftp:proxy
77
	proxy_hcheck:proxy
80
	proxy_hcheck:proxy
78
	proxy_hcheck:watchdog
81
	proxy_hcheck:watchdog
79
	proxy_html:proxy
82
	proxy_html:proxy
80
	proxy_html:xml2enc
83
	proxy_html:xml2enc
81
	proxy_http:proxy
84
	proxy_http:proxy
82
	proxy_http2:proxy
85
	proxy_http2:proxy
83
	proxy_scgi:proxy
86
	proxy_scgi:proxy
84
	proxy_uwsgi:proxy
87
	proxy_uwsgi:proxy
85
	proxy_fcgi:proxy
88
	proxy_fcgi:proxy
86
	proxy_wstunnel:proxy
89
	proxy_wstunnel:proxy
87
	session_cookie:session
90
	session_cookie:session
88
	session_dbd:dbd
91
	session_dbd:dbd
89
	session_dbd:session
92
	session_dbd:session
90
	socache_memcache:cache
93
	socache_memcache:cache
91
	substitute:filter
94
	substitute:filter
92
"
95
"
93
96
94
# module<->define mappings
97
# module<->define mappings
95
MODULE_DEFINES="
98
MODULE_DEFINES="
96
	auth_digest:AUTH_DIGEST
99
	auth_digest:AUTH_DIGEST
97
	authnz_ldap:AUTHNZ_LDAP
100
	authnz_ldap:AUTHNZ_LDAP
98
	cache:CACHE
101
	cache:CACHE
99
	cache_disk:CACHE
102
	cache_disk:CACHE
100
	cache_socache:CACHE
103
	cache_socache:CACHE
101
	dav:DAV
104
	dav:DAV
102
	dav_fs:DAV
105
	dav_fs:DAV
103
	dav_lock:DAV
106
	dav_lock:DAV
104
	file_cache:CACHE
107
	file_cache:CACHE
105
	http2:HTTP2
108
	http2:HTTP2
106
	info:INFO
109
	info:INFO
107
	ldap:LDAP
110
	ldap:LDAP
108
	lua:LUA
111
	lua:LUA
109
	md:SSL
112
	md:SSL
110
	proxy:PROXY
113
	proxy:PROXY
111
	proxy_ajp:PROXY
114
	proxy_ajp:PROXY
112
	proxy_balancer:PROXY
115
	proxy_balancer:PROXY
113
	proxy_connect:PROXY
116
	proxy_connect:PROXY
114
	proxy_fcgi:PROXY
117
	proxy_fcgi:PROXY
115
	proxy_ftp:PROXY
118
	proxy_ftp:PROXY
116
	proxy_hcheck:PROXY
119
	proxy_hcheck:PROXY
117
	proxy_html:PROXY
120
	proxy_html:PROXY
118
	proxy_http:PROXY
121
	proxy_http:PROXY
119
	proxy_http2:PROXY
122
	proxy_http2:PROXY
120
	proxy_scgi:PROXY
123
	proxy_scgi:PROXY
121
	proxy_uwsgi:PROXY
124
	proxy_uwsgi:PROXY
122
	proxy_wstunnel:PROXY
125
	proxy_wstunnel:PROXY
123
	socache_shmcb:SSL
126
	socache_shmcb:SSL
124
	socache_memcache:CACHE
127
	socache_memcache:CACHE
125
	ssl:SSL
128
	ssl:SSL
126
	status:STATUS
129
	status:STATUS
127
	suexec:SUEXEC
130
	suexec:SUEXEC
128
	systemd:SYSTEMD
131
	systemd:SYSTEMD
129
	userdir:USERDIR
132
	userdir:USERDIR
130
"
133
"
131
134
132
# critical modules for the default config
135
# critical modules for the default config
133
MODULE_CRITICAL="
136
MODULE_CRITICAL="
134
	authn_core
137
	authn_core
135
	authz_core
138
	authz_core
136
	authz_host
139
	authz_host
137
	dir
140
	dir
138
	mime
141
	mime
139
	unixd
142
	unixd
140
"
143
"
141
inherit apache-2 systemd tmpfiles toolchain-funcs
144
inherit apache-2 systemd tmpfiles toolchain-funcs
142
145
143
DESCRIPTION="The Apache Web Server"
146
DESCRIPTION="The Apache Web Server"
144
HOMEPAGE="https://httpd.apache.org/"
147
HOMEPAGE="https://httpd.apache.org/"
145
148
146
# some helper scripts are Apache-1.1, thus both are here
149
# some helper scripts are Apache-1.1, thus both are here
147
LICENSE="Apache-2.0 Apache-1.1"
150
LICENSE="Apache-2.0 Apache-1.1"
148
SLOT="2"
151
SLOT="2"
149
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x64-macos ~x64-solaris"
152
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x64-macos ~x64-solaris"
150
153
151
pkg_setup() {
154
pkg_setup() {
152
	# dependent critical modules which are not allowed in global scope due
155
	# dependent critical modules which are not allowed in global scope due
153
	# to USE flag conditionals (bug #499260)
156
	# to USE flag conditionals (bug #499260)
154
	use ssl && MODULE_CRITICAL+=" socache_shmcb"
157
	use ssl && MODULE_CRITICAL+=" socache_shmcb"
155
	use doc && MODULE_CRITICAL+=" alias negotiation setenvif"
158
	use doc && MODULE_CRITICAL+=" alias negotiation setenvif"
156
	apache-2_pkg_setup
159
	apache-2_pkg_setup
157
}
160
}
158
161
159
src_configure() {
162
src_configure() {
160
	# Brain dead check.
163
	# Brain dead check.
161
	tc-is-cross-compiler && export ap_cv_void_ptr_lt_long="no"
164
	tc-is-cross-compiler && export ap_cv_void_ptr_lt_long="no"
162
165
163
	apache-2_src_configure
166
	apache-2_src_configure
164
}
167
}
165
168
166
src_compile() {
169
src_compile() {
167
	if tc-is-cross-compiler ; then
170
	if tc-is-cross-compiler ; then
168
		# This header is the same across targets, so use the build compiler.
171
		# This header is the same across targets, so use the build compiler.
169
		pushd server >/dev/null
172
		pushd server >/dev/null
170
		emake gen_test_char
173
		emake gen_test_char
171
		tc-export_build_env BUILD_CC
174
		tc-export_build_env BUILD_CC
172
		${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_CPPFLAGS} ${BUILD_LDFLAGS} \
175
		${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_CPPFLAGS} ${BUILD_LDFLAGS} \
173
			gen_test_char.c -o gen_test_char $(apr-1-config --includes) || die
176
			gen_test_char.c -o gen_test_char $(apr-1-config --includes) || die
174
		popd >/dev/null
177
		popd >/dev/null
175
	fi
178
	fi
176
179
177
	default
180
	default
178
}
181
}
179
182
180
src_install() {
183
src_install() {
181
	apache-2_src_install
184
	apache-2_src_install
182
	local i
185
	local i
183
	local apache_tools_prune_list=(
186
	local apache_tools_prune_list=(
184
		/usr/bin/{htdigest,logresolve,htpasswd,htdbm,ab,httxt2dbm}
187
		/usr/bin/{htdigest,logresolve,htpasswd,htdbm,ab,httxt2dbm}
185
		/usr/sbin/{checkgid,fcgistarter,htcacheclean,rotatelogs}
188
		/usr/sbin/{checkgid,fcgistarter,htcacheclean,rotatelogs}
186
		/usr/share/man/man1/{logresolve.1,htdbm.1,htdigest.1,htpasswd.1,dbmmanage.1,ab.1}
189
		/usr/share/man/man1/{logresolve.1,htdbm.1,htdigest.1,htpasswd.1,dbmmanage.1,ab.1}
187
		/usr/share/man/man8/{rotatelogs.8,htcacheclean.8}
190
		/usr/share/man/man8/{rotatelogs.8,htcacheclean.8}
188
	)
191
	)
189
	for i in ${apache_tools_prune_list[@]} ; do
192
	for i in ${apache_tools_prune_list[@]} ; do
190
		rm "${ED}"/${i} || die "Failed to prune apache-tools bits"
193
		rm "${ED}"/${i} || die "Failed to prune apache-tools bits"
191
	done
194
	done
192
195
193
	# install apxs in /usr/bin (bug #502384) and put a symlink into the
196
	# install apxs in /usr/bin (bug #502384) and put a symlink into the
194
	# old location until all ebuilds and eclasses have been modified to
197
	# old location until all ebuilds and eclasses have been modified to
195
	# use the new location.
198
	# use the new location.
196
	dobin support/apxs
199
	dobin support/apxs
197
	use split-usr && dosym ../bin/apxs /usr/sbin/apxs
200
	use split-usr && dosym ../bin/apxs /usr/sbin/apxs
198
201
199
	# Note: wait for mod_systemd to be included in some forthcoming release,
202
	# Note: wait for mod_systemd to be included in some forthcoming release,
200
	# Then apache2.4.service can be used and systemd support controlled
203
	# Then apache2.4.service can be used and systemd support controlled
201
	# through --enable-systemd
204
	# through --enable-systemd
202
	systemd_newunit "${FILESDIR}/apache2.4-hardened.service" "apache2.service"
205
	systemd_newunit "${FILESDIR}/apache2.4-hardened.service" "apache2.service"
203
	dotmpfiles "${FILESDIR}/apache.conf"
206
	dotmpfiles "${FILESDIR}/apache.conf"
204
	#insinto /etc/apache2/modules.d
207
	#insinto /etc/apache2/modules.d
205
	#doins "${FILESDIR}/00_systemd.conf"
208
	#doins "${FILESDIR}/00_systemd.conf"
206
209
207
	# Install http2 module config
210
	# Install http2 module config
208
	insinto /etc/apache2/modules.d
211
	insinto /etc/apache2/modules.d
209
	doins "${FILESDIR}"/41_mod_http2.conf
212
	doins "${FILESDIR}"/41_mod_http2.conf
210
213
211
	# Fix path to apache libdir
214
	# Fix path to apache libdir
212
	sed "s|@LIBDIR@|$(get_libdir)|" -i "${ED}"/usr/sbin/apache2ctl || die
215
	sed "s|@LIBDIR@|$(get_libdir)|" -i "${ED}"/usr/sbin/apache2ctl || die
213
}
216
}
214
217
215
pkg_postinst() {
218
pkg_postinst() {
216
	apache-2_pkg_postinst || die "apache-2_pkg_postinst failed"
219
	apache-2_pkg_postinst || die "apache-2_pkg_postinst failed"
217
220
218
	tmpfiles_process apache.conf #662544
221
	tmpfiles_process apache.conf #662544
219
222
220
	# warnings that default config might not work out of the box
223
	# warnings that default config might not work out of the box
221
	local mod cmod
224
	local mod cmod
222
	for mod in ${MODULE_CRITICAL} ; do
225
	for mod in ${MODULE_CRITICAL} ; do
223
		if ! use "apache2_modules_${mod}"; then
226
		if ! use "apache2_modules_${mod}"; then
224
			echo
227
			echo
225
			ewarn "Warning: Critical module not installed!"
228
			ewarn "Warning: Critical module not installed!"
226
			ewarn "Modules 'authn_core', 'authz_core' and 'unixd'"
229
			ewarn "Modules 'authn_core', 'authz_core' and 'unixd'"
227
			ewarn "are highly recomended but might not be in the base profile yet."
230
			ewarn "are highly recomended but might not be in the base profile yet."
228
			ewarn "Default config for ssl needs module 'socache_shmcb'."
231
			ewarn "Default config for ssl needs module 'socache_shmcb'."
229
			ewarn "Enabling the following flags is highly recommended:"
232
			ewarn "Enabling the following flags is highly recommended:"
230
			for cmod in ${MODULE_CRITICAL} ; do
233
			for cmod in ${MODULE_CRITICAL} ; do
231
				use "apache2_modules_${cmod}" || \
234
				use "apache2_modules_${cmod}" || \
232
					ewarn "+ apache2_modules_${cmod}"
235
					ewarn "+ apache2_modules_${cmod}"
233
			done
236
			done
234
			echo
237
			echo
235
			break
238
			break
236
		fi
239
		fi
237
	done
240
	done
238
	# warning for proxy_balancer and missing load balancing scheduler
241
	# warning for proxy_balancer and missing load balancing scheduler
239
	if use apache2_modules_proxy_balancer; then
242
	if use apache2_modules_proxy_balancer; then
240
		local lbset=
243
		local lbset=
241
		for mod in lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat; do
244
		for mod in lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat; do
242
			if use "apache2_modules_${mod}"; then
245
			if use "apache2_modules_${mod}"; then
243
				lbset=1 && break
246
				lbset=1 && break
244
			fi
247
			fi
245
		done
248
		done
246
		if [[ ! ${lbset} ]] ; then
249
		if [[ ! ${lbset} ]] ; then
247
			echo
250
			echo
248
			ewarn "Info: Missing load balancing scheduler algorithm module"
251
			ewarn "Info: Missing load balancing scheduler algorithm module"
249
			ewarn "(They were split off from proxy_balancer in 2.3)"
252
			ewarn "(They were split off from proxy_balancer in 2.3)"
250
			ewarn "In order to get the ability of load balancing, at least"
253
			ewarn "In order to get the ability of load balancing, at least"
251
			ewarn "one of these modules has to be present:"
254
			ewarn "one of these modules has to be present:"
252
			ewarn "lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat"
255
			ewarn "lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat"
253
			echo
256
			echo
254
		fi
257
		fi
255
	fi
258
	fi
256
}
259
}
(-)a/www-servers/apache/apache-2.4.58.ebuild (-2 / +3 lines)
Lines 1-256 Link Here
1
# Copyright 1999-2023 Gentoo Authors
1
# Copyright 1999-2023 Gentoo Authors
2
# Distributed under the terms of the GNU General Public License v2
2
# Distributed under the terms of the GNU General Public License v2
3
3
4
EAPI=7
4
EAPI=7
5
5
6
# latest gentoo apache files
6
# latest gentoo apache files
7
GENTOO_PATCHSTAMP="20231019"
7
GENTOO_PATCHSTAMP="20231019"
8
GENTOO_DEVELOPER="graaff"
8
GENTOO_DEVELOPER="graaff"
9
GENTOO_PATCHNAME="gentoo-apache-2.4.58"
9
GENTOO_PATCHNAME="gentoo-apache-2.4.58"
10
10
11
# ancient hack: bug #502384
12
IUSE="split-usr"
13
11
# IUSE/USE_EXPAND magic
14
# IUSE/USE_EXPAND magic
12
IUSE_MPMS_FORK="prefork"
15
IUSE_MPMS_FORK="prefork"
13
IUSE_MPMS_THREAD="event worker"
16
IUSE_MPMS_THREAD="event worker"
14
17
15
# << obsolete modules:
18
# << obsolete modules:
16
# authn_default authz_default mem_cache
19
# authn_default authz_default mem_cache
17
# mem_cache is replaced by cache_disk
20
# mem_cache is replaced by cache_disk
18
# ?? buggy modules
21
# ?? buggy modules
19
# proxy_scgi: startup error: undefined symbol "ap_proxy_release_connection", no fix found
22
# proxy_scgi: startup error: undefined symbol "ap_proxy_release_connection", no fix found
20
# >> added modules for reason:
23
# >> added modules for reason:
21
# compat: compatibility with 2.2 access control
24
# compat: compatibility with 2.2 access control
22
# authz_host: new module for access control
25
# authz_host: new module for access control
23
# authn_core: functionality provided by authn_alias in previous versions
26
# authn_core: functionality provided by authn_alias in previous versions
24
# authz_core: new module, provides core authorization capabilities
27
# authz_core: new module, provides core authorization capabilities
25
# cache_disk: replacement for mem_cache
28
# cache_disk: replacement for mem_cache
26
# lbmethod_byrequests: Split off from mod_proxy_balancer in 2.3
29
# lbmethod_byrequests: Split off from mod_proxy_balancer in 2.3
27
# lbmethod_bytraffic: Split off from mod_proxy_balancer in 2.3
30
# lbmethod_bytraffic: Split off from mod_proxy_balancer in 2.3
28
# lbmethod_bybusyness: Split off from mod_proxy_balancer in 2.3
31
# lbmethod_bybusyness: Split off from mod_proxy_balancer in 2.3
29
# lbmethod_heartbeat: Split off from mod_proxy_balancer in 2.3
32
# lbmethod_heartbeat: Split off from mod_proxy_balancer in 2.3
30
# slotmem_shm: Slot-based shared memory provider (for lbmethod_byrequests).
33
# slotmem_shm: Slot-based shared memory provider (for lbmethod_byrequests).
31
# socache_shmcb: shared object cache provider. Default config with ssl needs it
34
# socache_shmcb: shared object cache provider. Default config with ssl needs it
32
# unixd: fixes startup error: Invalid command 'User'
35
# unixd: fixes startup error: Invalid command 'User'
33
IUSE_MODULES="access_compat actions alias allowmethods asis auth_basic auth_digest auth_form
36
IUSE_MODULES="access_compat actions alias allowmethods asis auth_basic auth_digest auth_form
34
authn_anon authn_core authn_dbd authn_dbm authn_file authn_socache authz_core
37
authn_anon authn_core authn_dbd authn_dbm authn_file authn_socache authz_core
35
authz_dbd authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex
38
authz_dbd authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex
36
brotli cache cache_disk cache_socache cern_meta charset_lite cgi cgid dav dav_fs dav_lock
39
brotli cache cache_disk cache_socache cern_meta charset_lite cgi cgid dav dav_fs dav_lock
37
dbd deflate dir dumpio env expires ext_filter file_cache filter headers http2
40
dbd deflate dir dumpio env expires ext_filter file_cache filter headers http2
38
ident imagemap include info lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness
41
ident imagemap include info lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness
39
lbmethod_heartbeat log_config log_forensic logio lua macro md mime mime_magic negotiation
42
lbmethod_heartbeat log_config log_forensic logio lua macro md mime mime_magic negotiation
40
proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_hcheck proxy_html proxy_http proxy_scgi
43
proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_hcheck proxy_html proxy_http proxy_scgi
41
proxy_http2 proxy_fcgi proxy_uwsgi proxy_wstunnel rewrite ratelimit remoteip reqtimeout
44
proxy_http2 proxy_fcgi proxy_uwsgi proxy_wstunnel rewrite ratelimit remoteip reqtimeout
42
session session_cookie session_crypto session_dbd setenvif slotmem_shm socache_memcache
45
session session_cookie session_crypto session_dbd setenvif slotmem_shm socache_memcache
43
socache_shmcb speling status substitute systemd tls unique_id userdir usertrack
46
socache_shmcb speling status substitute systemd tls unique_id userdir usertrack
44
unixd version vhost_alias watchdog xml2enc"
47
unixd version vhost_alias watchdog xml2enc"
45
# The following are also in the source as of this version, but are not available
48
# The following are also in the source as of this version, but are not available
46
# for user selection:
49
# for user selection:
47
# bucketeer case_filter case_filter_in echo http isapi optional_fn_export
50
# bucketeer case_filter case_filter_in echo http isapi optional_fn_export
48
# optional_fn_import optional_hook_export optional_hook_import
51
# optional_fn_import optional_hook_export optional_hook_import
49
52
50
# inter-module dependencies
53
# inter-module dependencies
51
# TODO: this may still be incomplete
54
# TODO: this may still be incomplete
52
MODULE_DEPENDS="
55
MODULE_DEPENDS="
53
	auth_form:session
56
	auth_form:session
54
	brotli:filter
57
	brotli:filter
55
	dav_fs:dav
58
	dav_fs:dav
56
	dav_lock:dav
59
	dav_lock:dav
57
	deflate:filter
60
	deflate:filter
58
	cache_disk:cache
61
	cache_disk:cache
59
	ext_filter:filter
62
	ext_filter:filter
60
	file_cache:cache
63
	file_cache:cache
61
	lbmethod_byrequests:proxy_balancer
64
	lbmethod_byrequests:proxy_balancer
62
	lbmethod_byrequests:slotmem_shm
65
	lbmethod_byrequests:slotmem_shm
63
	lbmethod_bytraffic:proxy_balancer
66
	lbmethod_bytraffic:proxy_balancer
64
	lbmethod_bybusyness:proxy_balancer
67
	lbmethod_bybusyness:proxy_balancer
65
	lbmethod_heartbeat:proxy_balancer
68
	lbmethod_heartbeat:proxy_balancer
66
	log_forensic:log_config
69
	log_forensic:log_config
67
	logio:log_config
70
	logio:log_config
68
	cache_disk:cache
71
	cache_disk:cache
69
	cache_socache:cache
72
	cache_socache:cache
70
	md:watchdog
73
	md:watchdog
71
	mime_magic:mime
74
	mime_magic:mime
72
	proxy_ajp:proxy
75
	proxy_ajp:proxy
73
	proxy_balancer:proxy
76
	proxy_balancer:proxy
74
	proxy_balancer:slotmem_shm
77
	proxy_balancer:slotmem_shm
75
	proxy_connect:proxy
78
	proxy_connect:proxy
76
	proxy_ftp:proxy
79
	proxy_ftp:proxy
77
	proxy_hcheck:proxy
80
	proxy_hcheck:proxy
78
	proxy_hcheck:watchdog
81
	proxy_hcheck:watchdog
79
	proxy_html:proxy
82
	proxy_html:proxy
80
	proxy_html:xml2enc
83
	proxy_html:xml2enc
81
	proxy_http:proxy
84
	proxy_http:proxy
82
	proxy_http2:proxy
85
	proxy_http2:proxy
83
	proxy_scgi:proxy
86
	proxy_scgi:proxy
84
	proxy_uwsgi:proxy
87
	proxy_uwsgi:proxy
85
	proxy_fcgi:proxy
88
	proxy_fcgi:proxy
86
	proxy_wstunnel:proxy
89
	proxy_wstunnel:proxy
87
	session_cookie:session
90
	session_cookie:session
88
	session_dbd:dbd
91
	session_dbd:dbd
89
	session_dbd:session
92
	session_dbd:session
90
	socache_memcache:cache
93
	socache_memcache:cache
91
	substitute:filter
94
	substitute:filter
92
"
95
"
93
96
94
# module<->define mappings
97
# module<->define mappings
95
MODULE_DEFINES="
98
MODULE_DEFINES="
96
	auth_digest:AUTH_DIGEST
99
	auth_digest:AUTH_DIGEST
97
	authnz_ldap:AUTHNZ_LDAP
100
	authnz_ldap:AUTHNZ_LDAP
98
	cache:CACHE
101
	cache:CACHE
99
	cache_disk:CACHE
102
	cache_disk:CACHE
100
	cache_socache:CACHE
103
	cache_socache:CACHE
101
	dav:DAV
104
	dav:DAV
102
	dav_fs:DAV
105
	dav_fs:DAV
103
	dav_lock:DAV
106
	dav_lock:DAV
104
	file_cache:CACHE
107
	file_cache:CACHE
105
	http2:HTTP2
108
	http2:HTTP2
106
	info:INFO
109
	info:INFO
107
	ldap:LDAP
110
	ldap:LDAP
108
	lua:LUA
111
	lua:LUA
109
	md:SSL
112
	md:SSL
110
	proxy:PROXY
113
	proxy:PROXY
111
	proxy_ajp:PROXY
114
	proxy_ajp:PROXY
112
	proxy_balancer:PROXY
115
	proxy_balancer:PROXY
113
	proxy_connect:PROXY
116
	proxy_connect:PROXY
114
	proxy_fcgi:PROXY
117
	proxy_fcgi:PROXY
115
	proxy_ftp:PROXY
118
	proxy_ftp:PROXY
116
	proxy_hcheck:PROXY
119
	proxy_hcheck:PROXY
117
	proxy_html:PROXY
120
	proxy_html:PROXY
118
	proxy_http:PROXY
121
	proxy_http:PROXY
119
	proxy_http2:PROXY
122
	proxy_http2:PROXY
120
	proxy_scgi:PROXY
123
	proxy_scgi:PROXY
121
	proxy_uswgi:PROXY
124
	proxy_uswgi:PROXY
122
	proxy_wstunnel:PROXY
125
	proxy_wstunnel:PROXY
123
	socache_shmcb:SSL
126
	socache_shmcb:SSL
124
	socache_memcache:CACHE
127
	socache_memcache:CACHE
125
	ssl:SSL
128
	ssl:SSL
126
	status:STATUS
129
	status:STATUS
127
	suexec:SUEXEC
130
	suexec:SUEXEC
128
	systemd:SYSTEMD
131
	systemd:SYSTEMD
129
	userdir:USERDIR
132
	userdir:USERDIR
130
"
133
"
131
134
132
# critical modules for the default config
135
# critical modules for the default config
133
MODULE_CRITICAL="
136
MODULE_CRITICAL="
134
	authn_core
137
	authn_core
135
	authz_core
138
	authz_core
136
	authz_host
139
	authz_host
137
	dir
140
	dir
138
	mime
141
	mime
139
	unixd
142
	unixd
140
"
143
"
141
inherit apache-2 systemd tmpfiles toolchain-funcs
144
inherit apache-2 systemd tmpfiles toolchain-funcs
142
145
143
DESCRIPTION="The Apache Web Server"
146
DESCRIPTION="The Apache Web Server"
144
HOMEPAGE="https://httpd.apache.org/"
147
HOMEPAGE="https://httpd.apache.org/"
145
148
146
# some helper scripts are Apache-1.1, thus both are here
149
# some helper scripts are Apache-1.1, thus both are here
147
LICENSE="Apache-2.0 Apache-1.1"
150
LICENSE="Apache-2.0 Apache-1.1"
148
SLOT="2"
151
SLOT="2"
149
KEYWORDS="~alpha ~amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc ~x86 ~amd64-linux ~x64-macos ~x64-solaris"
152
KEYWORDS="~alpha ~amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc ~x86 ~amd64-linux ~x64-macos ~x64-solaris"
150
153
151
pkg_setup() {
154
pkg_setup() {
152
	# dependent critical modules which are not allowed in global scope due
155
	# dependent critical modules which are not allowed in global scope due
153
	# to USE flag conditionals (bug #499260)
156
	# to USE flag conditionals (bug #499260)
154
	use ssl && MODULE_CRITICAL+=" socache_shmcb"
157
	use ssl && MODULE_CRITICAL+=" socache_shmcb"
155
	use doc && MODULE_CRITICAL+=" alias negotiation setenvif"
158
	use doc && MODULE_CRITICAL+=" alias negotiation setenvif"
156
	apache-2_pkg_setup
159
	apache-2_pkg_setup
157
}
160
}
158
161
159
src_configure() {
162
src_configure() {
160
	# Brain dead check.
163
	# Brain dead check.
161
	tc-is-cross-compiler && export ap_cv_void_ptr_lt_long="no"
164
	tc-is-cross-compiler && export ap_cv_void_ptr_lt_long="no"
162
165
163
	apache-2_src_configure
166
	apache-2_src_configure
164
}
167
}
165
168
166
src_compile() {
169
src_compile() {
167
	if tc-is-cross-compiler ; then
170
	if tc-is-cross-compiler ; then
168
		# This header is the same across targets, so use the build compiler.
171
		# This header is the same across targets, so use the build compiler.
169
		pushd server >/dev/null
172
		pushd server >/dev/null
170
		emake gen_test_char
173
		emake gen_test_char
171
		tc-export_build_env BUILD_CC
174
		tc-export_build_env BUILD_CC
172
		${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_CPPFLAGS} ${BUILD_LDFLAGS} \
175
		${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_CPPFLAGS} ${BUILD_LDFLAGS} \
173
			gen_test_char.c -o gen_test_char $(apr-1-config --includes) || die
176
			gen_test_char.c -o gen_test_char $(apr-1-config --includes) || die
174
		popd >/dev/null
177
		popd >/dev/null
175
	fi
178
	fi
176
179
177
	default
180
	default
178
}
181
}
179
182
180
src_install() {
183
src_install() {
181
	apache-2_src_install
184
	apache-2_src_install
182
	local i
185
	local i
183
	local apache_tools_prune_list=(
186
	local apache_tools_prune_list=(
184
		/usr/bin/{htdigest,logresolve,htpasswd,htdbm,ab,httxt2dbm}
187
		/usr/bin/{htdigest,logresolve,htpasswd,htdbm,ab,httxt2dbm}
185
		/usr/sbin/{checkgid,fcgistarter,htcacheclean,rotatelogs}
188
		/usr/sbin/{checkgid,fcgistarter,htcacheclean,rotatelogs}
186
		/usr/share/man/man1/{logresolve.1,htdbm.1,htdigest.1,htpasswd.1,dbmmanage.1,ab.1}
189
		/usr/share/man/man1/{logresolve.1,htdbm.1,htdigest.1,htpasswd.1,dbmmanage.1,ab.1}
187
		/usr/share/man/man8/{rotatelogs.8,htcacheclean.8}
190
		/usr/share/man/man8/{rotatelogs.8,htcacheclean.8}
188
	)
191
	)
189
	for i in ${apache_tools_prune_list[@]} ; do
192
	for i in ${apache_tools_prune_list[@]} ; do
190
		rm "${ED}"/${i} || die "Failed to prune apache-tools bits"
193
		rm "${ED}"/${i} || die "Failed to prune apache-tools bits"
191
	done
194
	done
192
195
193
	# install apxs in /usr/bin (bug #502384) and put a symlink into the
196
	# install apxs in /usr/bin (bug #502384) and put a symlink into the
194
	# old location until all ebuilds and eclasses have been modified to
197
	# old location until all ebuilds and eclasses have been modified to
195
	# use the new location.
198
	# use the new location.
196
	dobin support/apxs
199
	dobin support/apxs
197
	use split-usr && dosym ../bin/apxs /usr/sbin/apxs
200
	use split-usr && dosym ../bin/apxs /usr/sbin/apxs
198
201
199
	# Note: wait for mod_systemd to be included in some forthcoming release,
202
	# Note: wait for mod_systemd to be included in some forthcoming release,
200
	# Then apache2.4.service can be used and systemd support controlled
203
	# Then apache2.4.service can be used and systemd support controlled
201
	# through --enable-systemd
204
	# through --enable-systemd
202
	systemd_newunit "${FILESDIR}/apache2.4-hardened.service" "apache2.service"
205
	systemd_newunit "${FILESDIR}/apache2.4-hardened.service" "apache2.service"
203
	dotmpfiles "${FILESDIR}/apache.conf"
206
	dotmpfiles "${FILESDIR}/apache.conf"
204
	#insinto /etc/apache2/modules.d
207
	#insinto /etc/apache2/modules.d
205
	#doins "${FILESDIR}/00_systemd.conf"
208
	#doins "${FILESDIR}/00_systemd.conf"
206
209
207
	# Install http2 module config
210
	# Install http2 module config
208
	insinto /etc/apache2/modules.d
211
	insinto /etc/apache2/modules.d
209
	doins "${FILESDIR}"/41_mod_http2.conf
212
	doins "${FILESDIR}"/41_mod_http2.conf
210
213
211
	# Fix path to apache libdir
214
	# Fix path to apache libdir
212
	sed "s|@LIBDIR@|$(get_libdir)|" -i "${ED}"/usr/sbin/apache2ctl || die
215
	sed "s|@LIBDIR@|$(get_libdir)|" -i "${ED}"/usr/sbin/apache2ctl || die
213
}
216
}
214
217
215
pkg_postinst() {
218
pkg_postinst() {
216
	apache-2_pkg_postinst || die "apache-2_pkg_postinst failed"
219
	apache-2_pkg_postinst || die "apache-2_pkg_postinst failed"
217
220
218
	tmpfiles_process apache.conf #662544
221
	tmpfiles_process apache.conf #662544
219
222
220
	# warnings that default config might not work out of the box
223
	# warnings that default config might not work out of the box
221
	local mod cmod
224
	local mod cmod
222
	for mod in ${MODULE_CRITICAL} ; do
225
	for mod in ${MODULE_CRITICAL} ; do
223
		if ! use "apache2_modules_${mod}"; then
226
		if ! use "apache2_modules_${mod}"; then
224
			echo
227
			echo
225
			ewarn "Warning: Critical module not installed!"
228
			ewarn "Warning: Critical module not installed!"
226
			ewarn "Modules 'authn_core', 'authz_core' and 'unixd'"
229
			ewarn "Modules 'authn_core', 'authz_core' and 'unixd'"
227
			ewarn "are highly recomended but might not be in the base profile yet."
230
			ewarn "are highly recomended but might not be in the base profile yet."
228
			ewarn "Default config for ssl needs module 'socache_shmcb'."
231
			ewarn "Default config for ssl needs module 'socache_shmcb'."
229
			ewarn "Enabling the following flags is highly recommended:"
232
			ewarn "Enabling the following flags is highly recommended:"
230
			for cmod in ${MODULE_CRITICAL} ; do
233
			for cmod in ${MODULE_CRITICAL} ; do
231
				use "apache2_modules_${cmod}" || \
234
				use "apache2_modules_${cmod}" || \
232
					ewarn "+ apache2_modules_${cmod}"
235
					ewarn "+ apache2_modules_${cmod}"
233
			done
236
			done
234
			echo
237
			echo
235
			break
238
			break
236
		fi
239
		fi
237
	done
240
	done
238
	# warning for proxy_balancer and missing load balancing scheduler
241
	# warning for proxy_balancer and missing load balancing scheduler
239
	if use apache2_modules_proxy_balancer; then
242
	if use apache2_modules_proxy_balancer; then
240
		local lbset=
243
		local lbset=
241
		for mod in lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat; do
244
		for mod in lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat; do
242
			if use "apache2_modules_${mod}"; then
245
			if use "apache2_modules_${mod}"; then
243
				lbset=1 && break
246
				lbset=1 && break
244
			fi
247
			fi
245
		done
248
		done
246
		if [[ ! ${lbset} ]] ; then
249
		if [[ ! ${lbset} ]] ; then
247
			echo
250
			echo
248
			ewarn "Info: Missing load balancing scheduler algorithm module"
251
			ewarn "Info: Missing load balancing scheduler algorithm module"
249
			ewarn "(They were split off from proxy_balancer in 2.3)"
252
			ewarn "(They were split off from proxy_balancer in 2.3)"
250
			ewarn "In order to get the ability of load balancing, at least"
253
			ewarn "In order to get the ability of load balancing, at least"
251
			ewarn "one of these modules has to be present:"
254
			ewarn "one of these modules has to be present:"
252
			ewarn "lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat"
255
			ewarn "lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat"
253
			echo
256
			echo
254
		fi
257
		fi
255
	fi
258
	fi
256
}
259
}
257
- 
258
hack
260
hack
259
--
260
.../{apache-2.4.57-r5.ebuild => apache-2.4.57-r6.ebuild}   | 7 -------
261
.../{apache-2.4.57-r5.ebuild => apache-2.4.57-r6.ebuild}   | 7 -------
261
.../{apache-2.4.58-r1.ebuild => apache-2.4.58-r2.ebuild}   | 7 -------
262
.../{apache-2.4.58-r1.ebuild => apache-2.4.58-r2.ebuild}   | 7 -------
262
2 files changed, 14 deletions(-)
263
2 files changed, 14 deletions(-)
263
rename www-servers/apache/{apache-2.4.57-r5.ebuild => apache-2.4.57-r6.ebuild} (96%)
264
rename www-servers/apache/{apache-2.4.57-r5.ebuild => apache-2.4.57-r6.ebuild} (96%)
264
rename www-servers/apache/{apache-2.4.58-r1.ebuild => apache-2.4.58-r2.ebuild} (96%)
265
rename www-servers/apache/{apache-2.4.58-r1.ebuild => apache-2.4.58-r2.ebuild} (96%)
(-)a/www-servers/apache/apache-2.4.57-r5.ebuild (-7 lines)
Lines 1-259 Link Here
1
# Copyright 1999-2023 Gentoo Authors
1
# Copyright 1999-2023 Gentoo Authors
2
# Distributed under the terms of the GNU General Public License v2
2
# Distributed under the terms of the GNU General Public License v2
3
3
4
EAPI=7
4
EAPI=7
5
5
6
# latest gentoo apache files
6
# latest gentoo apache files
7
GENTOO_PATCHSTAMP="20231011"
7
GENTOO_PATCHSTAMP="20231011"
8
GENTOO_DEVELOPER="graaff"
8
GENTOO_DEVELOPER="graaff"
9
GENTOO_PATCHNAME="gentoo-apache-2.4.57-r5"
9
GENTOO_PATCHNAME="gentoo-apache-2.4.57-r5"
10
10
11
# ancient hack: bug #502384
12
IUSE="split-usr"
13
14
# IUSE/USE_EXPAND magic
11
# IUSE/USE_EXPAND magic
15
IUSE_MPMS_FORK="prefork"
12
IUSE_MPMS_FORK="prefork"
16
IUSE_MPMS_THREAD="event worker"
13
IUSE_MPMS_THREAD="event worker"
17
14
18
# << obsolete modules:
15
# << obsolete modules:
19
# authn_default authz_default mem_cache
16
# authn_default authz_default mem_cache
20
# mem_cache is replaced by cache_disk
17
# mem_cache is replaced by cache_disk
21
# ?? buggy modules
18
# ?? buggy modules
22
# proxy_scgi: startup error: undefined symbol "ap_proxy_release_connection", no fix found
19
# proxy_scgi: startup error: undefined symbol "ap_proxy_release_connection", no fix found
23
# >> added modules for reason:
20
# >> added modules for reason:
24
# compat: compatibility with 2.2 access control
21
# compat: compatibility with 2.2 access control
25
# authz_host: new module for access control
22
# authz_host: new module for access control
26
# authn_core: functionality provided by authn_alias in previous versions
23
# authn_core: functionality provided by authn_alias in previous versions
27
# authz_core: new module, provides core authorization capabilities
24
# authz_core: new module, provides core authorization capabilities
28
# cache_disk: replacement for mem_cache
25
# cache_disk: replacement for mem_cache
29
# lbmethod_byrequests: Split off from mod_proxy_balancer in 2.3
26
# lbmethod_byrequests: Split off from mod_proxy_balancer in 2.3
30
# lbmethod_bytraffic: Split off from mod_proxy_balancer in 2.3
27
# lbmethod_bytraffic: Split off from mod_proxy_balancer in 2.3
31
# lbmethod_bybusyness: Split off from mod_proxy_balancer in 2.3
28
# lbmethod_bybusyness: Split off from mod_proxy_balancer in 2.3
32
# lbmethod_heartbeat: Split off from mod_proxy_balancer in 2.3
29
# lbmethod_heartbeat: Split off from mod_proxy_balancer in 2.3
33
# slotmem_shm: Slot-based shared memory provider (for lbmethod_byrequests).
30
# slotmem_shm: Slot-based shared memory provider (for lbmethod_byrequests).
34
# socache_shmcb: shared object cache provider. Default config with ssl needs it
31
# socache_shmcb: shared object cache provider. Default config with ssl needs it
35
# unixd: fixes startup error: Invalid command 'User'
32
# unixd: fixes startup error: Invalid command 'User'
36
IUSE_MODULES="access_compat actions alias allowmethods asis auth_basic auth_digest auth_form
33
IUSE_MODULES="access_compat actions alias allowmethods asis auth_basic auth_digest auth_form
37
authn_anon authn_core authn_dbd authn_dbm authn_file authn_socache authz_core
34
authn_anon authn_core authn_dbd authn_dbm authn_file authn_socache authz_core
38
authz_dbd authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex
35
authz_dbd authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex
39
brotli cache cache_disk cache_socache cern_meta charset_lite cgi cgid dav dav_fs dav_lock
36
brotli cache cache_disk cache_socache cern_meta charset_lite cgi cgid dav dav_fs dav_lock
40
dbd deflate dir dumpio env expires ext_filter file_cache filter headers http2
37
dbd deflate dir dumpio env expires ext_filter file_cache filter headers http2
41
ident imagemap include info lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness
38
ident imagemap include info lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness
42
lbmethod_heartbeat log_config log_forensic logio lua macro md mime mime_magic negotiation
39
lbmethod_heartbeat log_config log_forensic logio lua macro md mime mime_magic negotiation
43
proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_hcheck proxy_html proxy_http proxy_scgi
40
proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_hcheck proxy_html proxy_http proxy_scgi
44
proxy_http2 proxy_fcgi proxy_uwsgi proxy_wstunnel rewrite ratelimit remoteip reqtimeout
41
proxy_http2 proxy_fcgi proxy_uwsgi proxy_wstunnel rewrite ratelimit remoteip reqtimeout
45
session session_cookie session_crypto session_dbd setenvif slotmem_shm socache_memcache
42
session session_cookie session_crypto session_dbd setenvif slotmem_shm socache_memcache
46
socache_shmcb speling status substitute systemd tls unique_id userdir usertrack
43
socache_shmcb speling status substitute systemd tls unique_id userdir usertrack
47
unixd version vhost_alias watchdog xml2enc"
44
unixd version vhost_alias watchdog xml2enc"
48
# The following are also in the source as of this version, but are not available
45
# The following are also in the source as of this version, but are not available
49
# for user selection:
46
# for user selection:
50
# bucketeer case_filter case_filter_in echo http isapi optional_fn_export
47
# bucketeer case_filter case_filter_in echo http isapi optional_fn_export
51
# optional_fn_import optional_hook_export optional_hook_import
48
# optional_fn_import optional_hook_export optional_hook_import
52
49
53
# inter-module dependencies
50
# inter-module dependencies
54
# TODO: this may still be incomplete
51
# TODO: this may still be incomplete
55
MODULE_DEPENDS="
52
MODULE_DEPENDS="
56
	auth_form:session
53
	auth_form:session
57
	brotli:filter
54
	brotli:filter
58
	dav_fs:dav
55
	dav_fs:dav
59
	dav_lock:dav
56
	dav_lock:dav
60
	deflate:filter
57
	deflate:filter
61
	cache_disk:cache
58
	cache_disk:cache
62
	ext_filter:filter
59
	ext_filter:filter
63
	file_cache:cache
60
	file_cache:cache
64
	lbmethod_byrequests:proxy_balancer
61
	lbmethod_byrequests:proxy_balancer
65
	lbmethod_byrequests:slotmem_shm
62
	lbmethod_byrequests:slotmem_shm
66
	lbmethod_bytraffic:proxy_balancer
63
	lbmethod_bytraffic:proxy_balancer
67
	lbmethod_bybusyness:proxy_balancer
64
	lbmethod_bybusyness:proxy_balancer
68
	lbmethod_heartbeat:proxy_balancer
65
	lbmethod_heartbeat:proxy_balancer
69
	log_forensic:log_config
66
	log_forensic:log_config
70
	logio:log_config
67
	logio:log_config
71
	cache_disk:cache
68
	cache_disk:cache
72
	cache_socache:cache
69
	cache_socache:cache
73
	md:watchdog
70
	md:watchdog
74
	mime_magic:mime
71
	mime_magic:mime
75
	proxy_ajp:proxy
72
	proxy_ajp:proxy
76
	proxy_balancer:proxy
73
	proxy_balancer:proxy
77
	proxy_balancer:slotmem_shm
74
	proxy_balancer:slotmem_shm
78
	proxy_connect:proxy
75
	proxy_connect:proxy
79
	proxy_ftp:proxy
76
	proxy_ftp:proxy
80
	proxy_hcheck:proxy
77
	proxy_hcheck:proxy
81
	proxy_hcheck:watchdog
78
	proxy_hcheck:watchdog
82
	proxy_html:proxy
79
	proxy_html:proxy
83
	proxy_html:xml2enc
80
	proxy_html:xml2enc
84
	proxy_http:proxy
81
	proxy_http:proxy
85
	proxy_http2:proxy
82
	proxy_http2:proxy
86
	proxy_scgi:proxy
83
	proxy_scgi:proxy
87
	proxy_uwsgi:proxy
84
	proxy_uwsgi:proxy
88
	proxy_fcgi:proxy
85
	proxy_fcgi:proxy
89
	proxy_wstunnel:proxy
86
	proxy_wstunnel:proxy
90
	session_cookie:session
87
	session_cookie:session
91
	session_dbd:dbd
88
	session_dbd:dbd
92
	session_dbd:session
89
	session_dbd:session
93
	socache_memcache:cache
90
	socache_memcache:cache
94
	substitute:filter
91
	substitute:filter
95
"
92
"
96
93
97
# module<->define mappings
94
# module<->define mappings
98
MODULE_DEFINES="
95
MODULE_DEFINES="
99
	auth_digest:AUTH_DIGEST
96
	auth_digest:AUTH_DIGEST
100
	authnz_ldap:AUTHNZ_LDAP
97
	authnz_ldap:AUTHNZ_LDAP
101
	cache:CACHE
98
	cache:CACHE
102
	cache_disk:CACHE
99
	cache_disk:CACHE
103
	cache_socache:CACHE
100
	cache_socache:CACHE
104
	dav:DAV
101
	dav:DAV
105
	dav_fs:DAV
102
	dav_fs:DAV
106
	dav_lock:DAV
103
	dav_lock:DAV
107
	file_cache:CACHE
104
	file_cache:CACHE
108
	http2:HTTP2
105
	http2:HTTP2
109
	info:INFO
106
	info:INFO
110
	ldap:LDAP
107
	ldap:LDAP
111
	lua:LUA
108
	lua:LUA
112
	md:SSL
109
	md:SSL
113
	proxy:PROXY
110
	proxy:PROXY
114
	proxy_ajp:PROXY
111
	proxy_ajp:PROXY
115
	proxy_balancer:PROXY
112
	proxy_balancer:PROXY
116
	proxy_connect:PROXY
113
	proxy_connect:PROXY
117
	proxy_fcgi:PROXY
114
	proxy_fcgi:PROXY
118
	proxy_ftp:PROXY
115
	proxy_ftp:PROXY
119
	proxy_hcheck:PROXY
116
	proxy_hcheck:PROXY
120
	proxy_html:PROXY
117
	proxy_html:PROXY
121
	proxy_http:PROXY
118
	proxy_http:PROXY
122
	proxy_http2:PROXY
119
	proxy_http2:PROXY
123
	proxy_scgi:PROXY
120
	proxy_scgi:PROXY
124
	proxy_uwsgi:PROXY
121
	proxy_uwsgi:PROXY
125
	proxy_wstunnel:PROXY
122
	proxy_wstunnel:PROXY
126
	socache_shmcb:SSL
123
	socache_shmcb:SSL
127
	socache_memcache:CACHE
124
	socache_memcache:CACHE
128
	ssl:SSL
125
	ssl:SSL
129
	status:STATUS
126
	status:STATUS
130
	suexec:SUEXEC
127
	suexec:SUEXEC
131
	systemd:SYSTEMD
128
	systemd:SYSTEMD
132
	userdir:USERDIR
129
	userdir:USERDIR
133
"
130
"
134
131
135
# critical modules for the default config
132
# critical modules for the default config
136
MODULE_CRITICAL="
133
MODULE_CRITICAL="
137
	authn_core
134
	authn_core
138
	authz_core
135
	authz_core
139
	authz_host
136
	authz_host
140
	dir
137
	dir
141
	mime
138
	mime
142
	unixd
139
	unixd
143
"
140
"
144
inherit apache-2 systemd tmpfiles toolchain-funcs
141
inherit apache-2 systemd tmpfiles toolchain-funcs
145
142
146
DESCRIPTION="The Apache Web Server"
143
DESCRIPTION="The Apache Web Server"
147
HOMEPAGE="https://httpd.apache.org/"
144
HOMEPAGE="https://httpd.apache.org/"
148
145
149
# some helper scripts are Apache-1.1, thus both are here
146
# some helper scripts are Apache-1.1, thus both are here
150
LICENSE="Apache-2.0 Apache-1.1"
147
LICENSE="Apache-2.0 Apache-1.1"
151
SLOT="2"
148
SLOT="2"
152
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x64-macos ~x64-solaris"
149
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x64-macos ~x64-solaris"
153
150
154
pkg_setup() {
151
pkg_setup() {
155
	# dependent critical modules which are not allowed in global scope due
152
	# dependent critical modules which are not allowed in global scope due
156
	# to USE flag conditionals (bug #499260)
153
	# to USE flag conditionals (bug #499260)
157
	use ssl && MODULE_CRITICAL+=" socache_shmcb"
154
	use ssl && MODULE_CRITICAL+=" socache_shmcb"
158
	use doc && MODULE_CRITICAL+=" alias negotiation setenvif"
155
	use doc && MODULE_CRITICAL+=" alias negotiation setenvif"
159
	apache-2_pkg_setup
156
	apache-2_pkg_setup
160
}
157
}
161
158
162
src_configure() {
159
src_configure() {
163
	# Brain dead check.
160
	# Brain dead check.
164
	tc-is-cross-compiler && export ap_cv_void_ptr_lt_long="no"
161
	tc-is-cross-compiler && export ap_cv_void_ptr_lt_long="no"
165
162
166
	apache-2_src_configure
163
	apache-2_src_configure
167
}
164
}
168
165
169
src_compile() {
166
src_compile() {
170
	if tc-is-cross-compiler ; then
167
	if tc-is-cross-compiler ; then
171
		# This header is the same across targets, so use the build compiler.
168
		# This header is the same across targets, so use the build compiler.
172
		pushd server >/dev/null
169
		pushd server >/dev/null
173
		emake gen_test_char
170
		emake gen_test_char
174
		tc-export_build_env BUILD_CC
171
		tc-export_build_env BUILD_CC
175
		${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_CPPFLAGS} ${BUILD_LDFLAGS} \
172
		${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_CPPFLAGS} ${BUILD_LDFLAGS} \
176
			gen_test_char.c -o gen_test_char $(apr-1-config --includes) || die
173
			gen_test_char.c -o gen_test_char $(apr-1-config --includes) || die
177
		popd >/dev/null
174
		popd >/dev/null
178
	fi
175
	fi
179
176
180
	default
177
	default
181
}
178
}
182
179
183
src_install() {
180
src_install() {
184
	apache-2_src_install
181
	apache-2_src_install
185
	local i
182
	local i
186
	local apache_tools_prune_list=(
183
	local apache_tools_prune_list=(
187
		/usr/bin/{htdigest,logresolve,htpasswd,htdbm,ab,httxt2dbm}
184
		/usr/bin/{htdigest,logresolve,htpasswd,htdbm,ab,httxt2dbm}
188
		/usr/sbin/{checkgid,fcgistarter,htcacheclean,rotatelogs}
185
		/usr/sbin/{checkgid,fcgistarter,htcacheclean,rotatelogs}
189
		/usr/share/man/man1/{logresolve.1,htdbm.1,htdigest.1,htpasswd.1,dbmmanage.1,ab.1}
186
		/usr/share/man/man1/{logresolve.1,htdbm.1,htdigest.1,htpasswd.1,dbmmanage.1,ab.1}
190
		/usr/share/man/man8/{rotatelogs.8,htcacheclean.8}
187
		/usr/share/man/man8/{rotatelogs.8,htcacheclean.8}
191
	)
188
	)
192
	for i in ${apache_tools_prune_list[@]} ; do
189
	for i in ${apache_tools_prune_list[@]} ; do
193
		rm "${ED}"/${i} || die "Failed to prune apache-tools bits"
190
		rm "${ED}"/${i} || die "Failed to prune apache-tools bits"
194
	done
191
	done
195
192
196
	# install apxs in /usr/bin (bug #502384) and put a symlink into the
197
	# old location until all ebuilds and eclasses have been modified to
198
	# use the new location.
199
	dobin support/apxs
193
	dobin support/apxs
200
	use split-usr && dosym ../bin/apxs /usr/sbin/apxs
201
194
202
	# Note: wait for mod_systemd to be included in some forthcoming release,
195
	# Note: wait for mod_systemd to be included in some forthcoming release,
203
	# Then apache2.4.service can be used and systemd support controlled
196
	# Then apache2.4.service can be used and systemd support controlled
204
	# through --enable-systemd
197
	# through --enable-systemd
205
	systemd_newunit "${FILESDIR}/apache2.4-hardened.service" "apache2.service"
198
	systemd_newunit "${FILESDIR}/apache2.4-hardened.service" "apache2.service"
206
	dotmpfiles "${FILESDIR}/apache.conf"
199
	dotmpfiles "${FILESDIR}/apache.conf"
207
	#insinto /etc/apache2/modules.d
200
	#insinto /etc/apache2/modules.d
208
	#doins "${FILESDIR}/00_systemd.conf"
201
	#doins "${FILESDIR}/00_systemd.conf"
209
202
210
	# Install http2 module config
203
	# Install http2 module config
211
	insinto /etc/apache2/modules.d
204
	insinto /etc/apache2/modules.d
212
	doins "${FILESDIR}"/41_mod_http2.conf
205
	doins "${FILESDIR}"/41_mod_http2.conf
213
206
214
	# Fix path to apache libdir
207
	# Fix path to apache libdir
215
	sed "s|@LIBDIR@|$(get_libdir)|" -i "${ED}"/usr/sbin/apache2ctl || die
208
	sed "s|@LIBDIR@|$(get_libdir)|" -i "${ED}"/usr/sbin/apache2ctl || die
216
}
209
}
217
210
218
pkg_postinst() {
211
pkg_postinst() {
219
	apache-2_pkg_postinst || die "apache-2_pkg_postinst failed"
212
	apache-2_pkg_postinst || die "apache-2_pkg_postinst failed"
220
213
221
	tmpfiles_process apache.conf #662544
214
	tmpfiles_process apache.conf #662544
222
215
223
	# warnings that default config might not work out of the box
216
	# warnings that default config might not work out of the box
224
	local mod cmod
217
	local mod cmod
225
	for mod in ${MODULE_CRITICAL} ; do
218
	for mod in ${MODULE_CRITICAL} ; do
226
		if ! use "apache2_modules_${mod}"; then
219
		if ! use "apache2_modules_${mod}"; then
227
			echo
220
			echo
228
			ewarn "Warning: Critical module not installed!"
221
			ewarn "Warning: Critical module not installed!"
229
			ewarn "Modules 'authn_core', 'authz_core' and 'unixd'"
222
			ewarn "Modules 'authn_core', 'authz_core' and 'unixd'"
230
			ewarn "are highly recomended but might not be in the base profile yet."
223
			ewarn "are highly recomended but might not be in the base profile yet."
231
			ewarn "Default config for ssl needs module 'socache_shmcb'."
224
			ewarn "Default config for ssl needs module 'socache_shmcb'."
232
			ewarn "Enabling the following flags is highly recommended:"
225
			ewarn "Enabling the following flags is highly recommended:"
233
			for cmod in ${MODULE_CRITICAL} ; do
226
			for cmod in ${MODULE_CRITICAL} ; do
234
				use "apache2_modules_${cmod}" || \
227
				use "apache2_modules_${cmod}" || \
235
					ewarn "+ apache2_modules_${cmod}"
228
					ewarn "+ apache2_modules_${cmod}"
236
			done
229
			done
237
			echo
230
			echo
238
			break
231
			break
239
		fi
232
		fi
240
	done
233
	done
241
	# warning for proxy_balancer and missing load balancing scheduler
234
	# warning for proxy_balancer and missing load balancing scheduler
242
	if use apache2_modules_proxy_balancer; then
235
	if use apache2_modules_proxy_balancer; then
243
		local lbset=
236
		local lbset=
244
		for mod in lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat; do
237
		for mod in lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat; do
245
			if use "apache2_modules_${mod}"; then
238
			if use "apache2_modules_${mod}"; then
246
				lbset=1 && break
239
				lbset=1 && break
247
			fi
240
			fi
248
		done
241
		done
249
		if [[ ! ${lbset} ]] ; then
242
		if [[ ! ${lbset} ]] ; then
250
			echo
243
			echo
251
			ewarn "Info: Missing load balancing scheduler algorithm module"
244
			ewarn "Info: Missing load balancing scheduler algorithm module"
252
			ewarn "(They were split off from proxy_balancer in 2.3)"
245
			ewarn "(They were split off from proxy_balancer in 2.3)"
253
			ewarn "In order to get the ability of load balancing, at least"
246
			ewarn "In order to get the ability of load balancing, at least"
254
			ewarn "one of these modules has to be present:"
247
			ewarn "one of these modules has to be present:"
255
			ewarn "lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat"
248
			ewarn "lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat"
256
			echo
249
			echo
257
		fi
250
		fi
258
	fi
251
	fi
259
}
252
}
(-)a/www-servers/apache/apache-2.4.58-r1.ebuild (-8 lines)
Lines 1-259 Link Here
1
# Copyright 1999-2023 Gentoo Authors
1
# Copyright 1999-2023 Gentoo Authors
2
# Distributed under the terms of the GNU General Public License v2
2
# Distributed under the terms of the GNU General Public License v2
3
3
4
EAPI=7
4
EAPI=7
5
5
6
# latest gentoo apache files
6
# latest gentoo apache files
7
GENTOO_PATCHSTAMP="20231019"
7
GENTOO_PATCHSTAMP="20231019"
8
GENTOO_DEVELOPER="graaff"
8
GENTOO_DEVELOPER="graaff"
9
GENTOO_PATCHNAME="gentoo-apache-2.4.58"
9
GENTOO_PATCHNAME="gentoo-apache-2.4.58"
10
10
11
# ancient hack: bug #502384
12
IUSE="split-usr"
13
14
# IUSE/USE_EXPAND magic
11
# IUSE/USE_EXPAND magic
15
IUSE_MPMS_FORK="prefork"
12
IUSE_MPMS_FORK="prefork"
16
IUSE_MPMS_THREAD="event worker"
13
IUSE_MPMS_THREAD="event worker"
17
14
18
# << obsolete modules:
15
# << obsolete modules:
19
# authn_default authz_default mem_cache
16
# authn_default authz_default mem_cache
20
# mem_cache is replaced by cache_disk
17
# mem_cache is replaced by cache_disk
21
# ?? buggy modules
18
# ?? buggy modules
22
# proxy_scgi: startup error: undefined symbol "ap_proxy_release_connection", no fix found
19
# proxy_scgi: startup error: undefined symbol "ap_proxy_release_connection", no fix found
23
# >> added modules for reason:
20
# >> added modules for reason:
24
# compat: compatibility with 2.2 access control
21
# compat: compatibility with 2.2 access control
25
# authz_host: new module for access control
22
# authz_host: new module for access control
26
# authn_core: functionality provided by authn_alias in previous versions
23
# authn_core: functionality provided by authn_alias in previous versions
27
# authz_core: new module, provides core authorization capabilities
24
# authz_core: new module, provides core authorization capabilities
28
# cache_disk: replacement for mem_cache
25
# cache_disk: replacement for mem_cache
29
# lbmethod_byrequests: Split off from mod_proxy_balancer in 2.3
26
# lbmethod_byrequests: Split off from mod_proxy_balancer in 2.3
30
# lbmethod_bytraffic: Split off from mod_proxy_balancer in 2.3
27
# lbmethod_bytraffic: Split off from mod_proxy_balancer in 2.3
31
# lbmethod_bybusyness: Split off from mod_proxy_balancer in 2.3
28
# lbmethod_bybusyness: Split off from mod_proxy_balancer in 2.3
32
# lbmethod_heartbeat: Split off from mod_proxy_balancer in 2.3
29
# lbmethod_heartbeat: Split off from mod_proxy_balancer in 2.3
33
# slotmem_shm: Slot-based shared memory provider (for lbmethod_byrequests).
30
# slotmem_shm: Slot-based shared memory provider (for lbmethod_byrequests).
34
# socache_shmcb: shared object cache provider. Default config with ssl needs it
31
# socache_shmcb: shared object cache provider. Default config with ssl needs it
35
# unixd: fixes startup error: Invalid command 'User'
32
# unixd: fixes startup error: Invalid command 'User'
36
IUSE_MODULES="access_compat actions alias allowmethods asis auth_basic auth_digest auth_form
33
IUSE_MODULES="access_compat actions alias allowmethods asis auth_basic auth_digest auth_form
37
authn_anon authn_core authn_dbd authn_dbm authn_file authn_socache authz_core
34
authn_anon authn_core authn_dbd authn_dbm authn_file authn_socache authz_core
38
authz_dbd authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex
35
authz_dbd authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex
39
brotli cache cache_disk cache_socache cern_meta charset_lite cgi cgid dav dav_fs dav_lock
36
brotli cache cache_disk cache_socache cern_meta charset_lite cgi cgid dav dav_fs dav_lock
40
dbd deflate dir dumpio env expires ext_filter file_cache filter headers http2
37
dbd deflate dir dumpio env expires ext_filter file_cache filter headers http2
41
ident imagemap include info lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness
38
ident imagemap include info lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness
42
lbmethod_heartbeat log_config log_forensic logio lua macro md mime mime_magic negotiation
39
lbmethod_heartbeat log_config log_forensic logio lua macro md mime mime_magic negotiation
43
proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_hcheck proxy_html proxy_http proxy_scgi
40
proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_hcheck proxy_html proxy_http proxy_scgi
44
proxy_http2 proxy_fcgi proxy_uwsgi proxy_wstunnel rewrite ratelimit remoteip reqtimeout
41
proxy_http2 proxy_fcgi proxy_uwsgi proxy_wstunnel rewrite ratelimit remoteip reqtimeout
45
session session_cookie session_crypto session_dbd setenvif slotmem_shm socache_memcache
42
session session_cookie session_crypto session_dbd setenvif slotmem_shm socache_memcache
46
socache_shmcb speling status substitute systemd tls unique_id userdir usertrack
43
socache_shmcb speling status substitute systemd tls unique_id userdir usertrack
47
unixd version vhost_alias watchdog xml2enc"
44
unixd version vhost_alias watchdog xml2enc"
48
# The following are also in the source as of this version, but are not available
45
# The following are also in the source as of this version, but are not available
49
# for user selection:
46
# for user selection:
50
# bucketeer case_filter case_filter_in echo http isapi optional_fn_export
47
# bucketeer case_filter case_filter_in echo http isapi optional_fn_export
51
# optional_fn_import optional_hook_export optional_hook_import
48
# optional_fn_import optional_hook_export optional_hook_import
52
49
53
# inter-module dependencies
50
# inter-module dependencies
54
# TODO: this may still be incomplete
51
# TODO: this may still be incomplete
55
MODULE_DEPENDS="
52
MODULE_DEPENDS="
56
	auth_form:session
53
	auth_form:session
57
	brotli:filter
54
	brotli:filter
58
	dav_fs:dav
55
	dav_fs:dav
59
	dav_lock:dav
56
	dav_lock:dav
60
	deflate:filter
57
	deflate:filter
61
	cache_disk:cache
58
	cache_disk:cache
62
	ext_filter:filter
59
	ext_filter:filter
63
	file_cache:cache
60
	file_cache:cache
64
	lbmethod_byrequests:proxy_balancer
61
	lbmethod_byrequests:proxy_balancer
65
	lbmethod_byrequests:slotmem_shm
62
	lbmethod_byrequests:slotmem_shm
66
	lbmethod_bytraffic:proxy_balancer
63
	lbmethod_bytraffic:proxy_balancer
67
	lbmethod_bybusyness:proxy_balancer
64
	lbmethod_bybusyness:proxy_balancer
68
	lbmethod_heartbeat:proxy_balancer
65
	lbmethod_heartbeat:proxy_balancer
69
	log_forensic:log_config
66
	log_forensic:log_config
70
	logio:log_config
67
	logio:log_config
71
	cache_disk:cache
68
	cache_disk:cache
72
	cache_socache:cache
69
	cache_socache:cache
73
	md:watchdog
70
	md:watchdog
74
	mime_magic:mime
71
	mime_magic:mime
75
	proxy_ajp:proxy
72
	proxy_ajp:proxy
76
	proxy_balancer:proxy
73
	proxy_balancer:proxy
77
	proxy_balancer:slotmem_shm
74
	proxy_balancer:slotmem_shm
78
	proxy_connect:proxy
75
	proxy_connect:proxy
79
	proxy_ftp:proxy
76
	proxy_ftp:proxy
80
	proxy_hcheck:proxy
77
	proxy_hcheck:proxy
81
	proxy_hcheck:watchdog
78
	proxy_hcheck:watchdog
82
	proxy_html:proxy
79
	proxy_html:proxy
83
	proxy_html:xml2enc
80
	proxy_html:xml2enc
84
	proxy_http:proxy
81
	proxy_http:proxy
85
	proxy_http2:proxy
82
	proxy_http2:proxy
86
	proxy_scgi:proxy
83
	proxy_scgi:proxy
87
	proxy_uwsgi:proxy
84
	proxy_uwsgi:proxy
88
	proxy_fcgi:proxy
85
	proxy_fcgi:proxy
89
	proxy_wstunnel:proxy
86
	proxy_wstunnel:proxy
90
	session_cookie:session
87
	session_cookie:session
91
	session_dbd:dbd
88
	session_dbd:dbd
92
	session_dbd:session
89
	session_dbd:session
93
	socache_memcache:cache
90
	socache_memcache:cache
94
	substitute:filter
91
	substitute:filter
95
"
92
"
96
93
97
# module<->define mappings
94
# module<->define mappings
98
MODULE_DEFINES="
95
MODULE_DEFINES="
99
	auth_digest:AUTH_DIGEST
96
	auth_digest:AUTH_DIGEST
100
	authnz_ldap:AUTHNZ_LDAP
97
	authnz_ldap:AUTHNZ_LDAP
101
	cache:CACHE
98
	cache:CACHE
102
	cache_disk:CACHE
99
	cache_disk:CACHE
103
	cache_socache:CACHE
100
	cache_socache:CACHE
104
	dav:DAV
101
	dav:DAV
105
	dav_fs:DAV
102
	dav_fs:DAV
106
	dav_lock:DAV
103
	dav_lock:DAV
107
	file_cache:CACHE
104
	file_cache:CACHE
108
	http2:HTTP2
105
	http2:HTTP2
109
	info:INFO
106
	info:INFO
110
	ldap:LDAP
107
	ldap:LDAP
111
	lua:LUA
108
	lua:LUA
112
	md:SSL
109
	md:SSL
113
	proxy:PROXY
110
	proxy:PROXY
114
	proxy_ajp:PROXY
111
	proxy_ajp:PROXY
115
	proxy_balancer:PROXY
112
	proxy_balancer:PROXY
116
	proxy_connect:PROXY
113
	proxy_connect:PROXY
117
	proxy_fcgi:PROXY
114
	proxy_fcgi:PROXY
118
	proxy_ftp:PROXY
115
	proxy_ftp:PROXY
119
	proxy_hcheck:PROXY
116
	proxy_hcheck:PROXY
120
	proxy_html:PROXY
117
	proxy_html:PROXY
121
	proxy_http:PROXY
118
	proxy_http:PROXY
122
	proxy_http2:PROXY
119
	proxy_http2:PROXY
123
	proxy_scgi:PROXY
120
	proxy_scgi:PROXY
124
	proxy_uwsgi:PROXY
121
	proxy_uwsgi:PROXY
125
	proxy_wstunnel:PROXY
122
	proxy_wstunnel:PROXY
126
	socache_shmcb:SSL
123
	socache_shmcb:SSL
127
	socache_memcache:CACHE
124
	socache_memcache:CACHE
128
	ssl:SSL
125
	ssl:SSL
129
	status:STATUS
126
	status:STATUS
130
	suexec:SUEXEC
127
	suexec:SUEXEC
131
	systemd:SYSTEMD
128
	systemd:SYSTEMD
132
	userdir:USERDIR
129
	userdir:USERDIR
133
"
130
"
134
131
135
# critical modules for the default config
132
# critical modules for the default config
136
MODULE_CRITICAL="
133
MODULE_CRITICAL="
137
	authn_core
134
	authn_core
138
	authz_core
135
	authz_core
139
	authz_host
136
	authz_host
140
	dir
137
	dir
141
	mime
138
	mime
142
	unixd
139
	unixd
143
"
140
"
144
inherit apache-2 systemd tmpfiles toolchain-funcs
141
inherit apache-2 systemd tmpfiles toolchain-funcs
145
142
146
DESCRIPTION="The Apache Web Server"
143
DESCRIPTION="The Apache Web Server"
147
HOMEPAGE="https://httpd.apache.org/"
144
HOMEPAGE="https://httpd.apache.org/"
148
145
149
# some helper scripts are Apache-1.1, thus both are here
146
# some helper scripts are Apache-1.1, thus both are here
150
LICENSE="Apache-2.0 Apache-1.1"
147
LICENSE="Apache-2.0 Apache-1.1"
151
SLOT="2"
148
SLOT="2"
152
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x64-macos ~x64-solaris"
149
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x64-macos ~x64-solaris"
153
150
154
pkg_setup() {
151
pkg_setup() {
155
	# dependent critical modules which are not allowed in global scope due
152
	# dependent critical modules which are not allowed in global scope due
156
	# to USE flag conditionals (bug #499260)
153
	# to USE flag conditionals (bug #499260)
157
	use ssl && MODULE_CRITICAL+=" socache_shmcb"
154
	use ssl && MODULE_CRITICAL+=" socache_shmcb"
158
	use doc && MODULE_CRITICAL+=" alias negotiation setenvif"
155
	use doc && MODULE_CRITICAL+=" alias negotiation setenvif"
159
	apache-2_pkg_setup
156
	apache-2_pkg_setup
160
}
157
}
161
158
162
src_configure() {
159
src_configure() {
163
	# Brain dead check.
160
	# Brain dead check.
164
	tc-is-cross-compiler && export ap_cv_void_ptr_lt_long="no"
161
	tc-is-cross-compiler && export ap_cv_void_ptr_lt_long="no"
165
162
166
	apache-2_src_configure
163
	apache-2_src_configure
167
}
164
}
168
165
169
src_compile() {
166
src_compile() {
170
	if tc-is-cross-compiler ; then
167
	if tc-is-cross-compiler ; then
171
		# This header is the same across targets, so use the build compiler.
168
		# This header is the same across targets, so use the build compiler.
172
		pushd server >/dev/null
169
		pushd server >/dev/null
173
		emake gen_test_char
170
		emake gen_test_char
174
		tc-export_build_env BUILD_CC
171
		tc-export_build_env BUILD_CC
175
		${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_CPPFLAGS} ${BUILD_LDFLAGS} \
172
		${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_CPPFLAGS} ${BUILD_LDFLAGS} \
176
			gen_test_char.c -o gen_test_char $(apr-1-config --includes) || die
173
			gen_test_char.c -o gen_test_char $(apr-1-config --includes) || die
177
		popd >/dev/null
174
		popd >/dev/null
178
	fi
175
	fi
179
176
180
	default
177
	default
181
}
178
}
182
179
183
src_install() {
180
src_install() {
184
	apache-2_src_install
181
	apache-2_src_install
185
	local i
182
	local i
186
	local apache_tools_prune_list=(
183
	local apache_tools_prune_list=(
187
		/usr/bin/{htdigest,logresolve,htpasswd,htdbm,ab,httxt2dbm}
184
		/usr/bin/{htdigest,logresolve,htpasswd,htdbm,ab,httxt2dbm}
188
		/usr/sbin/{checkgid,fcgistarter,htcacheclean,rotatelogs}
185
		/usr/sbin/{checkgid,fcgistarter,htcacheclean,rotatelogs}
189
		/usr/share/man/man1/{logresolve.1,htdbm.1,htdigest.1,htpasswd.1,dbmmanage.1,ab.1}
186
		/usr/share/man/man1/{logresolve.1,htdbm.1,htdigest.1,htpasswd.1,dbmmanage.1,ab.1}
190
		/usr/share/man/man8/{rotatelogs.8,htcacheclean.8}
187
		/usr/share/man/man8/{rotatelogs.8,htcacheclean.8}
191
	)
188
	)
192
	for i in ${apache_tools_prune_list[@]} ; do
189
	for i in ${apache_tools_prune_list[@]} ; do
193
		rm "${ED}"/${i} || die "Failed to prune apache-tools bits"
190
		rm "${ED}"/${i} || die "Failed to prune apache-tools bits"
194
	done
191
	done
195
192
196
	# install apxs in /usr/bin (bug #502384) and put a symlink into the
197
	# old location until all ebuilds and eclasses have been modified to
198
	# use the new location.
199
	dobin support/apxs
193
	dobin support/apxs
200
	use split-usr && dosym ../bin/apxs /usr/sbin/apxs
201
194
202
	# Note: wait for mod_systemd to be included in some forthcoming release,
195
	# Note: wait for mod_systemd to be included in some forthcoming release,
203
	# Then apache2.4.service can be used and systemd support controlled
196
	# Then apache2.4.service can be used and systemd support controlled
204
	# through --enable-systemd
197
	# through --enable-systemd
205
	systemd_newunit "${FILESDIR}/apache2.4-hardened.service" "apache2.service"
198
	systemd_newunit "${FILESDIR}/apache2.4-hardened.service" "apache2.service"
206
	dotmpfiles "${FILESDIR}/apache.conf"
199
	dotmpfiles "${FILESDIR}/apache.conf"
207
	#insinto /etc/apache2/modules.d
200
	#insinto /etc/apache2/modules.d
208
	#doins "${FILESDIR}/00_systemd.conf"
201
	#doins "${FILESDIR}/00_systemd.conf"
209
202
210
	# Install http2 module config
203
	# Install http2 module config
211
	insinto /etc/apache2/modules.d
204
	insinto /etc/apache2/modules.d
212
	doins "${FILESDIR}"/41_mod_http2.conf
205
	doins "${FILESDIR}"/41_mod_http2.conf
213
206
214
	# Fix path to apache libdir
207
	# Fix path to apache libdir
215
	sed "s|@LIBDIR@|$(get_libdir)|" -i "${ED}"/usr/sbin/apache2ctl || die
208
	sed "s|@LIBDIR@|$(get_libdir)|" -i "${ED}"/usr/sbin/apache2ctl || die
216
}
209
}
217
210
218
pkg_postinst() {
211
pkg_postinst() {
219
	apache-2_pkg_postinst || die "apache-2_pkg_postinst failed"
212
	apache-2_pkg_postinst || die "apache-2_pkg_postinst failed"
220
213
221
	tmpfiles_process apache.conf #662544
214
	tmpfiles_process apache.conf #662544
222
215
223
	# warnings that default config might not work out of the box
216
	# warnings that default config might not work out of the box
224
	local mod cmod
217
	local mod cmod
225
	for mod in ${MODULE_CRITICAL} ; do
218
	for mod in ${MODULE_CRITICAL} ; do
226
		if ! use "apache2_modules_${mod}"; then
219
		if ! use "apache2_modules_${mod}"; then
227
			echo
220
			echo
228
			ewarn "Warning: Critical module not installed!"
221
			ewarn "Warning: Critical module not installed!"
229
			ewarn "Modules 'authn_core', 'authz_core' and 'unixd'"
222
			ewarn "Modules 'authn_core', 'authz_core' and 'unixd'"
230
			ewarn "are highly recomended but might not be in the base profile yet."
223
			ewarn "are highly recomended but might not be in the base profile yet."
231
			ewarn "Default config for ssl needs module 'socache_shmcb'."
224
			ewarn "Default config for ssl needs module 'socache_shmcb'."
232
			ewarn "Enabling the following flags is highly recommended:"
225
			ewarn "Enabling the following flags is highly recommended:"
233
			for cmod in ${MODULE_CRITICAL} ; do
226
			for cmod in ${MODULE_CRITICAL} ; do
234
				use "apache2_modules_${cmod}" || \
227
				use "apache2_modules_${cmod}" || \
235
					ewarn "+ apache2_modules_${cmod}"
228
					ewarn "+ apache2_modules_${cmod}"
236
			done
229
			done
237
			echo
230
			echo
238
			break
231
			break
239
		fi
232
		fi
240
	done
233
	done
241
	# warning for proxy_balancer and missing load balancing scheduler
234
	# warning for proxy_balancer and missing load balancing scheduler
242
	if use apache2_modules_proxy_balancer; then
235
	if use apache2_modules_proxy_balancer; then
243
		local lbset=
236
		local lbset=
244
		for mod in lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat; do
237
		for mod in lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat; do
245
			if use "apache2_modules_${mod}"; then
238
			if use "apache2_modules_${mod}"; then
246
				lbset=1 && break
239
				lbset=1 && break
247
			fi
240
			fi
248
		done
241
		done
249
		if [[ ! ${lbset} ]] ; then
242
		if [[ ! ${lbset} ]] ; then
250
			echo
243
			echo
251
			ewarn "Info: Missing load balancing scheduler algorithm module"
244
			ewarn "Info: Missing load balancing scheduler algorithm module"
252
			ewarn "(They were split off from proxy_balancer in 2.3)"
245
			ewarn "(They were split off from proxy_balancer in 2.3)"
253
			ewarn "In order to get the ability of load balancing, at least"
246
			ewarn "In order to get the ability of load balancing, at least"
254
			ewarn "one of these modules has to be present:"
247
			ewarn "one of these modules has to be present:"
255
			ewarn "lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat"
248
			ewarn "lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat"
256
			echo
249
			echo
257
		fi
250
		fi
258
	fi
251
	fi
259
}
252
}
260
- 

Return to bug 502384