%define contentdir /var/www %define localstatedir /var %define apache_uid 64500 %define apache_gid 64500 Summary: Apache HTTP Server Name: httpd Version: 2.0.64 Release: 2 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.0.X.conf.patch Source6: %{name}-manual-2.0.X.conf License: Apache Software License Group: System Environment/Daemons BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: apr0-devel < 1.0.0 BuildRequires: apr0-util-devel < 1.0.0 BuildRequires: expat-devel >= 2.0.1-2 BuildRequires: openssl-devel >= 0.9.8 BuildRequires: zlib-devel Requires: apr0 < 1.0.0 Requires: apr0-util < 1.0.0 Requires: expat >= 2.0.1-2 Requires: openssl >= 0.9.8 Requires: zlib %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} Requires: apr0-devel < 1.0.0 Requires: apr0-util-devel < 1.0.0 Requires: expat-devel >= 2.0.1-2 Requires: openssl-devel >= 0.9.8 Requires: zlib-devel %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.0/. %package -n mod_ssl Group: System Environment/Daemons Summary: SSL/TLS module for the Apache HTTP server 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 export CC=xlc_r 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-config \ --with-apr-util=%{_bindir}/apu-config \ --enable-so \ --enable-suexec \ --enable-modules=all \ --enable-mods-shared=all \ --enable-ssl --with-ssl=%{_prefix} \ --enable-proxy \ --enable-cache --enable-mem-cache \ --enable-file-cache --enable-disk-cache \ --enable-dav \ --enable-logio \ --disable-auth-digest make %{?_smp_mflags} %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} make DESTDIR=${RPM_BUILD_ROOT} install # 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 ssl.conf cp ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf/ssl.conf . patch -s < %{SOURCE5} cp ssl.conf ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf/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 cp %{SOURCE6} ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf/httpd-manual.conf # 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 # 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/httpd-manual.conf|#Include conf/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/httpd-manual.conf|Include conf/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/ssl.conf|#Include conf/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/ssl.conf|Include conf/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/highperformance-std.conf %config(noreplace) %{_sysconfdir}/httpd/conf/highperformance.conf %config(noreplace) %{_sysconfdir}/httpd/conf/httpd-std.conf %config(noreplace) %{_sysconfdir}/httpd/conf/httpd.conf %config(noreplace) %{_sysconfdir}/httpd/conf/magic %config(noreplace) %{_sysconfdir}/httpd/conf/mime.types %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}/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/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 %files manual %defattr(-,root,system) %dir %{contentdir}/manual %{contentdir}/manual/* %dir %{_sysconfdir}/httpd/conf %config(noreplace) %{_sysconfdir}/httpd/conf/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/ssl-std.conf %config(noreplace) %{_sysconfdir}/httpd/conf/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 * Thu Apr 14 2011 Michael Perzl - 2.0.64-2 - change permissions of /var/log/http to make CGIs work - added a 'sleep 2' in the init.d script for 'restart' * Fri Jan 14 2011 Michael Perzl - 2.0.64-1 - updated to version 2.0.64 * Fri Jan 14 2011 Michael Perzl - 2.0.63-1 - updated to version 2.0.63 * Fri Jan 14 2011 Michael Perzl - 2.0.59-1 - first version for AIX V5.1 and higher