2006-12-20 18:01:15 +01:00
#
2011-05-30 15:40:12 +02:00
# spec file for package apache2
2006-12-20 18:01:15 +01:00
#
2012-02-11 09:39:57 +01:00
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
2006-12-20 18:01:15 +01:00
#
2008-08-25 01:21:58 +02:00
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
2006-12-20 18:01:15 +01:00
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
2012-02-18 17:52:29 +01:00
2006-12-20 18:01:15 +01:00
Name : apache2
2011-12-02 17:41:12 +01:00
BuildRequires : automake
BuildRequires : db-devel
BuildRequires : ed
BuildRequires : libapr-util1-devel
2013-11-25 23:26:02 +01:00
#Since 2.4.7 the event MPM requires apr 1.5.0 or later.
BuildRequires : libapr1-devel >= 1.5.0
#
2011-12-02 17:41:12 +01:00
BuildRequires : openldap2-devel
2013-11-25 23:26:02 +01:00
BuildRequires : openssl-devel >= 0.9.8a
2011-12-02 17:41:12 +01:00
BuildRequires : pcre-devel
2012-08-01 04:26:59 +02:00
BuildRequires : xz
2011-12-02 17:41:12 +01:00
BuildRequires : zlib-devel
2013-08-01 04:55:58 +02:00
BuildRequires : lua-devel
#for mod_proxy_html and mod_xml2enc
BuildRequires : libxml2-devel
2010-10-06 00:43:18 +02:00
%if %{?suse_version:1}0 && 0%{?sles_version} == 9
2010-10-06 23:21:50 +02:00
BuildRequires : libcap
2010-10-06 00:43:18 +02:00
%else
2010-10-06 23:21:50 +02:00
BuildRequires : libcap-devel
2010-10-06 00:43:18 +02:00
%endif
2011-09-29 11:39:43 +02:00
%if 0%{?suse_version} >= 1210
2013-06-18 07:57:29 +02:00
BuildRequires : pkgconfig(systemd)
BuildRequires : pkgconfig(libsystemd-daemon)
2011-09-29 11:39:43 +02:00
%endif
2006-12-20 18:01:15 +01:00
%if %{?suse_version:1}0
%define httpduser wwwrun
%define httpdgroup www
%else
%define httpduser apache
%define httpdgroup apache
BuildRequires : expat-devel
%endif
#
%define pname apache2
2009-06-09 18:26:15 +02:00
%define vers 2
2006-12-20 18:01:15 +01:00
%define httpd httpd2
2013-06-18 08:46:24 +02:00
%define apache_mmn %(test -s %{S:0} && { echo -n apache_mmn_; bzcat %{S:0} | awk '/^#define MODULE_MAGIC_NUMBER_MAJOR/ {printf "%d", $3}'; })
2006-12-20 18:01:15 +01:00
%define default_mpm prefork
%{!?prefork:%define prefork 1}
%{!?worker:%define worker 1}
%{!?event:%define event 1}
2014-10-16 15:07:28 +02:00
%define mpms_to_build %(test %prefork = 1 && printf prefork) %(test %worker = 1 && printf worker) %(test %event = 1 && printf event)
2006-12-20 18:01:15 +01:00
# dir names
%define datadir /srv/www
%define htdocsdir %{datadir}/htdocs
%define manualdir %{_prefix}/share/%{pname}/manual
%define errordir %{_prefix}/share/%{pname}/error
%define iconsdir %{_prefix}/share/%{pname}/icons
%define cgidir %{datadir}/cgi-bin
%define localstatedir /var/lib/%{pname}
%define proxycachedir /var/cache/%{pname}
%define logfiledir /var/log/%{pname}
2013-10-22 17:46:52 +02:00
%if %suse_version >= 1220
2013-09-03 06:07:30 +02:00
%define runtimedir /run
2013-10-22 17:46:52 +02:00
%define mods_static access_compat unixd systemd
2013-09-03 06:07:30 +02:00
%else
2006-12-20 18:01:15 +01:00
%define runtimedir /var/run
2013-10-22 17:46:52 +02:00
%define mods_static access_compat unixd
2013-09-03 06:07:30 +02:00
%endif
2006-12-20 18:01:15 +01:00
%define sysconfdir /etc/%{pname}
%define includedir %{_includedir}/%{pname}
%define libexecdir %_libdir/%{pname}
%define installbuilddir %{_prefix}/share/%{pname}/build
%define userdir public_html
%define suexec_safepath /usr/local/bin:/usr/bin:/bin
2013-02-25 19:49:36 +01:00
%if %suse_version > 1220
%define _unitdir /usr/lib/systemd
%else
%define _unitdir /lib/systemd
%endif
2013-10-22 17:46:52 +02:00
2006-12-20 18:01:15 +01:00
# "Server:" header
%define VENDOR SUSE
%define platform_string Linux/%VENDOR
2014-07-23 22:22:18 +02:00
%define realver 2.4.10
Version : 2.4.10
2011-12-02 17:41:12 +01:00
Release : 0
2006-12-20 18:01:15 +01:00
#Source0: http://www.apache.org/dist/httpd-%{version}.tar.bz2
2013-06-18 07:57:29 +02:00
Source0 : httpd-%{realver} .tar.bz2
2010-05-11 17:16:17 +02:00
# Add file to take mtime from it in prep section
Source1 : apache2.changes
2011-09-14 01:17:22 +02:00
Source6 : 60C5442D.key
2006-12-20 18:01:15 +01:00
Source10 : SUSE-NOTICE
Source11 : rc.%{pname}
Source13 : sysconfig.%{pname}
Source18 : robots.txt
Source20 : favicon.ico
2012-02-11 09:39:57 +01:00
Source22 : apache2-README
Source23 : apache2-README.QUICKSTART
Source24 : apache2-README.default-vhost
2006-12-20 18:01:15 +01:00
Source25 : gensslcert
Source27 : %{pname} .logrotate
Source28 : permissions.%{pname}
Source29 : apache-ssl-stuff.tar.bz2
Source40 : load_configuration
Source41 : find_mpm
Source42 : get_module_list
Source43 : get_includes
Source44 : find_httpd2_includes
2008-04-20 21:03:37 +02:00
# sysconf_addword is part of aaa_base.rpm starting with openSUSE 11.0
# we bring our own copy for the cases where it is not available
Source45 : sysconf_addword
2006-12-20 18:01:15 +01:00
Source46 : a2enflag
Source47 : a2enmod
2007-01-08 12:26:19 +01:00
Source48 : apache2.xml
2007-03-20 01:13:36 +01:00
Source49 : apache2.firewall
2007-03-20 11:30:41 +01:00
Source50 : apache2.ssl-firewall
2006-12-20 18:01:15 +01:00
Source100 : apache2-httpd.conf
Source101 : apache2-errors.conf
Source102 : apache2-default-server.conf
Source103 : apache2-listen.conf
Source104 : apache2-manual.conf
Source105 : apache2-mod_autoindex-defaults.conf
Source106 : apache2-mod_info.conf
Source107 : apache2-mod_log_config.conf
Source108 : apache2-mod_mime-defaults.conf
Source109 : apache2-mod_status.conf
Source110 : apache2-mod_userdir.conf
Source111 : apache2-server-tuning.conf
Source113 : apache2-ssl-global.conf
Source114 : apache2-mod_usertrack.conf
2012-01-21 13:57:30 +01:00
Source115 : apache2-mod_reqtimeout.conf
2006-12-20 18:01:15 +01:00
Source130 : apache2-vhost.template
Source131 : apache2-vhost-ssl.template
2012-02-11 09:39:57 +01:00
Source132 : apache2-default-vhost.conf
Source133 : apache2-default-vhost-ssl.conf
2006-12-20 18:01:15 +01:00
Source140 : apache2-check_forensic
Source141 : apache-20-22-upgrade
2011-09-12 14:20:52 +02:00
Source142 : start_apache2
Source143 : apache2-systemd-ask-pass
Source144 : apache2.service
2006-12-20 18:01:15 +01:00
Patch2 : httpd-2.1.3alpha-layout.dif
2014-11-07 16:23:57 +01:00
Patch23 : httpd-2.4.10-apachectl.patch
2013-01-28 04:33:43 +01:00
#Patch65: httpd-2.0.49-log_server_status.dif
2006-12-20 18:01:15 +01:00
Patch66 : httpd-2.0.54-envvars.dif
Patch67 : httpd-2.2.0-apxs-a2enmod.dif
2008-09-24 14:59:24 +02:00
Patch68 : httpd-2.x.x-logresolve.patch
2012-03-20 19:13:21 +01:00
Patch69 : httpd-2.2.x-bnc690734.patch
2013-06-18 07:57:29 +02:00
Patch70 : apache2-implicit-pointer-decl.patch
2014-10-31 18:05:48 +01:00
Patch71 : httpd-event-deadlock.patch
2012-05-29 11:03:52 +02:00
# PATCH-FEATURE-UPSTREAM apache2-mod_ssl_npn.patch dimstar@opensuse.org -- Add npn support to mod_ssl (needed for spdy)
2013-06-18 07:57:29 +02:00
#Patch108: apache2-mod_ssl_npn.patch
#Provides: apache2(mod_ssl+npn)
# PATCH-FEATURE-UPSTREAM httpd-2.4.3-mod_systemd.patch crrodriguez@opensuse.org simple module provides systemd integration.
Patch109 : httpd-2.4.3-mod_systemd.patch
2013-08-28 09:32:31 +02:00
Patch111 : httpd-visibility.patch
2014-11-07 17:56:25 +01:00
# PATCH-FIX-UPSTREAM bnc#899836 kstreitova@suse.com -- avoid a crash when Content-Type has an empty value
Patch112 : httpd-2.4.10-check_null_pointer_dereference.patch
2014-12-19 02:04:03 +01:00
# PATCH-FIX-UPSTREAM bnc#909715 kstreitova@suse.com -- Fix handling of the Require line when a LuaAuthzProvider is used in multiple Require directives with different arguments.
Patch113 : httpd-2.4.x-bnc909715-CVE-2014-8109-mod_lua_handling_of_Require_line.patch
# PATCH-FIX-UPSTREAM bnc#871310 kstreitova@suse.com -- Fix the flaw in the way mod_headers handled chunked requests.
Patch114 : httpd-2.4.x-bnc871310-CVE-2013-5704-mod_headers_chunked_requests.patch
2007-10-22 18:25:27 +02:00
Url : http://httpd.apache.org/
2008-04-20 21:03:37 +02:00
Icon : Apache.xpm
2014-07-23 22:22:18 +02:00
Summary : The Apache Web Server Version 2.4
2011-12-12 12:06:24 +01:00
License : Apache-2.0
Group : Productivity/Networking/Web/Servers
2012-03-20 19:13:21 +01:00
Provides : %{apache_mmn}
Provides : http_daemon
Provides : httpd
Provides : suse_help_viewer
2013-07-30 01:51:31 +02:00
Provides : %{name} -mod_macro = %{version}
Obsoletes : %{name} -mod_macro <= 1.2.1
2012-03-20 19:13:21 +01:00
Requires : %{pname} -MPM
Requires : /etc/mime.types
2007-07-23 21:27:20 +02:00
PreReq : %{name} -utils
2006-12-20 18:01:15 +01:00
Requires : logrotate
2013-08-30 06:51:32 +02:00
#for some reason the parser barfs if not conditional
%{?requires_ge:%requires_ge libapr1}
%{?requires_ge:%requires_ge libapr-util1}
2011-09-29 11:39:43 +02:00
%{?systemd_requires}
2006-12-20 18:01:15 +01:00
PreReq : fileutils textutils grep sed
%if %{?suse_version:1}0
2009-04-26 10:53:40 +02:00
PreReq : %insserv_prereq %fillup_prereq permissions pwdutils
2006-12-20 18:01:15 +01:00
%endif
%if 0%{?suse_version} >= 901 && 0%{?sles_version} != 9
Provides : apache
Obsoletes : apache < 1.3.29
Obsoletes : mod_ssl < 2.8.16
%endif
BuildRoot : %{_tmppath} /%{name} -%{version} -build
2011-02-07 17:42:02 +01:00
%if 0%{?suse_version} >= 1110
Recommends: apache2-%default_mpm
%endif
2006-12-20 18:01:15 +01:00
%description
2014-07-23 22:22:18 +02:00
This version of httpd is a major release of the 2.4 stable branch,
and represents the best available version of Apache HTTP Server.
New features include Loadable MPMs, major improvements to OCSP support,
mod_lua, Dynamic Reverse Proxy configuration, Improved Authentication/
Authorization, FastCGI Proxy, New Expression Parser, and a Small Object
Caching API.
See /usr/share/doc/packages/apache2/, http://httpd.apache.org/, and
http://httpd.apache.org/docs-2.4/upgrading.html.
2006-12-20 18:01:15 +01:00
%if %worker
2007-12-13 20:32:12 +01:00
2006-12-20 18:01:15 +01:00
%package worker
Summary : Apache 2 worker MPM (Multi-Processing Module)
2011-12-12 12:06:24 +01:00
Group : Productivity/Networking/Web/Servers
2006-12-20 18:01:15 +01:00
Provides : %{pname} -MPM
Requires : %{name} = %{version}
%endif
%if %prefork
2007-10-22 18:25:27 +02:00
2006-12-20 18:01:15 +01:00
%package prefork
Summary : Apache 2 " p r e f o r k " MPM (Multi-Processing Module)
2011-12-12 12:06:24 +01:00
Group : Productivity/Networking/Web/Servers
2006-12-20 18:01:15 +01:00
Provides : %{pname} -MPM
%if 0%{?suse_version} >= 901 && 0%{?sles_version} != 9
Provides : apache:/usr/sbin/httpd
%endif
Requires : %{name} = %{version}
%endif
%if %event
2007-10-22 18:25:27 +02:00
2006-12-20 18:01:15 +01:00
%package event
Summary : Apache 2 event MPM (Multi-Processing Module)
2011-12-12 12:06:24 +01:00
Group : Productivity/Networking/Web/Servers
2006-12-20 18:01:15 +01:00
Provides : %{pname} -MPM
Requires : %{name} = %{version}
%endif
%if %worker
%description worker
The worker MPM (multi-Processing Module) implementing a hybrid
multi-threaded multi-process web server.
This combination offers a performance boost and retains some of the
stability of the multi-process model.
%endif
%if %prefork
2007-12-13 20:32:12 +01:00
2006-12-20 18:01:15 +01:00
%description prefork
" p r e f o r k " MPM (Multi-Processing Module)
This MPM is basically the one that Apache 1.3.x used. It warrants the
maximum stability because each server runs in its own process. If a
process dies it will not affect other servers.
%endif
%if %event
2007-12-13 20:32:12 +01:00
2006-12-20 18:01:15 +01:00
%description event
The event MPM (multi-Processing Module) is experimental, so it may or
may not work as expected.
2009-02-26 12:26:24 +01:00
It uses a separate thread to handle Keep Alive requests and accepting
2006-12-20 18:01:15 +01:00
connections. Keep Alive requests have traditionally required httpd to
dedicate a worker to handle it. This dedicated worker could not be used
again until the Keep Alive timeout was reached.
This MPM depends on APR's atomic compare-and-swap operations for thread
synchronization.
%endif
2007-12-13 20:32:12 +01:00
2006-12-20 18:01:15 +01:00
%package devel
2014-09-26 17:16:44 +02:00
Summary : Apache 2 Header and Include Files
2006-12-20 18:01:15 +01:00
Group : Development/Libraries/C and C++
2012-03-20 19:13:21 +01:00
Requires : %{name} = %{version}
Requires : %{pname} -MPM
Requires : apache2-prefork
Requires : gcc
Requires : libapr-util1-devel
Requires : libapr1-devel
2006-12-20 18:01:15 +01:00
%description devel
This package contains header files and include files that are needed
for development using the Apache API.
%package doc
2014-09-29 10:30:32 +02:00
Summary : Additional Package Documentation
2006-12-20 18:01:15 +01:00
Group : Documentation/Other
%if 0%{?suse_version} >= 901 && 0%{?sles_version} != 9
Provides : apache-doc
Obsoletes : apache-doc
%endif
2010-01-14 16:54:32 +01:00
%if 0%{?suse_version} >= 1120
BuildArch : noarch
%endif
2006-12-20 18:01:15 +01:00
%description doc
This package contains optional documentation provided in addition to
this package's base documentation.
%package example-pages
Summary : Example Pages for the Apache 2 Web Server
2011-12-12 12:06:24 +01:00
Group : Productivity/Networking/Web/Servers
2006-12-20 18:01:15 +01:00
%if 0%{?suse_version} >= 901 && 0%{?sles_version} != 9
Provides : apache-example-pages
Obsoletes : apache-example-pages
%endif
%description example-pages
Some Example pages for Apache that show information about the installed
server.
2007-07-23 21:27:20 +02:00
%package utils
Summary : Apache 2 utilities
2011-12-12 12:06:24 +01:00
Group : Productivity/Networking/Web/Servers
2007-07-23 21:27:20 +02:00
%description utils
Utilities provided by the Apache 2 Web Server project which are useful
to administrators of web servers in general.
2006-12-20 18:01:15 +01:00
%prep
#
# O/ ._ .__ ._
# /O |_)|(/_|_)
# | |
#
%setup -q -n httpd-%{realver}
%patch2 -p1
2013-07-22 19:04:27 +02:00
%patch23 -p1
2013-01-28 04:33:43 +01:00
#%patch65 -p1
2013-07-22 19:04:27 +02:00
%patch66 -p1
2006-12-20 18:01:15 +01:00
%patch67 -p1
2008-09-24 14:59:24 +02:00
%patch68 -p1
2013-01-28 04:33:43 +01:00
#%patch69
2013-06-18 07:57:29 +02:00
%patch70 -p1
2014-10-31 18:05:48 +01:00
%patch71 -p1
2013-06-18 07:57:29 +02:00
#%patch108 -p1
%patch109 -p1
2013-08-28 09:32:31 +02:00
%patch111 -p1
2014-11-07 17:56:25 +01:00
%patch112 -p1
2014-12-19 02:04:03 +01:00
%patch113 -p1
%patch114 -p1
2006-12-20 18:01:15 +01:00
cat $RPM_SOURCE_DIR /SUSE-NOTICE >> NOTICE
2012-02-11 09:39:57 +01:00
# install READMEs
a=$(basename %{S:22})
cp %{S:22} ./${a##%{name}-}
b=$(basename %{S:23})
cp %{S:23} ./${b##%{name}-}
c=$(basename %{S:24})
cp %{S:24} ./${c##%{name}-}
2006-12-20 18:01:15 +01:00
#
# replace PLATFORM string that's seen in the "Server:" header
#
sed 's,(" PLATFORM "),(%platform_string),' server/core.c > tmp_file && mv tmp_file server/core.c
sed 's/public_html/%{userdir}/g' docs/conf/extra/httpd-userdir.conf.in > tmp_file && mv tmp_file docs/conf/extra/httpd-userdir.conf.in
2010-05-11 17:16:17 +02:00
# Use mtime of .changes for build time
CHANGES=`stat --format=" % y " %SOURCE1`
sed -i -e " s / _ _ D A T E _ _ \" \" _ _ T I M E _ _ ; / \" $ C H A N G E S \" ; / " server/buildmark.c
2006-12-20 18:01:15 +01:00
#
# now configure Apache
#
2008-09-12 22:47:19 +02:00
%if 0%{?suse_version} > 910
2011-08-31 15:46:57 +02:00
autoreconf -fiv
2008-09-12 22:47:19 +02:00
%else
rm -rf aclocal.m4 autom4te*.cache
autoheader
autoconf
%endif
2006-12-20 18:01:15 +01:00
%build
#
# O/ |_ o| _|
# /O |_)|_|||(_|
#
function configure {
2011-08-31 15:46:57 +02:00
CFLAGS=" $RPM_OPT_FLAGS - f P I C - W a l l - D L D A P _ D E P R E C A T E D " \
2006-12-20 18:01:15 +01:00
CPPFLAGS=" - D S S L _ E X P E R I M E N T A L _ E N G I N E - D M A X _ S E R V E R _ L I M I T = 2 0 0 0 0 0 - D L D A P _ D E P R E C A T E D - D M A X L I N E = 4 0 9 6 " \
./configure \
--enable-layout=SuSE81%(test " % _ l i b " = lib64 && echo -n _64) \
--with-program-name=httpd%{vers} $mpm_suffix \
--with-apr=%{_bindir} /apr-1-config \
--with-apr-util=%{_bindir} /apu-1-config \
--with-mpm=$mpm \
%if "$mpm" == "worker" || "$mpm" == "event"
%ifarch %ix86
%ifnarch i386
--enable-nonportable-atomics=yes \
%endif
%endif
%endif
\
--enable-exception-hook \
\
%if %{?suse_version:%suse_version}%{?!suse_version:9999} > 930
--with-pcre \
--enable-pie \
%endif
--enable-mods-shared=all \
2013-10-22 17:46:52 +02:00
--enable-mods-static=" %{mods_static} " \
2006-12-20 18:01:15 +01:00
--enable-ssl=shared \
\
--disable-isapi \
--enable-deflate \
--enable-echo \
--enable-filter \
--enable-ext-filter \
--enable-charset-lite \
--enable-file-cache \
--enable-logio \
--enable-dumpio \
--enable-bucketeer \
--enable-case_filter \
--enable-case_filter_in \
2014-10-13 18:20:07 +02:00
--enable-imagemap \
2006-12-20 18:01:15 +01:00
\
--with-ldap \
--enable-ldap \
--enable-authnz_ldap \
\
--enable-proxy \
--enable-proxy-connect \
--enable-proxy-ftp \
--enable-proxy-http \
--enable-cache \
--enable-disk-cache \
--enable-mem-cache \
2007-03-23 21:40:52 +01:00
--enable-version \
2006-12-20 18:01:15 +01:00
\
--enable-dav-lock \
--enable-authn-alias \
--enable-optional-hook-export \
--enable-optional-hook-import \
--enable-optional-fn-import \
--enable-optional-fn-export \
\
--enable-suexec \
--with-suexec-bin=%{_sbindir} /suexec%{vers} \
--with-suexec-caller=%httpduser \
--with-suexec-docroot=%{datadir} \
--with-suexec-logfile=%{logfiledir} /suexec.log \
--with-suexec-userdir=%{userdir} \
--with-suexec-uidmin=96 \
--with-suexec-gidmin=96 \
2012-08-01 03:54:19 +02:00
--with-suexec-safepath=%{suexec_safepath} \
--disable-heartbeat
2006-12-20 18:01:15 +01:00
}
2010-03-05 15:57:50 +01:00
2006-12-20 18:01:15 +01:00
#
# |_ o| _| | _ _ ._
# |_)|_|||(_| |(_)(_)|_)
# |
#
# build the 3 multi-processing modules (MPM) in a loop
#
[ " $RPM_BUILD_ROOT " != " / " ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT ;
for mpm in %{mpms_to_build} ; do
echo $mpm >> .status
test -s Makefile && make clean >/dev/null
echo -e " \n \n \n \ e [ 0 1 m * * * * * B u i l d i n g $ m p m M P M * * * * * \ e [ 0 0 m \n \n \n "
export mpm_suffix=-$mpm
configure
sed " s / %{vers} - $ m p m / / " include/ap_config_auto.h > include/ap_config_auto.h.new
mv include/ap_config_auto.h.new include/ap_config_auto.h
2013-09-03 06:07:30 +02:00
sed -i -e " s @ / v a r / r u n @ %{runtimedir} @ g " include/ap_config_layout.h
2010-03-05 15:57:50 +01:00
2013-08-28 09:32:31 +02:00
make CFLAGS=" $RPM_OPT_FLAGS - f v i s i b i l i t y = h i d d e n - f P I C \
2006-12-20 18:01:15 +01:00
-Wall \
-DDEFAULT_ERRORLOG='\"%{logfiledir}/error_log\"' " \
%{?jobs:-j%jobs}
2010-03-05 15:57:50 +01:00
2006-12-20 18:01:15 +01:00
make DESTDIR=$RPM_BUILD_ROOT install
2010-03-05 15:57:50 +01:00
2006-12-20 18:01:15 +01:00
#rm -rf $RPM_BUILD_ROOT.$mpm.pre
#cp -a $RPM_BUILD_ROOT/ $RPM_BUILD_ROOT.$mpm.pre
# show pathnames in config files
echo;echo;echo; diff -U1 docs/conf/httpd-std.conf.in docs/conf/httpd-std.conf ||:
echo;echo;echo; diff -U1 docs/conf/ssl-std.conf.in docs/conf/ssl-std.conf ||:
# show compile settings
pwd
printf " \n \n \n " ; ./%{httpd} $mpm_suffix -V
printf " \n \n \n " ; ./%{httpd} $mpm_suffix -l
#mv $RPM_BUILD_ROOT/%{sysconfdir}/httpd-std.conf $RPM_BUILD_ROOT/%{sysconfdir}/httpd-std.conf$mpm_suffix
#mv $RPM_BUILD_ROOT/%{sysconfdir}/httpd2-prefork.conf $RPM_BUILD_ROOT/%{sysconfdir}/httpd-std.conf$mpm_suffix
# fix up and rename config_vars file: remove references to the RPM build dir;
# remove references to RPM build root; fix apr/apu includedir
sed -e " / ^ E X T R A _ I N C L U D E S / s | - I $RPM_BUILD_DIR [ ^ ] * | | g " \
-e " / ^ A P . _ I N C L U D E D I R / s | $RPM_BUILD_DIR . * $ | %{includedir} $ m p m _ s u f f i x | " \
-e " / a b s _ s r c d i r / d " \
-e " / A P _ L I B S / d " \
< $RPM_BUILD_ROOT /%{installbuilddir} /config_vars.mk \
> $RPM_BUILD_ROOT /%{installbuilddir} /config_vars.mk$mpm_suffix
rm $RPM_BUILD_ROOT /%{installbuilddir} /config_vars.mk
#rm -rf $RPM_BUILD_ROOT.$mpm.post
#cp -a $RPM_BUILD_ROOT/ $RPM_BUILD_ROOT.$mpm.post
done
mkdir -p $RPM_BUILD_ROOT /%{libexecdir}
2010-03-05 15:57:50 +01:00
2006-12-20 18:01:15 +01:00
# remove references to mpm type in config_vars
sed -e " s ^ / u s r / % _ l i b / %{pname} - %{default_mpm} ^ / u s r / % _ l i b / %{pname} ^ " \
-e " s / h t t p d $ / %{httpd} - %{default_mpm} / " \
-e " s / %{pname} - %{default_mpm} / %{pname} / " \
< $RPM_BUILD_ROOT /%{installbuilddir} /config_vars.mk-%{default_mpm} \
> $RPM_BUILD_ROOT /%{installbuilddir} /config_vars.mk
2010-03-05 15:57:50 +01:00
2006-12-20 18:01:15 +01:00
# get rid of modules that do not differ between the MPMs (since most of them are the same)
# by putting them in /usr/lib/apache%{vers}
ldir=$RPM_BUILD_ROOT /%{libexecdir}
2008-11-21 15:11:27 +01:00
for i in $(cd $ldir-%{default_mpm} ; ls -1 *.so); do
2006-12-20 18:01:15 +01:00
identical=true
for mpm in %{mpms_to_build} ; do
2008-11-21 15:11:27 +01:00
if test -f $ldir-$mpm/$i -a -f $ldir-%{default_mpm} /$i; then
objcopy --strip-debug $ldir-$mpm/$i $ldir-$mpm/$i.tst
objcopy --strip-debug $ldir-%{default_mpm} /$i $ldir-%{default_mpm} /$i.tst
ls -l $ldir-{%{default_mpm} ,$mpm}/$i*
cmp -s $ldir-{%{default_mpm} ,$mpm}/$i.tst || identical=false
rm -f $ldir-{%{default_mpm} ,$mpm}/$i.tst
else
identical=false
fi
2006-12-20 18:01:15 +01:00
done
if $identical; then
cp -dp $ldir-%{default_mpm} /$i $ldir
for mpm in %{mpms_to_build} ; do
rm $ldir-$mpm/$i
ln -s ../%{pname} /$i $ldir-$mpm/$i
done
fi
done
2010-03-05 15:57:50 +01:00
2006-12-20 18:01:15 +01:00
# merge the three /usr/include/apache2-* directories
# by putting them in /usr/lib/apache%{vers}
idir=$RPM_BUILD_ROOT /%{includedir}
mkdir -p $idir
for i in $(cd $idir-%{default_mpm} ; ls -1); do
identical=true
for mpm in %{mpms_to_build} ; do
cmp -s $idir-{%{default_mpm} ,$mpm}/$i || identical=false
done
if $identical; then
cp -dp $idir-%{default_mpm} /$i $idir
for mpm in %{mpms_to_build} ; do
rm $idir-$mpm/$i
ln -s ../%{pname} /$i $idir-$mpm/$i
done
fi
done
for i in ap_config_auto.h ap_config_layout.h; do
if [ ! -f $idir/$i ]; then
sed 's/-%{default_mpm}//' $idir-%{default_mpm} /$i > $idir/$i
fi
done
%install
#
# O/ o._ __|_ _.||
# /O || |_> |_(_|||
#
#
2008-09-12 22:47:19 +02:00
# (most installation (to build root) has already been done in %%build)
2006-12-20 18:01:15 +01:00
#
# save MODULE_MAGIC_NUMBER
cat > $RPM_BUILD_ROOT /%{_libdir} /%{pname} _MMN <<-EOF
#!/bin/sh
echo %{apache_mmn}
EOF
2010-03-05 15:57:50 +01:00
2006-12-20 18:01:15 +01:00
cp -p $RPM_BUILD_ROOT /%{sysconfdir} /%{httpd} -%{default_mpm} .conf $RPM_BUILD_ROOT /%{sysconfdir} /httpd.conf
cp -p $RPM_BUILD_ROOT /%{sysconfdir} /httpd.conf ./httpd.conf.default
rm $RPM_BUILD_ROOT /%{sysconfdir} /%{httpd} -*.conf
#
# create directories
mkdir -p $RPM_BUILD_ROOT /%{_var}/adm/fillup-templates \
$RPM_BUILD_ROOT /%{proxycachedir} \
$RPM_BUILD_ROOT /%{localstatedir}
#
# support files
install -m 755 support/log_server_status $RPM_BUILD_ROOT /%{_bindir} /log_server_status%{vers}
install -m 755 support/split-logfile $RPM_BUILD_ROOT /%{_bindir} /split-logfile%{vers}
install -m 755 support/logresolve.pl $RPM_BUILD_ROOT /%{_sbindir} /logresolve.pl%{vers}
mkdir -p $RPM_BUILD_ROOT /etc/logrotate.d
install -m 644 $RPM_SOURCE_DIR /%{pname} .logrotate $RPM_BUILD_ROOT /etc/logrotate.d/%{pname}
# since 10.0, the permission files are maintained centrally
%if %{?suse_version:%suse_version}%{?!suse_version:9999} < 1000
mkdir -p $RPM_BUILD_ROOT /etc/permissions.d
install -m 644 $RPM_SOURCE_DIR /permissions.%{pname} $RPM_BUILD_ROOT /etc/permissions.d/%{pname}
%endif
install -m 755 $RPM_SOURCE_DIR /apache2-check_forensic $RPM_BUILD_ROOT /%{_bindir} /check_forensic%{vers}
#
2007-01-08 12:26:19 +01:00
# xml stuff
2007-01-12 01:16:59 +01:00
install -d $RPM_BUILD_ROOT %{_datadir} /omc/svcinfo.d/
install -m 644 %{S:48} $RPM_BUILD_ROOT %{_datadir} /omc/svcinfo.d/
2007-01-08 12:26:19 +01:00
#
2006-12-20 18:01:15 +01:00
# ssl stuff
install -m 755 %{S:25} $RPM_BUILD_ROOT /%{_bindir} /
2011-04-08 16:57:32 +02:00
tar xjf %{SOURCE29} -C $RPM_BUILD_ROOT /%{sysconfdir}
2006-12-20 18:01:15 +01:00
#
# init script and friends
2011-09-29 11:39:43 +02:00
mkdir -p $RPM_BUILD_ROOT /etc/init.d
2006-12-20 18:01:15 +01:00
install -m 744 $RPM_SOURCE_DIR /rc.%{pname} $RPM_BUILD_ROOT /etc/init.d/%{pname}
2014-10-06 14:08:39 +02:00
install -m 700 $RPM_SOURCE_DIR /start_apache2 $RPM_BUILD_ROOT /usr/sbin/start_apache2
2011-09-29 11:39:43 +02:00
%if 0%{?suse_version} >= 1210
2013-02-25 19:49:36 +01:00
mkdir -p $RPM_BUILD_ROOT %{_unitdir} /system/
2014-10-06 14:08:39 +02:00
install -m 700 $RPM_SOURCE_DIR /apache2-systemd-ask-pass $RPM_BUILD_ROOT /usr/sbin/apache2-systemd-ask-pass
2013-02-25 19:49:36 +01:00
install -m 644 $RPM_SOURCE_DIR /apache2.service $RPM_BUILD_ROOT %{_unitdir} /system/apache2.service
2011-09-29 11:39:43 +02:00
%endif
2006-12-20 18:01:15 +01:00
ln -sf ../../etc/init.d/%{pname} $RPM_BUILD_ROOT /%{_sbindir} /rc%{pname}
install -m 755 $RPM_SOURCE_DIR /load_configuration $RPM_BUILD_ROOT /%{_prefix} /share/%{pname} /
install -m 755 $RPM_SOURCE_DIR /find_mpm $RPM_BUILD_ROOT /%{_prefix} /share/%{pname} /
install -m 755 $RPM_SOURCE_DIR /get_includes $RPM_BUILD_ROOT /%{_prefix} /share/%{pname} /
install -m 755 $RPM_SOURCE_DIR /find_httpd2_includes $RPM_BUILD_ROOT /%{_prefix} /share/%{pname} /
install -m 755 $RPM_SOURCE_DIR /apache-20-22-upgrade $RPM_BUILD_ROOT /%{_prefix} /share/%{pname} /
sed 's+/usr/lib+/usr/%_lib+' $RPM_SOURCE_DIR /get_module_list \
> $RPM_BUILD_ROOT /%{_prefix} /share/%{pname} /get_module_list
chmod 755 $RPM_BUILD_ROOT /%{_prefix} /share/%{pname} /get_module_list
2008-04-20 21:03:37 +02:00
install -m 755 $RPM_SOURCE_DIR /sysconf_addword $RPM_BUILD_ROOT /%{_prefix} /share/%{pname} /
2006-12-20 18:01:15 +01:00
install -m 755 $RPM_SOURCE_DIR /a2enflag $RPM_BUILD_ROOT /%{_sbindir}
ln -s a2enflag $RPM_BUILD_ROOT /%{_sbindir} /a2disflag
install -m 755 $RPM_SOURCE_DIR /a2enmod $RPM_BUILD_ROOT /%{_sbindir}
ln -s a2enmod $RPM_BUILD_ROOT /%{_sbindir} /a2dismod
#
# directories for files from other packages and other configuration
2011-04-08 16:57:32 +02:00
for i in vhosts.d sysconfig.d; do
mkdir -p $RPM_BUILD_ROOT /%{sysconfdir} /$i
done
2006-12-20 18:01:15 +01:00
#
# make list of all modules, and install sysconfig template
for i in $(find $RPM_BUILD_ROOT /%{libexecdir} -%{default_mpm} -name " * . s o " | sort); do
modname=${i#*mod_}; modname=${modname%.so}
modname=${modname##*lib}
all_modules=" $ a l l _ m o d u l e s $ m o d n a m e "
done
all_modules=$(echo $all_modules | fmt | sed 's/\(.*\)/# \1\\/' )
sed " s + @ @ a l l _ m o d u l e s @ @ + $ a l l _ m o d u l e s + " $RPM_SOURCE_DIR /sysconfig.%{pname} \
> $RPM_BUILD_ROOT /%{_var}/adm/fillup-templates/sysconfig.%{pname}
#
# install configuration files:
mkdir -p $RPM_BUILD_ROOT /%{runtimedir}
touch $RPM_BUILD_ROOT /%{sysconfdir} /sysconfig.d/include.conf
mkdir -p $RPM_BUILD_ROOT /%{sysconfdir} /conf.d
for i in default-server.conf \
errors.conf \
httpd.conf \
listen.conf \
mod_autoindex-defaults.conf \
mod_info.conf \
mod_log_config.conf \
mod_mime-defaults.conf \
mod_status.conf \
mod_userdir.conf \
mod_usertrack.conf \
server-tuning.conf \
ssl-global.conf
do
install -m 644 $RPM_SOURCE_DIR /apache2-$i $RPM_BUILD_ROOT /%{sysconfdir} /$i
done
cat > $RPM_BUILD_ROOT /%{sysconfdir} /uid.conf <<-EOF
User %httpduser
Group %httpdgroup
EOF
2010-03-05 15:57:50 +01:00
2006-12-20 18:01:15 +01:00
# remove configuration for mpms which have not been built
mpm_confs=" $ ( a w k ' / I f M o d u l e . * \ . c / { p r i n t $ 2 } ' $RPM_BUILD_ROOT / %{sysconfdir} / s e r v e r - t u n i n g . c o n f | c u t - d . - f 1 | t r ' \n ' ' ' ) "
for mpm_conf in $mpm_confs; do
case " %{mpms_to_build} " in
*$mpm_conf*) ;;
*) sed " / ^ # $ m p m _ c o n f / , / ^ $ / d " $RPM_BUILD_ROOT /%{sysconfdir} /server-tuning.conf > t
#diff -u $RPM_BUILD_ROOT/%{sysconfdir}/server-tuning.conf t ||:
mv t $RPM_BUILD_ROOT /%{sysconfdir} /server-tuning.conf
;;
esac
done
2012-02-11 09:39:57 +01:00
install -m 644 %{S:130} $RPM_BUILD_ROOT /%{sysconfdir} /vhosts.d/vhost.template
install -m 644 %{S:131} $RPM_BUILD_ROOT /%{sysconfdir} /vhosts.d/vhost-ssl.template
install -m 644 %{S:104} $RPM_BUILD_ROOT /%{sysconfdir} /conf.d/manual.conf
# install default vhost
dvh=$(basename %{S:132})
install -m 644 %{S:132} $RPM_BUILD_ROOT /%{sysconfdir} /${dvh##%{name}-}
dvhs=$(basename %{S:133})
install -m 644 %{S:133} $RPM_BUILD_ROOT /%{sysconfdir} /${dvhs##%{name}-}
2006-12-20 18:01:15 +01:00
# for mod_auth_ldap
install -m 644 docs/conf/charset.conv $RPM_BUILD_ROOT /%{sysconfdir} /
2010-03-05 15:57:50 +01:00
2006-12-20 18:01:15 +01:00
cp -p $RPM_SOURCE_DIR /robots.txt .
cp -p $RPM_SOURCE_DIR /favicon.ico $RPM_BUILD_ROOT /%{htdocsdir} /
cat > $RPM_BUILD_ROOT /%{htdocsdir} /robots.txt <<-EOF
User-Agent: *
Disallow: /
EOF
2010-03-05 15:57:50 +01:00
2006-12-20 18:01:15 +01:00
#
# use official mime.types (more complete)
#
ln -sf ../mime.types $RPM_BUILD_ROOT /%{sysconfdir} /mime.types
2010-03-05 15:57:50 +01:00
2013-06-18 07:57:29 +02:00
mv $RPM_BUILD_ROOT /%{cgidir} /printenv* .
2006-12-20 18:01:15 +01:00
mv $RPM_BUILD_ROOT /%{cgidir} /test-cgi .
pushd $RPM_BUILD_ROOT /%{_mandir}
for i in $(find . -type f); do
mv $i ${i%.*}%{vers} .${i#*.*.} || true
done
popd
2012-08-01 03:54:19 +02:00
pushd $RPM_BUILD_ROOT /%{_bindir}
for i in ab dbmmanage htdbm htdigest htpasswd logresolve;do
mv $i ${i}%{vers} || true
done
popd
2006-12-20 18:01:15 +01:00
pushd $RPM_BUILD_ROOT /%{_sbindir}
2012-08-01 03:54:19 +02:00
for i in rotatelogs suexec; do
2006-12-20 18:01:15 +01:00
mv $i ${i}%{vers} || true
done
mv apachectl apachectl.tmp; mv apachectl.tmp apache%{vers} ctl
popd
# fix up apxs
2012-08-01 03:54:19 +02:00
pushd $RPM_BUILD_ROOT /%{_bindir}
2006-12-20 18:01:15 +01:00
for mpm in %{mpms_to_build} ; do
cat <<-EOT_ED | ed -s apxs
H
,s/^\(.*\)config_vars.mk\(.*\)$/\1config_vars.mk\$mpm_suffix\2/
/config_vars.mk
2009-06-09 18:26:15 +02:00
-
2006-12-20 18:01:15 +01:00
i
my \$mpm_suffix = " - $ m p m " ;
.
wq apxs%{vers} -$mpm
EOT_ED
chmod 755 apxs%{vers} -$mpm
done
cat <<-EOT_ED | ed -s apxs
H
/config_vars
a
my \$mpm_suffix = " " ;
.
wq
EOT_ED
mv apxs apxs%{vers}
popd
2010-03-05 15:57:50 +01:00
2007-03-20 01:13:36 +01:00
# install firewall information file
2007-10-22 18:25:27 +02:00
install -d $RPM_BUILD_ROOT %{_sysconfdir} /sysconfig/SuSEfirewall2.d/services/
install -m 644 %{S:49} $RPM_BUILD_ROOT %{_sysconfdir} /sysconfig/SuSEfirewall2.d/services/%{name}
install -m 644 %{S:50} $RPM_BUILD_ROOT %{_sysconfdir} /sysconfig/SuSEfirewall2.d/services/%{name} -ssl
2012-08-01 06:13:58 +02:00
ln -sf %{_bindir} /apxs%{vers} %{buildroot} %{_sbindir}
2006-12-20 18:01:15 +01:00
#
# filelists
#
>filelist; >filelist-devel
for mpm in %{mpms_to_build} ; do
echo %dir %{_libdir} /%{pname} -$mpm >> filelist
(
echo %dir %{includedir} -$mpm
2012-08-01 03:54:19 +02:00
echo %{_bindir} /apxs%{vers} -$mpm
2006-12-20 18:01:15 +01:00
) >> filelist-devel
done
find $RPM_BUILD_ROOT /%{includedir} /.. -type f -o -type l \
| sed " s # $RPM_BUILD_ROOT # # " \
>> filelist-devel
find $RPM_BUILD_ROOT /%{installbuilddir} -type f \
| sed " s # $RPM_BUILD_ROOT # # " \
>> filelist-devel
2010-03-05 15:57:50 +01:00
2006-12-20 18:01:15 +01:00
# remove files from the build root that we won't package
rm -f $RPM_BUILD_ROOT /%{_libdir} /%{pname} -*/*.exp # needed only on AIX
rm -f $RPM_BUILD_ROOT /%{_libdir} /%{pname} /*.exp # needed only on AIX
rm -f $RPM_BUILD_ROOT /%{_sbindir} /checkgid # needed only for user installations from tarball
rm -r $RPM_BUILD_ROOT /%{sysconfdir} /extra # it is already in the documentation directory
2010-03-05 15:57:50 +01:00
2006-12-20 18:01:15 +01:00
#
# O/ _|_ _ __|_
# /O |_(/__> |_
#
#
# now check wether httpd binary runs properly
# and validate httpd.conf file
#
pushd $RPM_BUILD_ROOT /%{sysconfdir}
for i in *.conf; do cp $i $i.test; done
%if %{?suse_version:%suse_version}%{?!suse_version:9999} < 810
echo -e " U s e r % h t t p d u s e r \n G r o u p n o g r o u p " > uid.conf.test
sed 's+/srv/www+/usr/local/httpd+' default-server.conf > t
mv t default-server.conf
mkdir -p /usr/local/httpd/htdocs
%endif
# for Fedora
%if %{?suse_version:0}%{!?suse_version:1}
echo -e " U s e r n o b o d y \n G r o u p n o b o d y " > uid.conf.test
mkdir -p $RPM_BUILD_ROOT /%{htdocsdir}
%endif
sed -e 's+/usr/%_lib+' $RPM_BUILD_ROOT '/usr/%_lib+' \
-e 's+/var/run+' $RPM_BUILD_ROOT '/var/run+' \
-e 's+%{sysconfdir}+' $RPM_BUILD_ROOT '%{sysconfdir}+' \
-e 's+%{datadir}+' $RPM_BUILD_ROOT '%{datadir}+' \
-e 's+\.conf$+&.test+' \
2012-08-01 03:54:19 +02:00
-e 's+/var/log+' $RPM_BUILD_ROOT '/var/log+' \
2006-12-20 18:01:15 +01:00
httpd.conf > httpd.conf.test
sed -e 's+%{sysconfdir}+' $RPM_BUILD_ROOT '%{sysconfdir}+' \
default-server.conf > default-server.conf.test
touch sysconfig.d/global.conf.test
touch sysconfig.d/include.conf.test
popd
pushd $RPM_BUILD_ROOT
for i in $(export LC_ALL=C; find .%{libexecdir} -%{default_mpm} -name " * . s o " | sort); do
mod_id=${i#*mod_}; mod_id=${mod_id%.so}_module
mod_path=
echo LoadModule $mod_id $RPM_BUILD_ROOT /${i#.} >> .%{sysconfdir}/sysconfig.d/loadmodule.conf.test
done
# auth_ldap_module needs to be loaded after ldap_module
echo -e " / a u t h n z _ l d a p \n + \n - m / l d a p \n w q " | ed -s ./%{sysconfdir} /sysconfig.d/loadmodule.conf.test
popd
2010-03-05 15:57:50 +01:00
2006-12-20 18:01:15 +01:00
%if %{?suse_version:1}%{!?suse_version:0}
LD_LIBRARY_PATH=${RPM_BUILD_ROOT} %{_libdir} \
$RPM_BUILD_ROOT /%{_sbindir} /httpd%{vers} -%{default_mpm} \
-e debug -t -f $RPM_BUILD_ROOT /%{sysconfdir} /httpd.conf.test || exit 1
%else
LD_LIBRARY_PATH=${RPM_BUILD_ROOT} %{_libdir} \
$RPM_BUILD_ROOT /%{_sbindir} /httpd%{vers} -%{default_mpm} \
-e debug -t -f $RPM_BUILD_ROOT /%{sysconfdir} /httpd.conf.test || :
%endif
rm $RPM_BUILD_ROOT /%{sysconfdir} /*.test
rm $RPM_BUILD_ROOT /%{sysconfdir} /sysconfig.d/*
mv $RPM_BUILD_ROOT /%{sysconfdir} /original .
%files -f filelist
# _
# O/ _|_o| _ _
# /O | ||(/__>
#
%defattr (-,root,root)
%doc INSTALL READM* LICENSE ABOUT_APACHE CHANGES
%doc support/SHA1
2012-02-18 22:19:08 +01:00
%doc %{_mandir} /man?/apachectl%{vers} .?.*
%doc %{_mandir} /man?/htcacheclean%{vers} .?.*
%doc %{_mandir} /man?/%{httpd} .?.*
%doc %{_mandir} /man?/apxs%{vers} .?.*
2006-12-20 18:01:15 +01:00
%doc robots.txt
%doc printenv
%doc test-cgi
#%doc httpd-std.conf-*
#%doc ssl-std.conf
%doc httpd.conf.default
%doc original
%attr (750,root,root) %dir %{logfiledir}
%attr (750,%httpduser,root) %dir %{proxycachedir}
%attr (750,%httpduser,root) %dir %{localstatedir}
%dir %{sysconfdir}
%config %{sysconfdir} /magic
%config %{sysconfdir} /mime.types
%config (noreplace) %{sysconfdir} /*.conf
%config (noreplace) %{sysconfdir} /charset.conv
%{sysconfdir} /vhosts.d/*.template
%dir %{sysconfdir} /ssl.crl
%dir %{sysconfdir} /ssl.crt
%dir %{sysconfdir} /ssl.csr
%dir %attr (700,root,root) %{sysconfdir} /ssl.key
%dir %{sysconfdir} /ssl.prm
2011-04-08 16:57:32 +02:00
%{sysconfdir} /ssl.*/README*
2006-12-20 18:01:15 +01:00
%dir %{sysconfdir} /conf.d
%dir %{sysconfdir} /vhosts.d
%dir %{sysconfdir} /sysconfig.d
%config (noreplace) /etc/logrotate.d/%{pname}
2007-01-12 01:16:59 +01:00
%{_datadir} /omc/svcinfo.d/apache2.xml
2006-12-20 18:01:15 +01:00
%if %{?suse_version:%suse_version}%{?!suse_version:9999} < 1000
%config (noreplace) /etc/permissions.d/%{pname}
%endif
%config /etc/init.d/%{pname}
2011-09-29 11:39:43 +02:00
%if 0%{?suse_version} >= 1210
2013-02-25 19:49:36 +01:00
%{_unitdir} /system/%{pname} .service
2011-09-29 11:39:43 +02:00
%endif
2006-12-20 18:01:15 +01:00
#
%{_sbindir} /rc%{pname}
%{_sbindir} /apache%{vers} ctl
%{_sbindir} /envvars
%{_sbindir} /envvars-std
%{_sbindir} /htcacheclean
%{_sbindir} /a2enflag
%{_sbindir} /a2enmod
%{_sbindir} /a2disflag
%{_sbindir} /a2dismod
2011-09-12 14:20:52 +02:00
%{_sbindir} /start_apache2
2011-09-29 11:39:43 +02:00
%if 0%{?suse_version} >= 1210
2011-09-12 14:20:52 +02:00
%{_sbindir} /apache2-systemd-ask-pass
2011-09-29 11:39:43 +02:00
%endif
2006-12-20 18:01:15 +01:00
%{_bindir} /log_server_status%{vers}
%{iconsdir}
%{errordir}
%{_var}/adm/fillup-templates/sysconfig.%{pname}
%attr (755,root,root) %{_libdir} /%{pname} _MMN
%dir %{_libdir} /%{pname}
%{_libdir} /%{pname} /mod_*.so
%dir %{installbuilddir}
%dir %{_prefix} /share/%{pname}
%{_prefix} /share/%{pname} /apache-20-22-upgrade
%{_prefix} /share/%{pname} /get_module_list
%{_prefix} /share/%{pname} /get_includes
%{_prefix} /share/%{pname} /find_httpd2_includes
%{_prefix} /share/%{pname} /find_mpm
%{_prefix} /share/%{pname} /load_configuration
2008-04-20 21:03:37 +02:00
%{_prefix} /share/%{pname} /sysconf_addword
2007-10-22 18:25:27 +02:00
%config %{_sysconfdir} /sysconfig/SuSEfirewall2.d/services/%{name}
%config %{_sysconfdir} /sysconfig/SuSEfirewall2.d/services/%{name} -ssl
2011-09-13 10:38:39 +02:00
2006-12-20 18:01:15 +01:00
%if %prefork
%files prefork
%defattr (-,root,root)
%{_sbindir} /%{httpd} -prefork
%dir %{_libdir} /%{pname} -prefork
%{_libdir} /%{pname} -prefork/mod_*.so
%endif
%if %worker
%files worker
%defattr (-,root,root)
%{_sbindir} /%{httpd} -worker
%dir %{_libdir} /%{pname} -worker
%{_libdir} /%{pname} -worker/mod_*.so
%endif
%if %event
%files event
%defattr (-,root,root)
%{_sbindir} /%{httpd} -event
%dir %{_libdir} /%{pname} -event
%{_libdir} /%{pname} -event/mod_*.so
%endif
%files devel -f filelist-devel
%defattr (-,root,root)
%dir %{_prefix} /share/%{pname}
%dir %{installbuilddir}
%dir %{includedir}
2012-08-01 03:54:19 +02:00
%{_bindir} /apxs%{vers}
2012-08-01 06:13:58 +02:00
%{_sbindir} /apxs%{vers}
2006-12-20 18:01:15 +01:00
%files doc
%defattr (-,root,root)
%doc %{manualdir}
%dir %{sysconfdir}
%dir %{sysconfdir} /conf.d
2012-02-11 09:39:57 +01:00
%config %{sysconfdir} /conf.d/manual.conf
2006-12-20 18:01:15 +01:00
%files example-pages
%defattr (-,root,root)
%config (noreplace) %{htdocsdir} /index.htm*
%config (noreplace) %{htdocsdir} /favicon.ico
%config (noreplace) %{htdocsdir} /robots.txt
2007-07-23 21:27:20 +02:00
%files utils
%defattr (-,root,root)
2012-02-18 22:19:08 +01:00
%doc %{_mandir} /man?/ab%{vers} .?.*
%doc %{_mandir} /man?/dbmmanage%{vers} .?.*
%doc %{_mandir} /man?/htdbm%{vers} .?.*
%doc %{_mandir} /man?/htdigest%{vers} .?.*
%doc %{_mandir} /man?/htpasswd%{vers} .?.*
%doc %{_mandir} /man?/httxt2dbm%{vers} .?.*
%doc %{_mandir} /man?/logresolve%{vers} .?.*
%doc %{_mandir} /man?/rotatelogs%{vers} .?.*
%doc %{_mandir} /man?/suexec%{vers} .?.*
2012-08-01 03:54:19 +02:00
%{_sbindir} /fcgistarter
%{_mandir} /man8/fcgistarter2.8.*
2007-07-23 21:27:20 +02:00
%{_bindir} /check_forensic%{vers}
%{_bindir} /dbmmanage%{vers}
%{_bindir} /gensslcert
%{_bindir} /htdbm%{vers}
%{_bindir} /htdigest%{vers}
%{_bindir} /htpasswd%{vers}
%{_bindir} /split-logfile%{vers}
2012-08-01 03:54:19 +02:00
%{_bindir} /ab%{vers}
%{_bindir} /httxt2dbm
2007-07-23 21:27:20 +02:00
%{_sbindir} /logresolve.pl%{vers}
2012-08-01 03:54:19 +02:00
%{_bindir} /logresolve%{vers}
2007-07-23 21:27:20 +02:00
%{_sbindir} /rotatelogs%{vers}
%verify (not mode) %attr (0755,root,root) %_sbindir /suexec2
2006-12-20 18:01:15 +01:00
%if %prefork
%post prefork
2014-11-10 11:08:27 +01:00
/usr/share/%{pname} /get_module_list >/dev/null 2>&1
2006-12-20 18:01:15 +01:00
exit 0
%endif
%if %worker
%post worker
2014-11-10 11:08:27 +01:00
/usr/share/%{pname} /get_module_list >/dev/null 2>&1
2006-12-20 18:01:15 +01:00
exit 0
%endif
%if %event
%post event
2014-11-10 11:08:27 +01:00
/usr/share/%{pname} /get_module_list >/dev/null 2>&1
2006-12-20 18:01:15 +01:00
exit 0
%endif
2010-03-05 15:57:50 +01:00
2006-12-20 18:01:15 +01:00
#
# O/ ._ .__ / ._ _ __|_
# /O |_)|(/_ / |_)(_)_> |_
# | |
#
2010-03-05 15:57:50 +01:00
2009-06-09 18:26:15 +02:00
%pre
2011-10-07 17:06:00 +02:00
%if %{?suse_version:0}%{!?suse_version:1}
# on Fedora, add the "apache" user
2014-11-10 11:08:27 +01:00
if ! /usr/bin/getent passwd %httpduser >/dev/null 2>&1; then
2009-06-09 18:26:15 +02:00
echo " C r e a t i n g % h t t p d u s e r u s e r "
/usr/sbin/useradd -c " A p a c h e " -u 48 \
-s /sbin/nologin -r -d %{localstatedir} %httpduser 2> /dev/null || :
fi
2011-10-07 17:06:00 +02:00
%endif
2011-09-29 11:39:43 +02:00
%if 0%{?suse_version} >= 1210
%service_add_pre apache2.service
%endif
2009-06-09 18:26:15 +02:00
%preun
2011-09-29 11:39:43 +02:00
%if 0%{?suse_version} >= 1210
%service_del_preun apache2.service
%endif
2006-12-20 18:01:15 +01:00
for i in %{_sbindir} /%{httpd} \
%{installbuilddir} /config_vars.mk
do
test -L $i && rm $i
done
exit 0
%postun
2011-09-29 11:39:43 +02:00
%if 0%{?suse_version} >= 1210
%service_del_postun apache2.service
%endif
2006-12-20 18:01:15 +01:00
#if %suse_version > 810
#restart_on_update %{pname}
#endif
%insserv_cleanup
%post
2013-01-18 18:45:43 +01:00
%if 0%{?suse_version} <= 1130
2006-12-20 18:01:15 +01:00
%run_permissions
2013-01-18 18:45:43 +01:00
%else
%set_permissions /usr/sbin/suexec2
%endif
2006-12-20 18:01:15 +01:00
%if 0%{?suse_version}
# a group wwwadmin has existed in the distant past, and it was renamed to www
if grep -q " ^ w w w a d m i n : " /etc/group; then
groupmod -n www wwwadmin 2>/dev/null ||:
2009-06-09 18:26:15 +02:00
usermod -g %httpdgroup %httpduser 2>/dev/null ||:
usermod -s /bin/false %httpduser 2>/dev/null ||:
2006-12-20 18:01:15 +01:00
fi
%endif
tmpdir=$(mktemp -d etc/%{pname} /%{pname} -post.XXXXXX); test $? = 0 || { echo >&2 Could not create tmpdir. Exiting; exit 1; }
tmpfile=$tmpdir/tmpfile
if test -s etc/sysconfig/%{pname} && grep -q " ^ L O A D M O D U L E S " etc/sysconfig/%{pname} ; then
sed " s / L O A D M O D U L E S / A P A C H E _ M O D U L E S / " etc/sysconfig/%{pname} >| $tmpfile \
&& cp $tmpfile etc/sysconfig/%{pname}
fi
2008-09-12 22:47:19 +02:00
%{fillup_and_insserv apache2}
2006-12-20 18:01:15 +01:00
# Update ?
if [ ${FIRST_ARG:-0} -gt 1 ]; then
# update from package with the old near-monolithic conf file?
if [ -s ./%{sysconfdir} /httpd.conf.default -a -s ./%{sysconfdir} /httpd.conf.rpmnew ]; then
diff -u .%{sysconfdir} /httpd.conf.default .%{sysconfdir} /httpd.conf \
> $tmpdir/httpd.conf.dif ||:
cp -p $tmpdir/httpd.conf.dif ./%{sysconfdir} /httpd.conf var/adm/backup/
archive_conf=$(old var/adm/backup/httpd.conf 2>/dev/null); archive_conf=${archive_conf##*/}
archive_dif=$(old var/adm/backup/httpd.conf.dif 2>/dev/null); archive_dif=${archive_dif##*/}
fi
#
sed "
# generated files were renamed from suse_* to sysconfig.d/*
s|\(^Include /etc/apache2\)/suse_\(\(include\|loadmodule\|global\).conf\)|\1/sysconfig.d/\2|
2010-03-05 15:57:50 +01:00
2006-12-20 18:01:15 +01:00
# the access_log configuration is now configurable
s|^CustomLog /var/log/apache2/access_log.*|# &|
2010-03-05 15:57:50 +01:00
2006-12-20 18:01:15 +01:00
# group of wwwrun has changed
s|^Group nogroup|Group www|
2010-03-05 15:57:50 +01:00
2006-12-20 18:01:15 +01:00
" < . / %{sysconfdir} / h t t p d . c o n f > $ t m p f i l e
chmod --reference=./%{sysconfdir} /httpd.conf $tmpfile
chown --reference=./%{sysconfdir} /httpd.conf $tmpfile
cmp -s $tmpfile ./%{sysconfdir} /httpd.conf || cp -p $tmpfile ./%{sysconfdir} /httpd.conf
fi
2010-03-05 15:57:50 +01:00
2006-12-20 18:01:15 +01:00
rm -rf $tmpdir
/usr/share/%{pname} /apache-20-22-upgrade
2014-11-10 11:08:27 +01:00
/usr/share/%{pname} /get_module_list >/dev/null 2>&1
2011-09-29 11:39:43 +02:00
%if 0%{?suse_version} >= 1210
%service_add_post apache2.service
%endif
2006-12-20 18:01:15 +01:00
exit 0
2010-03-05 15:57:50 +01:00
2006-12-20 18:01:15 +01:00
%verify script
%verify _permissions -e %{_sbindir} /suexec2
%clean
if ! test -f /.buildenv; then
rm -rf $RPM_BUILD_ROOT
fi
2007-12-13 20:32:12 +01:00
2007-03-20 01:13:36 +01:00
%changelog