|
1 ## |
|
2 ## apache.spec -- OpenPKG RPM Package Specification |
|
3 ## Copyright (c) 2000-2012 OpenPKG Foundation e.V. <http://openpkg.net/> |
|
4 ## |
|
5 ## Permission to use, copy, modify, and distribute this software for |
|
6 ## any purpose with or without fee is hereby granted, provided that |
|
7 ## the above copyright notice and this permission notice appear in all |
|
8 ## copies. |
|
9 ## |
|
10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
|
11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
|
12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
|
13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR |
|
14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
|
15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
|
16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
|
17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
|
18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
|
19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
|
20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
|
21 ## SUCH DAMAGE. |
|
22 ## |
|
23 |
|
24 # package information |
|
25 Name: apache |
|
26 Summary: Apache HTTP Server |
|
27 URL: http://httpd.apache.org/ |
|
28 Vendor: Apache Software Foundation |
|
29 Packager: OpenPKG Foundation e.V. |
|
30 Distribution: OpenPKG Community |
|
31 Class: BASE |
|
32 Group: Web |
|
33 License: ASF |
|
34 Version: 2.2.22 |
|
35 Release: 20120205 |
|
36 |
|
37 # package options |
|
38 %option with_mpm_prefork yes |
|
39 %option with_mpm_worker no |
|
40 %option with_mpm_event no |
|
41 %option with_suexec yes |
|
42 %option with_suexec_caller %{l_nusr} |
|
43 %option with_suexec_userdir public_html |
|
44 %option with_mod_deflate no |
|
45 %option with_mod_ext_filter no |
|
46 %option with_mod_substitute no |
|
47 %option with_mod_ssl no |
|
48 %option with_mod_dav no |
|
49 %option with_mod_ldap no |
|
50 %option with_mod_dbd no |
|
51 %option with_mod_proxy no |
|
52 %option with_mod_cache no |
|
53 %option with_mod_diskcache no |
|
54 %option with_mod_memcache no |
|
55 %option with_mod_filecache no |
|
56 %option with_mod_authn_alias no |
|
57 |
|
58 # fixing implicit inter-module dependencies and correlations |
|
59 %if "%{with_mpm_prefork}" == "yes" |
|
60 %undefine with_mpm_worker |
|
61 %undefine with_mpm_event |
|
62 %endif |
|
63 %if "%{with_mpm_worker}" == "yes" |
|
64 %undefine with_mpm_prefork |
|
65 %undefine with_mpm_event |
|
66 %endif |
|
67 %if "%{with_mpm_event}" == "yes" |
|
68 %undefine with_mpm_prefork |
|
69 %undefine with_mpm_worker |
|
70 %endif |
|
71 %if "%{with_mod_memcache}" == "yes" || "%{with_mod_diskcache}" == "yes" |
|
72 %undefine with_mod_cache |
|
73 %define with_mod_cache yes |
|
74 %endif |
|
75 |
|
76 # list of sources |
|
77 Source0: http://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2 |
|
78 Source1: rc.apache |
|
79 Source2: apache.base |
|
80 Source3: apache.conf |
|
81 Source4: apache.sh |
|
82 Patch0: apache.patch |
|
83 |
|
84 # build information |
|
85 BuildPreReq: OpenPKG, openpkg >= 20100101, perl, make |
|
86 PreReq: OpenPKG, openpkg >= 20100101, perl |
|
87 BuildPreReq: apr, pcre |
|
88 PreReq: apr, pcre |
|
89 %if "%{with_mpm_worker}" == "yes" || "%{with_mpm_event}" == "yes" || "%{with_mod_memcache}" == "yes" |
|
90 BuildPreReq: apr::with_threads = yes |
|
91 PreReq: apr::with_threads = yes |
|
92 %endif |
|
93 %if "%{with_mod_ldap}" == "yes" |
|
94 BuildPreReq: apr::with_ldap = yes |
|
95 PreReq: apr::with_ldap = yes |
|
96 %endif |
|
97 %if "%{with_mod_ssl}" == "yes" |
|
98 BuildPreReq: openssl >= 0.9.8 |
|
99 PreReq: openssl >= 0.9.8 |
|
100 PreReq: x509 |
|
101 %endif |
|
102 %if "%{with_mod_deflate}" == "yes" |
|
103 BuildPreReq: zlib |
|
104 PreReq: zlib |
|
105 %endif |
|
106 |
|
107 %description |
|
108 The Apache Project is a collaborative software development effort |
|
109 aimed at creating a robust, commercial-grade, featureful, and |
|
110 freely-available source code implementation of an HTTP (Web) server. |
|
111 The project is jointly managed by a group of volunteers located |
|
112 around the world, using the Internet and the Web to communicate, |
|
113 plan, and develop the server and its related documentation. These |
|
114 volunteers are known as the Apache Group. In addition, hundreds |
|
115 of users have contributed ideas, code, and documentation to the |
|
116 project. |
|
117 |
|
118 %track |
|
119 prog apache = { |
|
120 version = %{version} |
|
121 url = http://www.apache.org/dist/httpd/ |
|
122 regex = httpd-(2\.\d*[02468]\.\d+)\.tar\.(bz2|gz) |
|
123 } |
|
124 |
|
125 %prep |
|
126 # unpack Apache distribution |
|
127 %setup -q -n httpd-%{version} |
|
128 %patch -p0 |
|
129 %{l_shtool} subst \ |
|
130 -e 's;(" PLATFORM ");(%{l_openpkg_release -F "OpenPKG/%%t"});g' \ |
|
131 server/core.c |
|
132 |
|
133 %build |
|
134 # configure package |
|
135 ( echo "ac_cv_func_uuid_create=no" |
|
136 ) >config.cache |
|
137 export CC="%{l_cc}" |
|
138 export CFLAGS="%{l_cflags -O}" |
|
139 export CPPFLAGS="%{l_cppflags}" |
|
140 export LDFLAGS="%{l_ldflags}" |
|
141 export LIBS="" |
|
142 case "%{l_platform -t}" in |
|
143 *-sunos* ) LIBS="$LIBS -lrt" ;; |
|
144 esac |
|
145 %if "%{with_mod_ldap}" == "yes" |
|
146 LIBS="$LIBS -lssl -lcrypto" |
|
147 %endif |
|
148 ./configure \ |
|
149 --cache-file=./config.cache \ |
|
150 --enable-layout=GNU \ |
|
151 --prefix=%{l_prefix} \ |
|
152 --with-program-name=apache \ |
|
153 --sysconfdir=%{l_prefix}/etc/apache \ |
|
154 --libexecdir=%{l_prefix}/libexec/apache \ |
|
155 --includedir=%{l_prefix}/include/apache \ |
|
156 --datadir=%{l_prefix}/share/apache \ |
|
157 --localstatedir=%{l_prefix}/var/apache \ |
|
158 --with-apr=%{l_prefix}/bin/apr-1-config \ |
|
159 --with-apr-util=%{l_prefix}/bin/apu-1-config \ |
|
160 --with-pcre=%{l_prefix} \ |
|
161 %if "%{with_mpm_prefork}" == "yes" |
|
162 --with-mpm="prefork" \ |
|
163 %endif |
|
164 %if "%{with_mpm_worker}" == "yes" |
|
165 --with-mpm="worker" \ |
|
166 %endif |
|
167 %if "%{with_mpm_event}" == "yes" |
|
168 --with-mpm="event" \ |
|
169 %endif |
|
170 %if "%{with_mpm_worker}" == "yes" || "%{with_mpm_event}" == "yes" || "%{with_mod_memcache}" == "yes" |
|
171 --enable-threads \ |
|
172 %else |
|
173 --disable-threads \ |
|
174 %endif |
|
175 %if "%{with_suexec}" == "yes" |
|
176 --enable-suexec \ |
|
177 --with-suexec-bin=%{l_prefix}/sbin/suexec \ |
|
178 --with-suexec-caller=%{with_suexec_caller} \ |
|
179 --with-suexec-userdir=%{with_suexec_userdir} \ |
|
180 --with-suexec-logfile=%{l_prefix}/var/apache/log/suexec.log \ |
|
181 %endif |
|
182 %if "%{with_mod_deflate}" == "yes" |
|
183 --enable-deflate \ |
|
184 --with-z=%{l_prefix} \ |
|
185 %endif |
|
186 %if "%{with_mod_ext_filter}" == "yes" |
|
187 --enable-ext-filter \ |
|
188 %endif |
|
189 %if "%{with_mod_substitute}" == "yes" |
|
190 --enable-substitute \ |
|
191 %endif |
|
192 %if "%{with_mod_ssl}" == "yes" |
|
193 --enable-ssl \ |
|
194 --with-ssl=%{l_prefix} \ |
|
195 %endif |
|
196 %if "%{with_mod_dav}" == "yes" |
|
197 --enable-dav \ |
|
198 --enable-dav-fs \ |
|
199 --enable-dav-lock \ |
|
200 %endif |
|
201 %if "%{with_mod_ldap}" == "yes" |
|
202 --enable-ldap \ |
|
203 --enable-authnz-ldap \ |
|
204 %endif |
|
205 %if "%{with_mod_dbd}" == "yes" |
|
206 --enable-dbd \ |
|
207 --enable-authn-dbd \ |
|
208 %endif |
|
209 %if "%{with_mod_proxy}" == "yes" |
|
210 --enable-proxy \ |
|
211 --enable-proxy-connect \ |
|
212 --enable-proxy-http \ |
|
213 --enable-proxy-ftp \ |
|
214 --enable-proxy-ajp \ |
|
215 --enable-proxy-balancer \ |
|
216 %endif |
|
217 %if "%{with_mod_cache}" == "yes" |
|
218 --enable-cache \ |
|
219 %if "%{with_mod_diskcache}" == "yes" |
|
220 --enable-disk-cache \ |
|
221 %endif |
|
222 %if "%{with_mod_memcache}" == "yes" |
|
223 --enable-mem-cache \ |
|
224 %endif |
|
225 %endif |
|
226 %if "%{with_mod_filecache}" == "yes" |
|
227 --enable-file-cache \ |
|
228 %endif |
|
229 %if "%{with_mod_authn_alias}" == "yes" |
|
230 --enable-authn-alias \ |
|
231 %endif |
|
232 --enable-filter \ |
|
233 --enable-reqtimeout \ |
|
234 --enable-usertrack \ |
|
235 --enable-expires \ |
|
236 --enable-so \ |
|
237 --enable-speling \ |
|
238 --enable-rewrite \ |
|
239 --enable-headers \ |
|
240 --enable-info \ |
|
241 --enable-mime-magic \ |
|
242 --enable-vhost-alias \ |
|
243 --enable-auth-digest \ |
|
244 --enable-auth-dbm \ |
|
245 --enable-authz-dbm \ |
|
246 --enable-authz-owner \ |
|
247 --enable-unique-id \ |
|
248 --enable-logio \ |
|
249 --disable-shared |
|
250 |
|
251 # build package |
|
252 %{l_make} %{l_mflags} |
|
253 |
|
254 %install |
|
255 # install package |
|
256 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT |
|
257 |
|
258 # create additional directories |
|
259 %{l_shtool} mkdir -f -p -m 755 \ |
|
260 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \ |
|
261 $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d \ |
|
262 $RPM_BUILD_ROOT%{l_prefix}/var/apache/run/apache.dav \ |
|
263 $RPM_BUILD_ROOT%{l_prefix}/var/apache/run/apache.cache |
|
264 |
|
265 # adjust GNU libtool configuration for apxs(1) runtime |
|
266 %{l_shtool} install -c -m 755 \ |
|
267 -e 's;^build_libtool_libs=no;build_libtool_libs=yes;' \ |
|
268 %{l_prefix}/share/apr/build-1/libtool \ |
|
269 $RPM_BUILD_ROOT%{l_prefix}/share/apache/build/libtool |
|
270 |
|
271 # install shell environment script |
|
272 %{l_shtool} install -c -m 644 %{l_value -s -a} \ |
|
273 -e 's;@l_path@;%{l_build_path};' \ |
|
274 -e 's;@l_ld_library_path@;%{l_build_ldlp};' \ |
|
275 %{SOURCE apache.sh} \ |
|
276 $RPM_BUILD_ROOT%{l_prefix}/etc/apache/ |
|
277 |
|
278 # create default configuration |
|
279 l_hostname=`%{l_shtool} echo -e %h` |
|
280 l_domainname=`%{l_shtool} echo -e %d | cut -c2-` |
|
281 %{l_shtool} install -c -m 644 %{l_value -s -a} \ |
|
282 -e "s;@l_hostname@;$l_hostname;g" \ |
|
283 -e "s;@l_domainname@;$l_domainname;g" \ |
|
284 %{SOURCE apache.base} \ |
|
285 %{SOURCE apache.conf} \ |
|
286 $RPM_BUILD_ROOT%{l_prefix}/etc/apache/ |
|
287 mv $RPM_BUILD_ROOT%{l_prefix}/etc/apache/magic \ |
|
288 $RPM_BUILD_ROOT%{l_prefix}/etc/apache/mime.magic |
|
289 |
|
290 # install run-command script |
|
291 %{l_shtool} install -c -m 755 %{l_value -s -a} \ |
|
292 -e 's;@with_mod_filecache@;%{with_mod_filecache};g' \ |
|
293 %{SOURCE rc.apache} \ |
|
294 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ |
|
295 |
|
296 # strip down installation |
|
297 find $RPM_BUILD_ROOT%{l_prefix}/share/apache -name "*.orig" -print | xargs rm -f |
|
298 rm -f $RPM_BUILD_ROOT%{l_prefix}/share/apache/htdocs/apache_pb* |
|
299 rm -rf $RPM_BUILD_ROOT%{l_prefix}/etc/apache/{extra,original} |
|
300 rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/apache |
|
301 rm -f $RPM_BUILD_ROOT%{l_prefix}/cgi/test-cgi |
|
302 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true |
|
303 strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true |
|
304 ( cd $RPM_BUILD_ROOT%{l_prefix}/share/apache/manual |
|
305 find . -name "*.xml" -print | xargs rm -f |
|
306 find . -name "*.xml.*" -print | xargs rm -f |
|
307 find . -name "*.xsl" -print | xargs rm -f |
|
308 rm -rf style/xsl |
|
309 rm -rf style/latex |
|
310 ) || exit $? |
|
311 |
|
312 # determine installation files |
|
313 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
|
314 %{l_files_std} \ |
|
315 %if "%{with_suexec}" == "yes" |
|
316 '%attr(4755,%{l_susr},%{l_mgrp}) %{l_prefix}/sbin/suexec' \ |
|
317 %endif |
|
318 '%config %{l_prefix}/etc/apache/*' \ |
|
319 '%config %attr(444,%{l_musr},%{l_mgrp}) %{l_prefix}/etc/apache/apache.base' \ |
|
320 '%dir %attr(750,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/apache/run/apache.dav' \ |
|
321 '%dir %attr(750,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/apache/run/apache.cache' |
|
322 |
|
323 %files -f files |
|
324 |
|
325 %clean |
|
326 |
|
327 %post |
|
328 # after upgrade, restart service |
|
329 [ $1 -eq 2 ] || exit 0 |
|
330 eval `%{l_rc} apache status 2>/dev/null` |
|
331 [ ".$apache_active" = .yes ] && %{l_rc} apache restart |
|
332 exit 0 |
|
333 |
|
334 %preun |
|
335 # before erase, stop service and remove log files |
|
336 [ $1 -eq 0 ] || exit 0 |
|
337 %{l_rc} apache stop 2>/dev/null |
|
338 rm -f $RPM_INSTALL_PREFIX/var/apache/log/* >/dev/null 2>&1 || true |
|
339 rm -f $RPM_INSTALL_PREFIX/var/apache/run/*/* >/dev/null 2>&1 || true |
|
340 rm -f $RPM_INSTALL_PREFIX/var/apache/run/* >/dev/null 2>&1 || true |
|
341 exit 0 |
|
342 |