%define contentdir /var/www %define localstatedir /var %define apache_uid 64500 %define apache_gid 64500 Summary: Apache HTTP Server Name: httpd Version: 2.2.11 Release: 1 URL: http://httpd.apache.org/ Source0: http://www.apache.org/dist/%{name}/%{name}-%{version}.tar.bz2 Source1: http://www.apache.org/dist/%{name}/%{name}-%{version}.tar.bz2.asc Source2: http://www.apache.org/dist/%{name}/%{name}-%{version}.tar.bz2.md5 Source3: %{name}.aix.init Source4: %{name}-%{version}.conf.patch Source5: %{name}-ssl-2.2.X.conf.patch License: Apache Software License Group: System Environment/Daemons BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root Requires: expat >= 2.0.0, zlib Requires: apr >= 1.3.3-2, apr-util >= 1.2.0 Requires: pcre BuildRequires: zlib-devel, expat-devel >= 2.0.0 BuildRequires: apr-devel >= 1.3.3-2, apr-util-devel >= 1.2.0 BuildRequires: pcre-devel %description The Apache HTTP Server is a powerful, efficient, and extensible web server. %package devel Group: Development/Libraries Summary: Development tools for the Apache HTTP server. Requires: %{name} = %{version}-%{release} %description devel The httpd-devel package contains the APXS binary and other files that you need to build Dynamic Shared Objects (DSOs) for the Apache HTTP Server. If you are installing the Apache HTTP server and you want to be able to compile or develop additional modules for Apache, you need to install this package. %package manual Group: Documentation Summary: Documentation for the Apache HTTP server. Requires: %{name} = %{version}-%{release} %description manual The httpd-manual package contains the complete manual and reference guide for the Apache HTTP server. The information can also be found at http://httpd.apache.org/docs/2.2/. %package -n mod_ssl Group: System Environment/Daemons Summary: SSL/TLS module for the Apache HTTP server BuildRequires: openssl-devel >= 0.9.8 Requires: %{name} = %{version}-%{release} Requires: openssl >= 0.9.8 %description -n mod_ssl The mod_ssl module provides strong cryptography for the Apache Web server via the Secure Sockets Layer (SSL) and Transport Layer Security (TLS) protocols. %prep %setup -q %build # starting with version 2.2.9 "export CC=xlc_r" fails to compile httpd properly export CC="cc" export LTFLAGS="--tag=CC --silent" ./configure \ --prefix=%{_sysconfdir}/httpd \ --exec-prefix=%{_prefix} \ --bindir=%{_bindir} \ --sbindir=%{_sbindir} \ --mandir=%{_mandir} \ --libdir=%{_libdir} \ --sysconfdir=%{_sysconfdir}/httpd/conf \ --includedir=%{_includedir}/httpd \ --libexecdir=%{_libdir}/httpd/modules \ --localstatedir=%{localstatedir} \ --datadir=%{contentdir} \ --with-mpm=worker \ --with-apr=%{_bindir}/apr-1-config \ --with-apr-util=%{_bindir}/apu-1-config \ --enable-so \ --enable-suexec \ --enable-modules=all \ --enable-mods-shared=all \ --enable-ssl --with-ssl \ --enable-proxy \ --enable-cache --enable-mem-cache \ --enable-file-cache --enable-disk-cache \ --enable-dav \ --with-pcre=%{_prefix} \ --disable-auth-digest make %{?_smp_mflags} %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} make DESTDIR=${RPM_BUILD_ROOT} install /usr/bin/strip ${RPM_BUILD_ROOT}%{_bindir}/* || : /usr/bin/strip ${RPM_BUILD_ROOT}%{_sbindir}/* || : # mod_ssl bits for suffix in crl crt csr key prm ; do mkdir ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf/ssl.${suffix} done # for holding mod_dav lock database mkdir -p ${RPM_BUILD_ROOT}%{localstatedir}/lib/dav # create a prototype session cache mkdir -p ${RPM_BUILD_ROOT}%{localstatedir}/cache/mod_ssl touch ${RPM_BUILD_ROOT}%{localstatedir}/cache/mod_ssl/scache.dir touch ${RPM_BUILD_ROOT}%{localstatedir}/cache/mod_ssl/scache.pag touch ${RPM_BUILD_ROOT}%{localstatedir}/cache/mod_ssl/scache.sem # create cache root mkdir -p ${RPM_BUILD_ROOT}%{localstatedir}/cache/mod_proxy # move the build directory to within the library directory mv ${RPM_BUILD_ROOT}%{contentdir}/build ${RPM_BUILD_ROOT}%{_libdir}/httpd/build ( cd ${RPM_BUILD_ROOT}%{contentdir} ln -s %{_libdir}/httpd/build build ) # move utilities to /opt/freeware/bin for f in ab htdbm logresolve htpasswd htdigest ; do mv ${RPM_BUILD_ROOT}%{_sbindir}/${f} ${RPM_BUILD_ROOT}%{_bindir} done # fix definitions in httpd.conf cp ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf/httpd.conf . patch -s < %{SOURCE4} cp httpd.conf ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf/httpd.conf # fix definitions in extra/httpd-ssl.conf cp ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf/extra/httpd-ssl.conf . patch -s < %{SOURCE5} cp httpd-ssl.conf ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf/extra/httpd-ssl.conf # fix man page paths sed -e "s|/usr/local/apache2|/opt/freeware/etc/httpd/conf|" < docs/man/httpd.8 \ > ${RPM_BUILD_ROOT}%{_mandir}/man8/httpd.8 # create the /etc/rc.d/init.d/ scripts and symlinks mkdir -p ${RPM_BUILD_ROOT}/etc/rc.d/init.d/ cp %{SOURCE3} ${RPM_BUILD_ROOT}/etc/rc.d/init.d/httpd chmod 0755 ${RPM_BUILD_ROOT}/etc/rc.d/init.d/httpd mkdir -p ${RPM_BUILD_ROOT}/etc/rc.d/rc2.d/ mkdir -p ${RPM_BUILD_ROOT}/etc/rc.d/rc3.d/ ln -sf '../init.d/httpd' ${RPM_BUILD_ROOT}/etc/rc.d/rc2.d/Shttpd ln -sf '../init.d/httpd' ${RPM_BUILD_ROOT}/etc/rc.d/rc2.d/Khttpd ln -sf '../init.d/httpd' ${RPM_BUILD_ROOT}/etc/rc.d/rc3.d/Shttpd ln -sf '../init.d/httpd' ${RPM_BUILD_ROOT}/etc/rc.d/rc3.d/Khttpd # logs rmdir ${RPM_BUILD_ROOT}%{localstatedir}/logs mkdir -p ${RPM_BUILD_ROOT}%{localstatedir}/log/httpd mkdir -p ${RPM_BUILD_ROOT}%{localstatedir}/run # symlinks for /etc/httpd ln -s ../../../..%{localstatedir}/log/httpd $RPM_BUILD_ROOT%{_sysconfdir}/httpd/logs ln -s ../../../..%{localstatedir}/run $RPM_BUILD_ROOT%{_sysconfdir}/httpd/run ln -s ../../../..%{_libdir}/httpd/modules $RPM_BUILD_ROOT%{_sysconfdir}/httpd/modules ln -s ../../../..%{_libdir}/httpd/build $RPM_BUILD_ROOT%{_sysconfdir}/httpd/build # install log rotation stuff mkdir -p ${RPM_BUILD_ROOT}/opt/freeware/etc/logrotate.d cp ./build/rpm/httpd.logrotate ${RPM_BUILD_ROOT}/opt/freeware/etc/logrotate.d/httpd chmod 0644 ${RPM_BUILD_ROOT}/opt/freeware/etc/logrotate.d/httpd %pre # add the "apache" group /usr/bin/mkgroup -A id=%{apache_gid} apache 2> /dev/null || : # add the "apache" user /usr/bin/mkuser id=%{apache_uid} pgrp='apache' gecos='Apache User' \ login='false' rlogin='false' apache 2> /dev/null || : %preun if [ $1 = 0 ]; then /etc/rc.d/init.d/httpd stop > /dev/null 2>&1 fi # remove "apache" user and group /usr/sbin/rmuser -p apache || : /usr/sbin/rmgroup apache || : %preun manual cat %{_sysconfdir}/httpd/conf/httpd.conf | \ sed -e "s|Include conf/extra/httpd-manual.conf|#Include conf/extra/httpd-manual.conf|" \ > %{_sysconfdir}/httpd/conf/tmp_httpd.conf mv -f %{_sysconfdir}/httpd/conf/tmp_httpd.conf %{_sysconfdir}/httpd/conf/httpd.conf %post manual cat %{_sysconfdir}/httpd/conf/httpd.conf | \ sed -e "s|#Include conf/extra/httpd-manual.conf|Include conf/extra/httpd-manual.conf|" \ > %{_sysconfdir}/httpd/conf/tmp_httpd.conf mv -f %{_sysconfdir}/httpd/conf/tmp_httpd.conf %{_sysconfdir}/httpd/conf/httpd.conf %preun -n mod_ssl cat %{_sysconfdir}/httpd/conf/httpd.conf | \ sed -e "s|Include conf/extra/httpd-ssl.conf|#Include conf/extra/httpd-ssl.conf|" \ > %{_sysconfdir}/httpd/conf/tmp_httpd.conf mv -f %{_sysconfdir}/httpd/conf/tmp_httpd.conf %{_sysconfdir}/httpd/conf/httpd.conf if [ -f %{_sysconfdir}/httpd/conf/ssl.key/server.key ] ; then rm -f %{_sysconfdir}/httpd/conf/ssl.key/server.key fi if [ -f %{_sysconfdir}/httpd/conf/ssl.crt/server.crt ] ; then rm -f %{_sysconfdir}/httpd/conf/ssl.crt/server.crt fi %post -n mod_ssl cat %{_sysconfdir}/httpd/conf/httpd.conf | \ sed -e "s|#Include conf/extra/httpd-ssl.conf|Include conf/extra/httpd-ssl.conf|" \ > %{_sysconfdir}/httpd/conf/tmp_httpd.conf mv -f %{_sysconfdir}/httpd/conf/tmp_httpd.conf %{_sysconfdir}/httpd/conf/httpd.conf umask 077 if [ ! -f %{_sysconfdir}/httpd/conf/ssl.key/server.key ] ; then %{_bindir}/openssl genrsa -rand /etc/passwd:/etc/group:/etc/security/passwd:/etc/security/group 1024 > %{_sysconfdir}/httpd/conf/ssl.key/server.key 2> /dev/null fi FQDN=`hostname` if [ "x${FQDN}" = "x" ]; then FQDN=localhost.localdomain fi if [ ! -f %{_sysconfdir}/httpd/conf/ssl.crt/server.crt ] ; then 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 -- SomeState SomeCity SomeOrganization SomeOrganizationalUnit ${FQDN} root@${FQDN} EOF fi %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system) %doc ABOUT_APACHE CHANGES LICENSE NOTICE README VERSIONING %dir %{_sysconfdir}/httpd %{_sysconfdir}/httpd/modules %{_sysconfdir}/httpd/logs %{_sysconfdir}/httpd/run %dir %{_sysconfdir}/httpd/conf %config(noreplace) %{_sysconfdir}/httpd/conf/httpd.conf %config(noreplace) %{_sysconfdir}/httpd/conf/magic %config(noreplace) %{_sysconfdir}/httpd/conf/mime.types %dir %{_sysconfdir}/httpd/conf/extra %config(noreplace) %{_sysconfdir}/httpd/conf/extra/httpd-autoindex.conf %config(noreplace) %{_sysconfdir}/httpd/conf/extra/httpd-dav.conf %config(noreplace) %{_sysconfdir}/httpd/conf/extra/httpd-default.conf %config(noreplace) %{_sysconfdir}/httpd/conf/extra/httpd-info.conf %config(noreplace) %{_sysconfdir}/httpd/conf/extra/httpd-languages.conf %config(noreplace) %{_sysconfdir}/httpd/conf/extra/httpd-multilang-errordoc.conf %config(noreplace) %{_sysconfdir}/httpd/conf/extra/httpd-userdir.conf %config(noreplace) %{_sysconfdir}/httpd/conf/extra/httpd-vhosts.conf %dir %{_sysconfdir}/httpd/conf/original %dir %{_sysconfdir}/httpd/conf/original/extra %config(noreplace) %{_sysconfdir}/httpd/conf/original/extra/httpd-autoindex.conf %config(noreplace) %{_sysconfdir}/httpd/conf/original/extra/httpd-dav.conf %config(noreplace) %{_sysconfdir}/httpd/conf/original/extra/httpd-default.conf %config(noreplace) %{_sysconfdir}/httpd/conf/original/extra/httpd-info.conf %config(noreplace) %{_sysconfdir}/httpd/conf/original/extra/httpd-languages.conf %config(noreplace) %{_sysconfdir}/httpd/conf/original/extra/httpd-mpm.conf %config(noreplace) %{_sysconfdir}/httpd/conf/original/extra/httpd-multilang-errordoc.conf %config(noreplace) %{_sysconfdir}/httpd/conf/original/extra/httpd-userdir.conf %config(noreplace) %{_sysconfdir}/httpd/conf/original/extra/httpd-vhosts.conf %config(noreplace) %{_sysconfdir}/httpd/conf/original/httpd.conf %config %{_sysconfdir}/logrotate.d /etc/rc.d/init.d/httpd /etc/rc.d/rc2.d/Shttpd /etc/rc.d/rc2.d/Khttpd /etc/rc.d/rc3.d/Shttpd /etc/rc.d/rc3.d/Khttpd %{_bindir}/ab %{_bindir}/htdbm %{_bindir}/htdigest %{_bindir}/htpasswd %{_bindir}/logresolve %{_sbindir}/apachectl %{_sbindir}/htcacheclean %{_sbindir}/httpd %{_sbindir}/httxt2dbm %{_sbindir}/rotatelogs %{_sbindir}/suexec %dir %{_libdir}/httpd %dir %{_libdir}/httpd/modules # everything but mod_ssl.so: %{_libdir}/httpd/modules/httpd.exp %{_libdir}/httpd/modules/mod_[a-r]*.so %{_libdir}/httpd/modules/mod_s[eptu]*.so %{_libdir}/httpd/modules/mod_[t-z]*.so %{_mandir}/man1/* %{_mandir}/man8/ab* %{_mandir}/man8/apachectl.8* %{_mandir}/man8/htcacheclean.8* %{_mandir}/man8/httpd.8* %{_mandir}/man8/logresolve* %{_mandir}/man8/rotatelogs* %{_mandir}/man8/suexec* %{contentdir}/htdocs/ %{contentdir}/cgi-bin/ %{contentdir}/error/ %{contentdir}/icons/ %attr(0700,root,system) %dir %{localstatedir}/log/httpd %attr(0700,root,system) %dir %{localstatedir}/run %attr(0700,apache,apache) %dir %{localstatedir}/lib/dav %files devel %defattr(-,root,system) %{_includedir}/httpd/* %{_sysconfdir}/httpd/build %{_sbindir}/apxs %{_sbindir}/checkgid %{_sbindir}/dbmmanage %{_sbindir}/envvars* %{_mandir}/man8/apxs.8* %dir %{_libdir}/httpd/build %{contentdir}/build %{_libdir}/httpd/build/config.nice %{_libdir}/httpd/build/*.mk %{_libdir}/httpd/build/instdso.sh %{_libdir}/httpd/build/mkdir.sh %files manual %defattr(-,root,system) %dir %{contentdir}/manual %{contentdir}/manual/* %dir %{_sysconfdir}/httpd/conf %config(noreplace) %{_sysconfdir}/httpd/conf/extra/httpd-manual.conf %config(noreplace) %{_sysconfdir}/httpd/conf/original/extra/httpd-manual.conf %files -n mod_ssl %defattr(-,root,system) %{_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(noreplace) %{_sysconfdir}/httpd/conf/extra/httpd-ssl.conf %config(noreplace) %{_sysconfdir}/httpd/conf/original/extra/httpd-ssl.conf %attr(0700,apache,root) %dir %{localstatedir}/cache/mod_ssl %attr(0600,apache,root) %{localstatedir}/cache/mod_ssl/scache.dir %attr(0600,apache,root) %{localstatedir}/cache/mod_ssl/scache.pag %attr(0600,apache,root) %{localstatedir}/cache/mod_ssl/scache.sem %attr(0700,apache,root) %dir %{localstatedir}/cache/mod_proxy %changelog * Tue Apr 21 2009 Michael Perzl - 2.2.11-1 - updated to v2.2.11 * Fri Dec 05 2008 Michael Perzl - 2.2.10-1 - updated to v2.2.10 * Tue Aug 18 2008 Michael Perzl - 2.2.9-1 - updated to v2.2.9 - added dependency on newest apr version for random number generator * Mon Mar 31 2008 Michael Perzl - 2.2.8-2 - rebuilt against new version of expat and added dependency on external pcre * Mon Mar 03 2008 Michael Perzl - 2.2.8-1 - updated to v2.2.8 * Mon Mar 03 2008 Michael Perzl - 2.2.6-2 - some minor corrections * Wed Oct 17 2007 Michael Perzl - 2.2.6-1 - updated to v2.2.6 * Wed Sep 05 2007 Michael Perzl - 2.2.4-1 - updated to v2.2.4 * Wed May 31 2006 Michael Perzl - 2.2.2-1 - first version for AIX V5.1 and higher