Line 0
Link Here
|
0 |
- |
1 |
# Copyright 1999-2015 Gentoo Foundation |
|
|
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Id$ |
4 |
|
5 |
EAPI=5 |
6 |
|
7 |
# latest gentoo apache files |
8 |
GENTOO_PATCHSTAMP="20140731" |
9 |
GENTOO_DEVELOPER="polynomial-c" |
10 |
GENTOO_PATCHNAME="gentoo-apache-2.4.10-r1" |
11 |
|
12 |
# IUSE/USE_EXPAND magic |
13 |
IUSE_MPMS_FORK="peruser prefork" |
14 |
IUSE_MPMS_THREAD="event worker" |
15 |
|
16 |
# << obsolete modules: |
17 |
# authn_default authz_default mem_cache |
18 |
# mem_cache is replaced by cache_disk |
19 |
# ?? buggy modules |
20 |
# proxy_scgi: startup error: undefined symbol "ap_proxy_release_connection", no fix found |
21 |
# >> added modules for reason: |
22 |
# compat: compatibility with 2.2 access control |
23 |
# authz_host: new module for access control |
24 |
# authn_core: functionality provided by authn_alias in previous versions |
25 |
# authz_core: new module, provides core authorization capabilities |
26 |
# cache_disk: replacement for mem_cache |
27 |
# lbmethod_byrequests: Split off from mod_proxy_balancer in 2.3 |
28 |
# lbmethod_bytraffic: Split off from mod_proxy_balancer in 2.3 |
29 |
# lbmethod_bybusyness: Split off from mod_proxy_balancer in 2.3 |
30 |
# lbmethod_heartbeat: Split off from mod_proxy_balancer in 2.3 |
31 |
# slotmem_shm: Slot-based shared memory provider (for lbmethod_byrequests). |
32 |
# socache_shmcb: shared object cache provider. Default config with ssl needs it |
33 |
# unixd: fixes startup error: Invalid command 'User' |
34 |
IUSE_MODULES="access_compat actions alias asis auth_basic auth_digest |
35 |
authn_alias authn_anon authn_core authn_dbd authn_dbm authn_file authz_core |
36 |
authz_dbd authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex |
37 |
cache cache_disk cern_meta charset_lite cgi cgid dav dav_fs dav_lock dbd deflate |
38 |
dir dumpio env expires ext_filter file_cache filter headers ident imagemap |
39 |
include info lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness |
40 |
lbmethod_heartbeat log_config log_forensic logio macro mime mime_magic negotiation |
41 |
proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_http proxy_scgi |
42 |
proxy_fcgi proxy_wstunnel rewrite ratelimit remoteip reqtimeout setenvif |
43 |
slotmem_shm speling socache_shmcb status substitute unique_id userdir usertrack |
44 |
unixd version vhost_alias" |
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 |
dav_fs:dav |
54 |
dav_lock:dav |
55 |
deflate:filter |
56 |
cache_disk:cache |
57 |
ext_filter:filter |
58 |
file_cache:cache |
59 |
lbmethod_byrequests:proxy_balancer |
60 |
lbmethod_byrequests:slotmem_shm |
61 |
lbmethod_bytraffic:proxy_balancer |
62 |
lbmethod_bybusyness:proxy_balancer |
63 |
lbmethod_heartbeat:proxy_balancer |
64 |
log_forensic:log_config |
65 |
logio:log_config |
66 |
cache_disk:cache |
67 |
mime_magic:mime |
68 |
proxy_ajp:proxy |
69 |
proxy_balancer:proxy |
70 |
proxy_balancer:slotmem_shm |
71 |
proxy_connect:proxy |
72 |
proxy_ftp:proxy |
73 |
proxy_http:proxy |
74 |
proxy_scgi:proxy |
75 |
proxy_fcgi:proxy |
76 |
proxy_wstunnel:proxy |
77 |
substitute:filter |
78 |
" |
79 |
|
80 |
# module<->define mappings |
81 |
MODULE_DEFINES=" |
82 |
auth_digest:AUTH_DIGEST |
83 |
authnz_ldap:AUTHNZ_LDAP |
84 |
cache:CACHE |
85 |
cache_disk:CACHE |
86 |
dav:DAV |
87 |
dav_fs:DAV |
88 |
dav_lock:DAV |
89 |
file_cache:CACHE |
90 |
info:INFO |
91 |
ldap:LDAP |
92 |
proxy:PROXY |
93 |
proxy_ajp:PROXY |
94 |
proxy_balancer:PROXY |
95 |
proxy_connect:PROXY |
96 |
proxy_ftp:PROXY |
97 |
proxy_http:PROXY |
98 |
proxy_fcgi:PROXY |
99 |
proxy_scgi:PROXY |
100 |
proxy_wstunnel:PROXY |
101 |
socache_shmcb:SSL |
102 |
ssl:SSL |
103 |
status:STATUS |
104 |
suexec:SUEXEC |
105 |
userdir:USERDIR |
106 |
" |
107 |
|
108 |
# critical modules for the default config |
109 |
MODULE_CRITICAL=" |
110 |
authn_core |
111 |
authz_core |
112 |
authz_host |
113 |
dir |
114 |
mime |
115 |
unixd |
116 |
" |
117 |
inherit eutils apache-2 systemd toolchain-funcs |
118 |
|
119 |
DESCRIPTION="The Apache Web Server" |
120 |
HOMEPAGE="http://httpd.apache.org/" |
121 |
|
122 |
# some helper scripts are Apache-1.1, thus both are here |
123 |
LICENSE="Apache-2.0 Apache-1.1" |
124 |
SLOT="2" |
125 |
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x64-macos ~x86-macos ~m68k-mint ~sparc64-solaris ~x64-solaris" |
126 |
IUSE="alpn" |
127 |
REQUIRED_USE="alpn? ( ssl )" |
128 |
|
129 |
DEPEND+=" |
130 |
alpn? ( |
131 |
!libressl? ( >=dev-libs/openssl-1.0.2:0= ) |
132 |
libressl? ( dev-libs/libressl:= ) |
133 |
)" |
134 |
RDEPEND+=" |
135 |
alpn? ( |
136 |
!libressl? ( >=dev-libs/openssl-1.0.2:0= ) |
137 |
libressl? ( dev-libs/libressl:= ) |
138 |
) |
139 |
" |
140 |
|
141 |
pkg_setup() { |
142 |
# dependend critical modules which are not allowed in global scope due |
143 |
# to USE flag conditionals (bug #499260) |
144 |
use ssl && MODULE_CRITICAL+=" socache_shmcb" |
145 |
use doc && MODULE_CRITICAL+=" alias negotiation setenvif" |
146 |
apache-2_pkg_setup |
147 |
} |
148 |
|
149 |
src_prepare() { |
150 |
use alpn && epatch "${FILESDIR}"/${PN}-2.4.12-alpn.patch #471512 |
151 |
apache-2_src_prepare |
152 |
} |
153 |
|
154 |
src_configure() { |
155 |
# Brain dead check. |
156 |
tc-is-cross-compiler && export ap_cv_void_ptr_lt_long="no" |
157 |
|
158 |
apache-2_src_configure |
159 |
} |
160 |
|
161 |
src_compile() { |
162 |
if tc-is-cross-compiler; then |
163 |
# This header is the same across targets, so use the build compiler. |
164 |
pushd server >/dev/null |
165 |
emake gen_test_char |
166 |
tc-export_build_env BUILD_CC |
167 |
${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_CPPFLAGS} ${BUILD_LDFLAGS} \ |
168 |
gen_test_char.c -o gen_test_char $(apr-1-config --includes) || die |
169 |
popd >/dev/null |
170 |
fi |
171 |
|
172 |
default |
173 |
} |
174 |
|
175 |
src_install() { |
176 |
apache-2_src_install |
177 |
for i in /usr/bin/{htdigest,logresolve,htpasswd,htdbm,ab,httxt2dbm}; do |
178 |
rm "${ED}"/$i || die "Failed to prune apache-tools bits" |
179 |
done |
180 |
for i in /usr/share/man/man8/{rotatelogs.8,htcacheclean.8}; do |
181 |
rm "${ED}"/$i || die "Failed to prune apache-tools bits" |
182 |
done |
183 |
for i in /usr/share/man/man1/{logresolve.1,htdbm.1,htdigest.1,htpasswd.1,dbmmanage.1,ab.1}; do |
184 |
rm "${ED}"/$i || die "Failed to prune apache-tools bits" |
185 |
done |
186 |
for i in /usr/sbin/{checkgid,fcgistarter,htcacheclean,rotatelogs}; do |
187 |
rm "${ED}/"$i || die "Failed to prune apache-tools bits" |
188 |
done |
189 |
|
190 |
# install apxs in /usr/bin (bug #502384) and put a symlink into the |
191 |
# old location until all ebuilds and eclasses have been modified to |
192 |
# use the new location. |
193 |
local apxs="/usr/bin/apxs" |
194 |
cp "${S}"/support/apxs "${ED}"${apxs} || die "Failed to install apxs" |
195 |
ln -s ../bin/apxs "${ED}"/usr/sbin/apxs || die |
196 |
chmod 0755 "${ED}"${apxs} || die |
197 |
|
198 |
# Note: wait for mod_systemd to be included in the next release, |
199 |
# then apache2.4.service can be used and systemd support controlled |
200 |
# through --enable-systemd |
201 |
systemd_newunit "${FILESDIR}/apache2.2.service" "apache2.service" |
202 |
systemd_dotmpfilesd "${FILESDIR}/apache.conf" |
203 |
#insinto /etc/apache2/modules.d |
204 |
#doins "${FILESDIR}/00_systemd.conf" |
205 |
} |
206 |
|
207 |
pkg_postinst() |
208 |
{ |
209 |
apache-2_pkg_postinst || die "apache-2_pkg_postinst failed" |
210 |
# warnings that default config might not work out of the box |
211 |
for mod in $MODULE_CRITICAL; do |
212 |
if ! use "apache2_modules_${mod}"; then |
213 |
echo |
214 |
ewarn "Warning: Critical module not installed!" |
215 |
ewarn "Modules 'authn_core', 'authz_core' and 'unixd'" |
216 |
ewarn "are highly recomended but might not be in the base profile yet." |
217 |
ewarn "Default config for ssl needs module 'socache_shmcb'." |
218 |
ewarn "Enabling the following flags is highly recommended:" |
219 |
for cmod in $MODULE_CRITICAL; do |
220 |
use "apache2_modules_${cmod}" || \ |
221 |
ewarn "+ apache2_modules_${cmod}" |
222 |
done |
223 |
echo |
224 |
break |
225 |
fi |
226 |
done |
227 |
# warning for proxy_balancer and missing load balancing scheduler |
228 |
if use apache2_modules_proxy_balancer; then |
229 |
local lbset= |
230 |
for mod in lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat; do |
231 |
if use "apache2_modules_${mod}"; then |
232 |
lbset=1 && break |
233 |
fi |
234 |
done |
235 |
if [ ! $lbset ]; then |
236 |
echo |
237 |
ewarn "Info: Missing load balancing scheduler algorithm module" |
238 |
ewarn "(They were split off from proxy_balancer in 2.3)" |
239 |
ewarn "In order to get the ability of load balancing, at least" |
240 |
ewarn "one of these modules has to be present:" |
241 |
ewarn "lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat" |
242 |
echo |
243 |
fi |
244 |
fi |
245 |
} |