summaryrefslogtreecommitdiff
path: root/httpd.spec
diff options
context:
space:
mode:
authorStefan Fritsch <sf@sfritsch.de>2011-12-27 19:42:47 +0100
committerStefan Fritsch <sf@sfritsch.de>2011-12-27 19:42:47 +0100
commitd9f98b967bedecc0bffe82682d1ed4e06c9df687 (patch)
tree0f252658cdeaca951fc4214634bc45392aba41d2 /httpd.spec
parent6a3ba4eb1e9c7d7e07529543117d79ac01af20f5 (diff)
downloadapache2-d9f98b967bedecc0bffe82682d1ed4e06c9df687.tar.gz
Upstream tarball 2.2.14upstream/2.2.14
Diffstat (limited to 'httpd.spec')
-rw-r--r--httpd.spec156
1 files changed, 65 insertions, 91 deletions
diff --git a/httpd.spec b/httpd.spec
index 63510a24..404bacde 100644
--- a/httpd.spec
+++ b/httpd.spec
@@ -1,25 +1,21 @@
%define contentdir /var/www
%define suexec_caller apache
%define mmn 20051115
-
-%ifarch ia64
-# disable debuginfo on IA64
-%define debug_package %{nil}
-%endif
+%define mpms worker event
Summary: Apache HTTP Server
Name: httpd
-Version: 2.2.13
+Version: 2.2.14
Release: 1
URL: http://httpd.apache.org/
Vendor: Apache Software Foundation
Source0: http://www.apache.org/dist/httpd/httpd-%{version}.tar.gz
License: Apache License, Version 2.0
Group: System Environment/Daemons
-BuildRoot: %{_tmppath}/%{name}-root
-BuildPrereq: apr-devel, apr-util-devel, openldap-devel, db4-devel, expat-devel, findutils, perl, pkgconfig
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+BuildPrereq: apr-devel, apr-util-devel, openldap-devel, db4-devel, expat-devel, findutils, perl, pkgconfig, pcre-devel >= 5.0
BuildPrereq: /usr/bin/apr-1-config, /usr/bin/apu-1-config
-Requires: apr >= 1.2.0, apr-util >= 1.2.0, gawk, /usr/share/magic.mime, /usr/bin/find, openldap
+Requires: apr >= 1.2.0, apr-util >= 1.2.0, pcre >= 5.0, gawk, /usr/share/magic.mime, /usr/bin/find, openldap
Prereq: /sbin/chkconfig, /bin/mktemp, /bin/rm, /bin/mv
Prereq: sh-utils, textutils, /usr/sbin/useradd
Provides: webserver
@@ -60,7 +56,6 @@ also be found at http://httpd.apache.org/docs/.
%package -n mod_ssl
Group: System Environment/Daemons
Summary: SSL/TLS module for the Apache HTTP server
-Serial: 1
BuildPrereq: openssl-devel
Prereq: openssl, dev, /bin/cat
Requires: httpd, make, httpd-mmn = %{mmn}
@@ -74,45 +69,31 @@ Security (TLS) protocols.
%setup -q
# Safety check: prevent build if defined MMN does not equal upstream MMN.
-vmmn=`echo MODULE_MAGIC_NUMBER_MAJOR | cpp -include \`pwd\`/include/ap_mmn.h | grep -e '^[0-9]'`
-if test x${vmmn} != x%{mmn}; then
+vmmn=`echo MODULE_MAGIC_NUMBER_MAJOR | cpp -include include/ap_mmn.h | sed -n '
+/^2/p'`
+if test "x${vmmn}" != "x%{mmn}"; then
: Error: Upstream MMN is now ${vmmn}, packaged MMN is %{mmn}.
: Update the mmn macro and rebuild.
exit 1
fi
-# regenerate configure scripts
-./buildconf
+%build
+# forcibly prevent use of bundled apr, apr-util, pcre
+rm -rf srclib/{apr,apr-util,pcre}
# Before configure; fix location of build dir in generated apxs
%{__perl} -pi -e "s:\@exp_installbuilddir\@:%{_libdir}/httpd/build:g" \
support/apxs.in
-%build
-
-if pkg-config openssl ; then
- # configure -C barfs with trailing spaces in CFLAGS
- CFLAGS="$RPM_OPT_FLAGS `pkg-config --cflags openssl | sed 's/ *$//'`"
- AP_LIBS="$AP_LIBS `pkg-config --libs openssl`"
-else
- CFLAGS="$RPM_OPT_FLAGS"
- AP_LIBS="-lssl -lcrypto"
-fi
-export CFLAGS
-export AP_LIBS
-
function mpmbuild()
{
mpm=$1; shift
mkdir $mpm; pushd $mpm
-cat > config.cache <<EOF
-ac_cv_func_pthread_mutexattr_setpshared=no
-ac_cv_func_sem_open=no
-EOF
-../configure -C \
+../configure \
--prefix=%{_sysconfdir}/httpd \
--with-apr=/usr/bin/apr-1-config \
--with-apr-util=/usr/bin/apu-1-config \
+ --with-pcre=/usr/bin/pcre-config \
--exec-prefix=%{_prefix} \
--bindir=%{_bindir} \
--sbindir=%{_sbindir} \
@@ -122,6 +103,7 @@ EOF
--includedir=%{_includedir}/httpd \
--libexecdir=%{_libdir}/httpd/modules \
--datadir=%{contentdir} \
+ --with-installbuilddir=%{_libdir}/httpd/build \
--with-mpm=$mpm \
--enable-suexec --with-suexec \
--with-suexec-caller=%{suexec_caller} \
@@ -129,33 +111,30 @@ EOF
--with-suexec-logfile=%{_localstatedir}/log/httpd/suexec.log \
--with-suexec-bin=%{_sbindir}/suexec \
--with-suexec-uidmin=500 --with-suexec-gidmin=500 \
- --with-devrandom \
- --with-ldap --enable-ldap --enable-authnz-ldap \
- --enable-cache --enable-disk-cache --enable-mem-cache --enable-file-cache \
- --enable-ssl --with-ssl \
- --enable-deflate --enable-cgid \
- --enable-proxy --enable-proxy-connect \
- --enable-proxy-http --enable-proxy-ftp \
+ --enable-pie \
+ --with-pcre \
$*
make %{?_smp_mflags}
popd
}
-# Only bother enabling optional modules for main build.
-mpmbuild prefork --enable-mods-shared=all
-
-# To prevent most modules being built statically into httpd.worker,
-# easiest way seems to be enable them shared.
-mpmbuild worker --enable-mods-shared=all
-
-# Verify that the same modules were built into the two httpd binaries
-./prefork/httpd -l | grep -v prefork > prefork.mods
-./worker/httpd -l | grep -v worker > worker.mods
-if ! diff -u prefork.mods worker.mods; then
- : Different modules built into httpd binaries, will not proceed
- exit 1
-fi
+ # Build everything and the kitchen sink with the prefork build
+mpmbuild prefork \
+ --enable-mods-shared=all \
+ --enable-ssl --with-ssl --enable-distcache \
+ --enable-proxy \
+ --enable-cache \
+ --enable-disk-cache \
+ --enable-ldap --enable-authnz-ldap \
+ --enable-cgid \
+ --enable-authn-anon --enable-authn-alias \
+ --disable-imagemap
+
+# For the other MPMs, just build httpd and no optional modules
+for f in %{mpms}; do
+ mpmbuild $f --enable-mods-shared=all
+done
%install
rm -rf $RPM_BUILD_ROOT
@@ -163,21 +142,12 @@ rm -rf $RPM_BUILD_ROOT
pushd prefork
make DESTDIR=$RPM_BUILD_ROOT install
popd
-# install worker binary
-install -m 755 worker/httpd $RPM_BUILD_ROOT%{_sbindir}/httpd.worker
-# mod_ssl bits
-for suffix in crl crt csr key prm; do
- mkdir $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf/ssl.${suffix}
+# install alternative MPMs
+for f in %{mpms}; do
+ install -m 755 ${f}/httpd $RPM_BUILD_ROOT%{_sbindir}/httpd.${f}
done
-# Makefiles for certificate management
-#for ext in crt crl; do
-# install -m 644 ./build/rpm/mod_ssl-Makefile.${ext} \
-# $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf/ssl.${ext}/Makefile.${ext}
-#done
-#ln -s ../../../usr/share/ssl/certs/Makefile $RPM_BUILD_ROOT/etc/httpd/conf
-
# for holding mod_dav lock database
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/dav
@@ -188,38 +158,28 @@ touch $RPM_BUILD_ROOT%{_localstatedir}/cache/mod_ssl/scache.{dir,pag,sem}
# move the build directory to within the library directory
mv $RPM_BUILD_ROOT%{contentdir}/build $RPM_BUILD_ROOT%{_libdir}/httpd/build
-# fix up config_vars file: relocate the build directory into libdir;
-# reference correct libtool from apr; remove references to RPM build root.
-sed -e "s|%{contentdir}/build|%{_libdir}/httpd/build|g" \
- -e "/AP_LIBS/d" -e "/abs_srcdir/d" \
- -e "/^LIBTOOL/s|/[^ ]*/libtool|`/usr/bin/apr-1-config --apr-libtool`|" \
- -e "/^EXTRA_INCLUDES/s|-I$RPM_BUILD_DIR[^ ]* ||g" \
- < prefork/build/config_vars.mk \
- > $RPM_BUILD_ROOT%{_libdir}/httpd/build/config_vars.mk
-
# Make the MMN accessible to module packages
echo %{mmn} > $RPM_BUILD_ROOT%{_includedir}/httpd/.mmn
# docroot
mkdir $RPM_BUILD_ROOT%{contentdir}/html
-rm -r $RPM_BUILD_ROOT%{contentdir}/manual/style
-# logs
+# Set up /var directories
rmdir $RPM_BUILD_ROOT%{_sysconfdir}/httpd/logs
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/httpd
+mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/cache/httpd/cache-root
# symlinks for /etc/httpd
ln -s ../..%{_localstatedir}/log/httpd $RPM_BUILD_ROOT/etc/httpd/logs
ln -s ../..%{_localstatedir}/run $RPM_BUILD_ROOT/etc/httpd/run
ln -s ../..%{_libdir}/httpd/modules $RPM_BUILD_ROOT/etc/httpd/modules
-ln -s ../..%{_libdir}/httpd/build $RPM_BUILD_ROOT/etc/httpd/build
# install SYSV init stuff
mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
install -m755 ./build/rpm/httpd.init \
$RPM_BUILD_ROOT/etc/rc.d/init.d/httpd
-%{__perl} -pi -e "s:\@docdir\@:%{_docdir}/%{name}-%{version}:g" \
- $RPM_BUILD_ROOT/etc/rc.d/init.d/httpd
+install -m755 ./build/rpm/htcacheclean.init \
+ $RPM_BUILD_ROOT/etc/rc.d/init.d/htcacheclean
# install log rotation stuff
mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
@@ -231,26 +191,28 @@ rm -rf $RPM_BUILD_ROOT%{_libdir}/httpd/modules/*.exp \
$RPM_BUILD_ROOT%{contentdir}/htdocs/* \
$RPM_BUILD_ROOT%{contentdir}/cgi-bin/*
+# Make suexec a+rw so it can be stripped. %%files lists real permissions
+chmod 755 $RPM_BUILD_ROOT%{_sbindir}/suexec
+
%pre
# Add the "apache" user
/usr/sbin/useradd -c "Apache" -u 48 \
-s /sbin/nologin -r -d %{contentdir} apache 2> /dev/null || :
-%triggerpostun -- apache < 2.0
-/sbin/chkconfig --add httpd
-
%post
# Register the httpd service
/sbin/chkconfig --add httpd
+/sbin/chkconfig --add htcacheclean
%preun
if [ $1 = 0 ]; then
/sbin/service httpd stop > /dev/null 2>&1
+ /sbin/service htcacheclean stop > /dev/null 2>&1
/sbin/chkconfig --del httpd
+ /sbin/chkconfig --del htcacheclean
fi
%post -n mod_ssl
-/sbin/ldconfig ### is this needed?
umask 077
if [ ! -f %{_sysconfdir}/httpd/conf/ssl.key/server.key ] ; then
@@ -274,6 +236,23 @@ root@${FQDN}
EOF
fi
+%check
+# Check the built modules are all PIC
+if readelf -d $RPM_BUILD_ROOT%{_libdir}/httpd/modules/*.so | grep TEXTREL; then
+ : modules contain non-relocatable code
+ exit 1
+fi
+
+# Verify that the same modules were built into the httpd binaries
+./prefork/httpd -l | grep -v prefork > prefork.mods
+for mpm in %{mpms}; do
+ ./${mpm}/httpd -l | grep -v ${mpm} > ${mpm}.mods
+ if ! diff -u prefork.mods ${mpm}.mods; then
+ : Different modules built into httpd binaries, will not proceed
+ exit 1
+ fi
+done
+
%clean
rm -rf $RPM_BUILD_ROOT
@@ -314,6 +293,7 @@ rm -rf $RPM_BUILD_ROOT
%config %{_sysconfdir}/logrotate.d/httpd
%config %{_sysconfdir}/rc.d/init.d/httpd
+%config %{_sysconfdir}/rc.d/init.d/htcacheclean
%{_sbindir}/ab
%{_sbindir}/htcacheclean
@@ -323,6 +303,7 @@ rm -rf $RPM_BUILD_ROOT
%{_sbindir}/logresolve
%{_sbindir}/httpd
%{_sbindir}/httpd.worker
+%{_sbindir}/httpd.event
%{_sbindir}/httxt2dbm
%{_sbindir}/apachectl
%{_sbindir}/rotatelogs
@@ -349,6 +330,7 @@ rm -rf $RPM_BUILD_ROOT
%attr(0700,root,root) %dir %{_localstatedir}/log/httpd
%attr(0700,apache,apache) %dir %{_localstatedir}/lib/dav
+%attr(0700,apache,apache) %dir %{_localstatedir}/cache/httpd/cache-root
%{_mandir}/man1/*
%{_mandir}/man8/ab*
@@ -367,13 +349,6 @@ rm -rf $RPM_BUILD_ROOT
%files -n mod_ssl
%defattr(-,root,root)
%{_libdir}/httpd/modules/mod_ssl.so
-%attr(0700,root,root) %dir %{_sysconfdir}/httpd/conf/ssl.crl
-%attr(0700,root,root) %dir %{_sysconfdir}/httpd/conf/ssl.crt
-%attr(0700,root,root) %dir %{_sysconfdir}/httpd/conf/ssl.csr
-%attr(0700,root,root) %dir %{_sysconfdir}/httpd/conf/ssl.key
-%attr(0700,root,root) %dir %{_sysconfdir}/httpd/conf/ssl.prm
-#%config %{_sysconfdir}/httpd/conf/Makefile
-#%dir %{_sysconfdir}/httpd/conf/ssl.*
%config(noreplace) %{_sysconfdir}/httpd/conf/original/extra/httpd-ssl.conf
%config(noreplace) %{_sysconfdir}/httpd/conf/extra/httpd-ssl.conf
%attr(0700,apache,root) %dir %{_localstatedir}/cache/mod_ssl
@@ -384,7 +359,6 @@ rm -rf $RPM_BUILD_ROOT
%files devel
%defattr(-,root,root)
%{_includedir}/httpd
-%{_sysconfdir}/httpd/build
%{_sbindir}/apxs
%{_sbindir}/checkgid
%{_sbindir}/dbmmanage