bottleneck testcase based on rubbos
[bottlenecks.git] / rubbos / app / httpd-2.0.64 / build / rpm / httpd.spec.in
1 %define contentdir /var/www
2 %define suexec_caller apache
3 %define mmn APACHE_MMN
4
5 %ifarch ia64
6 # disable debuginfo on IA64
7 %define debug_package %{nil}
8 %endif
9
10 Summary: Apache HTTP Server
11 Name: httpd
12 Version: APACHE_VERSION
13 Release: APACHE_RELEASE
14 URL: http://httpd.apache.org/
15 Vendor: Apache Software Foundation
16 Source0: http://www.apache.org/dist/httpd/httpd-%{version}.tar.gz
17 License: Apache License, Version 2.0
18 Group: System Environment/Daemons
19 BuildRoot: %{_tmppath}/%{name}-root
20 BuildPrereq: apr-devel, apr-util-devel, openldap-devel, db4-devel, expat-devel, findutils, perl, pkgconfig
21 BuildPrereq: /usr/bin/apr-config, /usr/bin/apu-config
22 Requires: apr >= 0.9.7, apr-util >= 0.9.7, gawk, /usr/share/magic.mime, /usr/bin/find, openldap
23 Prereq: /sbin/chkconfig, /bin/mktemp, /bin/rm, /bin/mv
24 Prereq: sh-utils, textutils, /usr/sbin/useradd
25 Provides: webserver
26 Provides: httpd-mmn = %{mmn}
27 Conflicts: thttpd
28 Obsoletes: apache, secureweb, mod_dav
29
30 %description
31 Apache is a powerful, full-featured, efficient, and freely-available
32 Web server. Apache is also the most popular Web server on the
33 Internet.
34
35 %package devel
36 Group: Development/Libraries
37 Summary: Development tools for the Apache HTTP server.
38 Obsoletes: secureweb-devel, apache-devel
39 Requires: libtool, httpd = %{version}
40 Requires: apr-devel >= 0.9.7, apr-util-devel >= 0.9.7
41
42 %description devel
43 The httpd-devel package contains the APXS binary and other files
44 that you need to build Dynamic Shared Objects (DSOs) for Apache.
45
46 If you are installing the Apache HTTP server and you want to be
47 able to compile or develop additional modules for Apache, you need
48 to install this package.
49
50 %package manual
51 Group: Documentation
52 Summary: Documentation for the Apache HTTP server.
53 Obsoletes: secureweb-manual, apache-manual
54
55 %description manual
56 The httpd-manual package contains the complete manual and
57 reference guide for the Apache HTTP server. The information can
58 also be found at http://httpd.apache.org/docs/.
59
60 %package -n mod_ssl
61 Group: System Environment/Daemons
62 Summary: SSL/TLS module for the Apache HTTP server
63 Serial: 1
64 BuildPrereq: openssl-devel
65 Prereq: openssl, dev, /bin/cat
66 Requires: httpd, make, httpd-mmn = %{mmn}
67
68 %description -n mod_ssl
69 The mod_ssl module provides strong cryptography for the Apache Web
70 server via the Secure Sockets Layer (SSL) and Transport Layer
71 Security (TLS) protocols.
72
73 %prep
74 %setup -q
75
76 # Safety check: prevent build if defined MMN does not equal upstream MMN.
77 vmmn=`echo MODULE_MAGIC_NUMBER_MAJOR | cpp -include \`pwd\`/include/ap_mmn.h | grep -e '^[0-9]'`
78 if test x${vmmn} != x%{mmn}; then
79    : Error: Upstream MMN is now ${vmmn}, packaged MMN is %{mmn}.
80    : Update the mmn macro and rebuild.
81    exit 1
82 fi
83
84 # regenerate configure scripts
85 ./buildconf
86
87 # Before configure; fix location of build dir in generated apxs
88 %{__perl} -pi -e "s:\@exp_installbuilddir\@:%{_libdir}/httpd/build:g" \
89         support/apxs.in
90
91 %build
92
93 if pkg-config openssl ; then
94         # configure -C barfs with trailing spaces in CFLAGS
95         CFLAGS="$RPM_OPT_FLAGS `pkg-config --cflags openssl | sed 's/ *$//'`"
96         AP_LIBS="$AP_LIBS `pkg-config --libs openssl`"
97 else
98         CFLAGS="$RPM_OPT_FLAGS"
99         AP_LIBS="-lssl -lcrypto"
100 fi
101 export CFLAGS
102 export AP_LIBS
103
104 function mpmbuild()
105 {
106 mpm=$1; shift
107 mkdir $mpm; pushd $mpm
108 cat > config.cache <<EOF
109 ac_cv_func_pthread_mutexattr_setpshared=no
110 ac_cv_func_sem_open=no
111 EOF
112 ../configure -C \
113         --prefix=%{_sysconfdir}/httpd \
114         --with-apr=/usr/bin/apr-config \
115         --with-apr-util=/usr/bin/apu-config \
116         --exec-prefix=%{_prefix} \
117         --bindir=%{_bindir} \
118         --sbindir=%{_sbindir} \
119         --mandir=%{_mandir} \
120         --libdir=%{_libdir} \
121         --sysconfdir=%{_sysconfdir}/httpd/conf \
122         --includedir=%{_includedir}/httpd \
123         --libexecdir=%{_libdir}/httpd/modules \
124         --datadir=%{contentdir} \
125         --with-mpm=$mpm \
126         --enable-suexec --with-suexec \
127         --with-suexec-caller=%{suexec_caller} \
128         --with-suexec-docroot=%{contentdir} \
129         --with-suexec-logfile=%{_localstatedir}/log/httpd/suexec.log \
130         --with-suexec-bin=%{_sbindir}/suexec \
131         --with-suexec-uidmin=500 --with-suexec-gidmin=500 \
132         --with-devrandom \
133         --with-ldap --enable-ldap --enable-auth-ldap \
134         --enable-cache --enable-disk-cache --enable-mem-cache --enable-file-cache \
135         --enable-ssl --with-ssl \
136         --enable-deflate --enable-cgid \
137         --enable-proxy --enable-proxy-connect \
138         --enable-proxy-http --enable-proxy-ftp \
139         $*
140
141 make %{?_smp_mflags}
142 popd
143 }
144
145 # Only bother enabling optional modules for main build.
146 mpmbuild prefork --enable-mods-shared=all
147
148 # To prevent most modules being built statically into httpd.worker, 
149 # easiest way seems to be enable them shared.
150 mpmbuild worker --enable-mods-shared=all
151
152 # Verify that the same modules were built into the two httpd binaries
153 ./prefork/httpd -l | grep -v prefork > prefork.mods
154 ./worker/httpd -l | grep -v worker > worker.mods
155 if ! diff -u prefork.mods worker.mods; then
156   : Different modules built into httpd binaries, will not proceed
157   exit 1
158 fi
159
160 %install
161 rm -rf $RPM_BUILD_ROOT
162
163 pushd prefork
164 make DESTDIR=$RPM_BUILD_ROOT install
165 popd
166 # install worker binary
167 install -m 755 worker/httpd $RPM_BUILD_ROOT%{_sbindir}/httpd.worker
168
169 # mod_ssl bits
170 for suffix in crl crt csr key prm; do
171    mkdir $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf/ssl.${suffix}
172 done
173
174 # Makefiles for certificate management
175 #for ext in crt crl; do 
176 #  install -m 644 ./build/rpm/mod_ssl-Makefile.${ext} \
177 #       $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf/ssl.${ext}/Makefile.${ext}
178 #done
179 #ln -s ../../../usr/share/ssl/certs/Makefile $RPM_BUILD_ROOT/etc/httpd/conf
180
181 # for holding mod_dav lock database
182 mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/dav
183
184 # create a prototype session cache
185 mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/cache/mod_ssl
186 touch $RPM_BUILD_ROOT%{_localstatedir}/cache/mod_ssl/scache.{dir,pag,sem}
187
188 # move the build directory to within the library directory
189 mv $RPM_BUILD_ROOT%{contentdir}/build $RPM_BUILD_ROOT%{_libdir}/httpd/build
190
191 # fix up config_vars file: relocate the build directory into libdir;
192 # reference correct libtool from apr; remove references to RPM build root.
193 sed -e "s|%{contentdir}/build|%{_libdir}/httpd/build|g" \
194     -e "/AP_LIBS/d" -e "/abs_srcdir/d" \
195     -e "/^LIBTOOL/s|/[^ ]*/libtool|`apr-config --apr-libtool`|" \
196     -e "/^EXTRA_INCLUDES/s|-I$RPM_BUILD_DIR[^ ]* ||g" \
197   < prefork/build/config_vars.mk \
198   > $RPM_BUILD_ROOT%{_libdir}/httpd/build/config_vars.mk
199
200 # Make the MMN accessible to module packages
201 echo %{mmn} > $RPM_BUILD_ROOT%{_includedir}/httpd/.mmn
202
203 # docroot
204 mkdir $RPM_BUILD_ROOT%{contentdir}/html
205 rm -r $RPM_BUILD_ROOT%{contentdir}/manual/style
206
207 # logs
208 rmdir $RPM_BUILD_ROOT%{_sysconfdir}/httpd/logs
209 mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/httpd
210
211 # symlinks for /etc/httpd
212 ln -s ../..%{_localstatedir}/log/httpd $RPM_BUILD_ROOT/etc/httpd/logs
213 ln -s ../..%{_localstatedir}/run $RPM_BUILD_ROOT/etc/httpd/run
214 ln -s ../..%{_libdir}/httpd/modules $RPM_BUILD_ROOT/etc/httpd/modules
215 ln -s ../..%{_libdir}/httpd/build $RPM_BUILD_ROOT/etc/httpd/build
216
217 # install SYSV init stuff
218 mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
219 install -m755 ./build/rpm/httpd.init \
220         $RPM_BUILD_ROOT/etc/rc.d/init.d/httpd
221 %{__perl} -pi -e "s:\@docdir\@:%{_docdir}/%{name}-%{version}:g" \
222         $RPM_BUILD_ROOT/etc/rc.d/init.d/httpd   
223
224 # install log rotation stuff
225 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
226 install -m644 ./build/rpm/httpd.logrotate \
227         $RPM_BUILD_ROOT/etc/logrotate.d/httpd
228
229 # Remove unpackaged files
230 rm -rf $RPM_BUILD_ROOT%{_libdir}/httpd/modules/*.exp \
231        $RPM_BUILD_ROOT%{contentdir}/htdocs/* \
232        $RPM_BUILD_ROOT%{contentdir}/cgi-bin/* 
233
234 %pre
235 # Add the "apache" user
236 /usr/sbin/useradd -c "Apache" -u 48 \
237         -s /sbin/nologin -r -d %{contentdir} apache 2> /dev/null || :
238
239 %triggerpostun -- apache < 2.0
240 /sbin/chkconfig --add httpd
241
242 %post
243 # Register the httpd service
244 /sbin/chkconfig --add httpd
245
246 %preun
247 if [ $1 = 0 ]; then
248         /sbin/service httpd stop > /dev/null 2>&1
249         /sbin/chkconfig --del httpd
250 fi
251
252 %post -n mod_ssl
253 /sbin/ldconfig ### is this needed?
254 umask 077
255
256 if [ ! -f %{_sysconfdir}/httpd/conf/ssl.key/server.key ] ; then
257 %{_bindir}/openssl genrsa -rand /proc/apm:/proc/cpuinfo:/proc/dma:/proc/filesystems:/proc/interrupts:/proc/ioports:/proc/pci:/proc/rtc:/proc/uptime 1024 > %{_sysconfdir}/httpd/conf/ssl.key/server.key 2> /dev/null
258 fi
259
260 FQDN=`hostname`
261 if [ "x${FQDN}" = "x" ]; then
262    FQDN=localhost.localdomain
263 fi
264
265 if [ ! -f %{_sysconfdir}/httpd/conf/ssl.crt/server.crt ] ; then
266 cat << EOF | %{_bindir}/openssl req -new -key %{_sysconfdir}/httpd/conf/ssl.key/server.key -x509 -days 365 -out %{_sysconfdir}/httpd/conf/ssl.crt/server.crt 2>/dev/null
267 --
268 SomeState
269 SomeCity
270 SomeOrganization
271 SomeOrganizationalUnit
272 ${FQDN}
273 root@${FQDN}
274 EOF
275 fi
276
277 %clean
278 rm -rf $RPM_BUILD_ROOT
279
280 %files
281 %defattr(-,root,root)
282
283 %doc ABOUT_APACHE README CHANGES LICENSE NOTICE
284
285 %dir %{_sysconfdir}/httpd
286 %{_sysconfdir}/httpd/modules
287 %{_sysconfdir}/httpd/logs
288 %{_sysconfdir}/httpd/run
289 %dir %{_sysconfdir}/httpd/conf
290 %config(noreplace) %{_sysconfdir}/httpd/conf/*.conf
291 %config(noreplace) %{_sysconfdir}/httpd/conf/magic
292 %config(noreplace) %{_sysconfdir}/httpd/conf/mime.types
293
294 %config %{_sysconfdir}/logrotate.d/httpd
295 %config %{_sysconfdir}/rc.d/init.d/httpd
296
297 #%dir %{_sysconfdir}/httpd/conf
298
299 %{_sbindir}/ab
300 %{_sbindir}/htdbm
301 %{_sbindir}/htdigest
302 %{_sbindir}/htpasswd
303 %{_sbindir}/httxt2dbm
304 %{_sbindir}/logresolve
305 %{_sbindir}/httpd
306 %{_sbindir}/httpd.worker
307 %{_sbindir}/apachectl
308 %{_sbindir}/rotatelogs
309 %attr(4510,root,%{suexec_caller}) %{_sbindir}/suexec
310
311 %dir %{_libdir}/httpd
312 %dir %{_libdir}/httpd/modules
313 # everything but mod_ssl.so:
314 %{_libdir}/httpd/modules/mod_[a-r]*.so
315 %{_libdir}/httpd/modules/mod_s[petu]*.so
316 %{_libdir}/httpd/modules/mod_[t-z]*.so
317
318 %dir %{contentdir}
319 %dir %{contentdir}/cgi-bin
320 %dir %{contentdir}/html
321 %dir %{contentdir}/icons
322 %dir %{contentdir}/error
323 %dir %{contentdir}/error/include
324 %{contentdir}/icons/*
325 %{contentdir}/error/README
326 %config(noreplace) %{contentdir}/error/*.var
327 %config(noreplace) %{contentdir}/error/include/*.html
328
329 %attr(0700,root,root) %dir %{_localstatedir}/log/httpd
330
331 %attr(0700,apache,apache) %dir %{_localstatedir}/lib/dav
332
333 %{_mandir}/man1/*
334 %{_mandir}/man8/ab*
335 %{_mandir}/man8/apachectl*
336 %{_mandir}/man8/httpd*
337 %{_mandir}/man8/logresolve*
338 %{_mandir}/man8/rotatelogs*
339 %{_mandir}/man8/suexec*
340
341 %files manual
342 %defattr(-,root,root)
343 %{contentdir}/manual
344
345 %files -n mod_ssl
346 %defattr(-,root,root)
347 %{_libdir}/httpd/modules/mod_ssl.so
348 %config(noreplace) %{_sysconfdir}/httpd/conf/ssl.conf
349 %attr(0700,root,root) %dir %{_sysconfdir}/httpd/conf/ssl.*
350 #%config %{_sysconfdir}/httpd/conf/Makefile
351 #%dir %{_sysconfdir}/httpd/conf/ssl.*
352 %attr(0700,apache,root) %dir %{_localstatedir}/cache/mod_ssl
353 %attr(0600,apache,root) %ghost %{_localstatedir}/cache/mod_ssl/scache.dir
354 %attr(0600,apache,root) %ghost %{_localstatedir}/cache/mod_ssl/scache.pag
355 %attr(0600,apache,root) %ghost %{_localstatedir}/cache/mod_ssl/scache.sem
356
357 %files devel
358 %defattr(-,root,root)
359 %{_includedir}/httpd
360 %{_sysconfdir}/httpd/build
361 %{_sbindir}/apxs
362 %{_sbindir}/checkgid
363 %{_sbindir}/dbmmanage
364 %{_sbindir}/envvars*
365 %{_mandir}/man8/apxs.8*
366 %dir %{_libdir}/httpd/build
367 %{_libdir}/httpd/build/*.mk
368 %{_libdir}/httpd/build/config.nice
369 %{_libdir}/httpd/build/instdso.sh
370
371 %changelog
372 * Mon Mar 27 2006 Graham Leggett <minfrin@apache.org> 2.0.56-dev
373 - Add the missing file-cache module to the cache family of modules in
374   the RPM.
375
376 * Tue Oct 11 2005 Graham Leggett <minfrin@apache.org> 2.0.56-dev
377 - Updated the apr and apr-util dependencies to require at least v0.9.7
378 - Stop trying to remove *.xml doc files, the httpd build does that already.
379
380 * Thu Dec 16 2004 Graham Leggett <minfrin@apache.org> 2.0.53-dev
381 - Changed build to use external apr and apr-util
382
383 * Sat Apr 5 2003 Graham Leggett <minfrin@apache.org> 2.0.46-dev
384 - Moved mime.types back to the default location.
385 - Added mod_ldap and friends, mod_cache and friends.
386 - Added openldap dependancy.
387
388 * Sun Mar 30 2003 Graham Leggett <minfrin@apache.org> 2.0.45-1
389 - Created generic Apache rpm spec file from that donated by Redhat.
390 - Removed Redhat specific patches and boilerplate files.
391 - Removed SSL related Makefiles.
392
393 * Mon Feb 24 2003 Joe Orton <jorton@redhat.com> 2.0.40-21
394 - add security fix for CAN-2003-0020; replace non-printable characters
395   with '!' when printing to error log.
396 - disable debuginfo on IA64.
397
398 * Tue Feb 11 2003 Joe Orton <jorton@redhat.com> 2.0.40-20
399 - disable POSIX semaphores to support 2.4.18 kernel (#83324)
400
401 * Wed Jan 29 2003 Joe Orton <jorton@redhat.com> 2.0.40-19
402 - require xmlto 0.0.11 or later
403 - fix apr_strerror on glibc2.3
404
405 * Wed Jan 22 2003 Tim Powers <timp@redhat.com> 2.0.40-18
406 - rebuilt
407
408 * Thu Jan 16 2003 Joe Orton <jorton@redhat.com> 2.0.40-17
409 - add mod_cgid and httpd binary built with worker MPM (#75496)
410 - allow choice of httpd binary in init script
411 - pick appropriate CGI module based on loaded MPM in httpd.conf
412 - source /etc/sysconfig/httpd in apachectl to get httpd choice
413 - make "apachectl status" fail gracefully when links isn't found (#78159)
414
415 * Mon Jan 13 2003 Joe Orton <jorton@redhat.com> 2.0.40-16
416 - rebuild for OpenSSL 0.9.7
417
418 * Fri Jan  3 2003 Joe Orton <jorton@redhat.com> 2.0.40-15
419 - fix possible infinite recursion in config dir processing (#77206)
420 - fix memory leaks in request body processing (#79282)
421
422 * Thu Dec 12 2002 Joe Orton <jorton@redhat.com> 2.0.40-14
423 - remove unstable shmht session cache from mod_ssl
424 - get SSL libs from pkg-config if available (Nalin Dahyabhai)
425 - stop "apxs -a -i" from inserting AddModule into httpd.conf (#78676)
426
427 * Wed Nov  6 2002 Joe Orton <jorton@redhat.com> 2.0.40-13
428 - fix location of installbuilddir in apxs when libdir!=/usr/lib
429
430 * Wed Nov  6 2002 Joe Orton <jorton@redhat.com> 2.0.40-12
431 - pass libdir to configure; clean up config_vars.mk
432 - package instdso.sh, fixing apxs -i (#73428)
433 - prevent build if upstream MMN differs from mmn macro
434 - remove installed but unpackaged files
435
436 * Wed Oct  9 2002 Joe Orton <jorton@redhat.com> 2.0.40-11
437 - correct SERVER_NAME encoding in i18n error pages (thanks to Andre Malo)
438
439 * Wed Oct  9 2002 Joe Orton <jorton@redhat.com> 2.0.40-10
440 - fix patch for CAN-2002-0840 to also cover i18n error pages
441
442 * Wed Oct  2 2002 Joe Orton <jorton@redhat.com> 2.0.40-9
443 - security fixes for CAN-2002-0840 and CAN-2002-0843
444 - fix for possible mod_dav segfault for certain requests
445
446 * Tue Sep 24 2002 Gary Benson <gbenson@redhat.com>
447 - updates to the migration guide
448
449 * Wed Sep  4 2002 Nalin Dahyabhai <nalin@redhat.com> 2.0.40-8
450 - link httpd with libssl to avoid library loading/unloading weirdness
451
452 * Tue Sep  3 2002 Joe Orton <jorton@redhat.com> 2.0.40-7
453 - add LoadModule lines for proxy modules in httpd.conf (#73349)
454 - fix permissions of conf/ssl.*/ directories; add Makefiles for
455   certificate management (#73352)
456
457 * Mon Sep  2 2002 Joe Orton <jorton@redhat.com> 2.0.40-6
458 - provide "httpd-mmn" to manage module ABI compatibility
459
460 * Sun Sep  1 2002 Joe Orton <jorton@redhat.com> 2.0.40-5
461 - fix SSL session cache (#69699)
462 - revert addition of LDAP support to apr-util
463
464 * Mon Aug 26 2002 Joe Orton <jorton@redhat.com> 2.0.40-4
465 - set SIGXFSZ disposition to "ignored" (#69520)
466 - make dummy connections to the first listener in config (#72692)
467
468 * Mon Aug 26 2002 Joe Orton <jorton@redhat.com> 2.0.40-3
469 - allow "apachectl configtest" on a 1.3 httpd.conf
470 - add mod_deflate
471 - enable LDAP support in apr-util
472 - don't package everything in /var/www/error as config(noreplace)
473
474 * Wed Aug 21 2002 Bill Nottingham <notting@redhat.com> 2.0.40-2
475 - add trigger (#68657)
476
477 * Mon Aug 12 2002 Joe Orton <jorton@redhat.com> 2.0.40-1
478 - update to 2.0.40
479
480 * Wed Jul 24 2002 Joe Orton <jorton@redhat.com> 2.0.36-8
481 - improve comment on use of UserDir in default config (#66886)
482
483 * Wed Jul 10 2002 Joe Orton <jorton@redhat.com> 2.0.36-7
484 - use /sbin/nologin as shell for apache user (#68371)
485 - add patch from CVS to fix possible infinite loop when processing
486   internal redirects
487
488 * Wed Jun 26 2002 Gary Benson <gbenson@redhat.com> 2.0.36-6
489 - modify init script to detect 1.3.x httpd.conf's and direct users
490   to the migration guide
491
492 * Tue Jun 25 2002 Gary Benson <gbenson@redhat.com> 2.0.36-5
493 - patch apachectl to detect 1.3.x httpd.conf's and direct users
494   to the migration guide
495 - ship the migration guide
496
497 * Fri Jun 21 2002 Joe Orton <jorton@redhat.com>
498 - move /etc/httpd2 back to /etc/httpd
499 - add noindex.html page and poweredby logo; tweak default config
500   to load noindex.html if no default "/" page is present.
501 - add patch to prevent mutex errors on graceful restart
502
503 * Fri Jun 21 2002 Tim Powers <timp@redhat.com> 2.0.36-4
504 - automated rebuild
505
506 * Wed Jun 12 2002 Joe Orton <jorton@redhat.com> 2.0.36-3
507 - add patch to fix SSL mutex handling
508
509 * Wed Jun 12 2002 Joe Orton <jorton@redhat.com> 2.0.36-2
510 - improved config directory patch
511
512 * Mon May 20 2002 Joe Orton <jorton@redhat.com>
513 - initial build; based heavily on apache.spec and mod_ssl.spec
514 - fixes: #65214, #58490, #57376, #61265, #65518, #58177, #57245