From f121dc4250bba1bca83e880eb90fbbbe0d5585ec38757037fff8fda2c82ba418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Wed, 25 Feb 2015 13:43:34 +0000 Subject: [PATCH] - Pass over spec-cleaner, there should be no actual technical change in this just reduction of lines in the spec OBS-URL: https://build.opensuse.org/package/show/Apache/apache2?expand=0&rev=433 --- apache2.changes | 6 + apache2.spec | 637 +++++++++++++++++++----------------------------- 2 files changed, 261 insertions(+), 382 deletions(-) diff --git a/apache2.changes b/apache2.changes index f51ed07..dc39dba 100644 --- a/apache2.changes +++ b/apache2.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Feb 25 13:23:40 UTC 2015 - tchvatal@suse.com + +- Pass over spec-cleaner, there should be no actual technical + change in this just reduction of lines in the spec + ------------------------------------------------------------------- Mon Feb 23 16:58:11 UTC 2015 - kstreitova@suse.com diff --git a/apache2.spec b/apache2.spec index 368ddfd..0f6c6f8 100644 --- a/apache2.spec +++ b/apache2.spec @@ -1,7 +1,7 @@ # # spec file for package apache2 # -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,88 +16,51 @@ # -Name: apache2 -BuildRequires: automake -BuildRequires: db-devel -BuildRequires: ed -BuildRequires: libapr-util1-devel -#Since 2.4.7 the event MPM requires apr 1.5.0 or later. -BuildRequires: libapr1-devel >= 1.5.0 -# -BuildRequires: openldap2-devel -BuildRequires: openssl-devel >= 0.9.8a -BuildRequires: pcre-devel -BuildRequires: xz -BuildRequires: zlib-devel -BuildRequires: lua-devel -#for mod_proxy_html and mod_xml2enc -BuildRequires: libxml2-devel -%if %{?suse_version:1}0 && 0%{?sles_version} == 9 -BuildRequires: libcap -%else -BuildRequires: libcap-devel -%endif -%if 0%{?suse_version} >= 1210 -BuildRequires: pkgconfig -BuildRequires: pkgconfig(systemd) -BuildRequires: pkgconfig(libsystemd-daemon) -%endif - -%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 %define vers 2 %define httpd httpd2 -%define apache_mmn %(test -s %{S:0} && { echo -n apache_mmn_; bzcat %{S:0} | awk '/^#define MODULE_MAGIC_NUMBER_MAJOR/ {printf "%d", $3}'; }) +%define apache_mmn %(test -s %{SOURCE0} && { echo -n apache_mmn_; bzcat %{SOURCE0} | awk '/^#define MODULE_MAGIC_NUMBER_MAJOR/ {printf "%d", $3}'; }) %define default_mpm prefork %{!?prefork:%define prefork 1} %{!?worker:%define worker 1} %{!?event:%define event 1} -%define mpms_to_build %(test %prefork = 1 && printf prefork) %(test %worker = 1 && printf worker) %(test %event = 1 && printf event) +%define mpms_to_build %(test %{prefork} = 1 && printf prefork) %(test %{worker} = 1 && printf worker) %(test %{event} = 1 && printf event) # 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 manualdir %{_datadir}/%{pname}/manual +%define errordir %{_datadir}/%{pname}/error +%define iconsdir %{_datadir}/%{pname}/icons %define cgidir %{datadir}/cgi-bin -%define localstatedir /var/lib/%{pname} -%define proxycachedir /var/cache/%{pname} -%define logfiledir /var/log/%{pname} -%if %suse_version >= 1220 +%define localstatedir %{_localstatedir}/lib/%{pname} +%define proxycachedir %{_localstatedir}/cache/%{pname} +%define logfiledir %{_localstatedir}/log/%{pname} +%define sysconfdir %{_sysconfdir}/%{pname} +%define includedir %{_includedir}/%{pname} +%define libexecdir %{_libdir}/%{pname} +%define installbuilddir %{_datadir}/%{pname}/build +%define userdir public_html +%define suexec_safepath %{_prefix}/local/bin:%{_prefix}/bin:/bin +%define VENDOR SUSE +%define platform_string Linux/%{VENDOR} +%define realver 2.4.11 +%define httpduser wwwrun +%define httpdgroup www +%if 0%{?suse_version} >= 1220 %define runtimedir /run %define mods_static access_compat unixd systemd %else -%define runtimedir /var/run +%define runtimedir %{_localstatedir}/run %define mods_static access_compat unixd %endif -%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 -%if %suse_version > 1220 -%define _unitdir /usr/lib/systemd -%else -%define _unitdir /lib/systemd -%endif - -# "Server:" header -%define VENDOR SUSE -%define platform_string Linux/%VENDOR -%define realver 2.4.11 +Name: apache2 Version: 2.4.11 Release: 0 -#Source0: http://www.apache.org/dist/httpd-%{version}.tar.bz2 -Source0: httpd-%{realver}.tar.bz2 +Summary: The Apache Web Server Version 2.4 +License: Apache-2.0 +Group: Productivity/Networking/Web/Servers +Url: http://httpd.apache.org/ +Source0: http://www.apache.org/dist/httpd-%{realver}.tar.bz2 # Add file to take mtime from it in prep section Source1: apache2.changes Source6: 60C5442D.key @@ -166,37 +129,49 @@ Patch109: httpd-2.4.3-mod_systemd.patch Patch111: httpd-visibility.patch # PATCH-FIX-UPSTREAM bnc#918352 kstreitova@suse.com -- fix mod_lua - maliciously crafted websockets PING after a script calls r:wsupgrade() can cause a child process crash Patch112: httpd-2.4.x-mod_lua_websocket_DoS.patch -Url: http://httpd.apache.org/ -Icon: Apache.xpm -Summary: The Apache Web Server Version 2.4 -License: Apache-2.0 -Group: Productivity/Networking/Web/Servers +BuildRequires: automake +BuildRequires: db-devel +BuildRequires: ed +BuildRequires: libapr-util1-devel +#Since 2.4.7 the event MPM requires apr 1.5.0 or later. +BuildRequires: libapr1-devel >= 1.5.0 +BuildRequires: libcap-devel +#for mod_proxy_html and mod_xml2enc +BuildRequires: libxml2-devel +BuildRequires: lua-devel +BuildRequires: openldap2-devel +BuildRequires: openssl-devel >= 0.9.8a +BuildRequires: pcre-devel +BuildRequires: xz +BuildRequires: zlib-devel +Requires: %{_sysconfdir}/mime.types +Requires: %{pname}-MPM +Requires: logrotate +Requires(post): %insserv_prereq %fillup_prereq permissions pwdutils +Requires(post): %{name}-utils +Requires(post): fileutils +Requires(post): grep +Requires(post): sed +Requires(post): textutils +Recommends: apache2-%{default_mpm} Provides: %{apache_mmn} Provides: http_daemon Provides: httpd Provides: suse_help_viewer Provides: %{name}-mod_macro = %{version} Obsoletes: %{name}-mod_macro <= 1.2.1 -Requires: %{pname}-MPM -Requires: /etc/mime.types -PreReq: %{name}-utils -Requires: logrotate +Provides: apache = %{version} +Obsoletes: apache < 1.3.29 +Obsoletes: mod_ssl < 2.8.16 +BuildRoot: %{_tmppath}/%{name}-%{version}-build #for some reason the parser barfs if not conditional %{?requires_ge:%requires_ge libapr1} %{?requires_ge:%requires_ge libapr-util1} %{?systemd_requires} -PreReq: fileutils textutils grep sed -%if %{?suse_version:1}0 -PreReq: %insserv_prereq %fillup_prereq permissions pwdutils -%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 -%if 0%{?suse_version} >= 1110 -Recommends: apache2-%default_mpm +%if 0%{?suse_version} >= 1210 +BuildRequires: pkgconfig +BuildRequires: pkgconfig(libsystemd-daemon) +BuildRequires: pkgconfig(systemd) %endif %description @@ -206,59 +181,54 @@ 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 + + See %{_docdir}/apache2/, http://httpd.apache.org/, and http://httpd.apache.org/docs-2.4/upgrading.html. %if %worker - %package worker Summary: Apache 2 worker MPM (Multi-Processing Module) Group: Productivity/Networking/Web/Servers -Provides: %{pname}-MPM Requires: %{name} = %{version} +Provides: %{pname}-MPM %endif -%if %prefork +%if %prefork %package prefork Summary: Apache 2 "prefork" MPM (Multi-Processing Module) Group: Productivity/Networking/Web/Servers -Provides: %{pname}-MPM -%if 0%{?suse_version} >= 901 && 0%{?sles_version} != 9 -Provides: apache:/usr/sbin/httpd -%endif Requires: %{name} = %{version} +Provides: %{pname}-MPM +Provides: apache:%{_sbindir}/httpd %endif -%if %event +%if %event %package event Summary: Apache 2 event MPM (Multi-Processing Module) Group: Productivity/Networking/Web/Servers -Provides: %{pname}-MPM Requires: %{name} = %{version} +Provides: %{pname}-MPM %endif -%if %worker +%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 +%if %{prefork} %description prefork "prefork" 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 +%if %{event} %description event The event MPM (multi-Processing Module) is experimental, so it may or may not work as expected. @@ -270,7 +240,6 @@ again until the Keep Alive timeout was reached. This MPM depends on APR's atomic compare-and-swap operations for thread synchronization. - %endif %package devel @@ -287,15 +256,12 @@ Requires: libapr1-devel This package contains header files and include files that are needed for development using the Apache API. - - %package doc Summary: Additional Package Documentation Group: Documentation/Other -%if 0%{?suse_version} >= 901 && 0%{?sles_version} != 9 -Provides: apache-doc -Obsoletes: apache-doc -%endif +# Remove after 13.2 is out of support scope +Provides: apache-doc = %{version} +Obsoletes: apache-doc < %{version} %if 0%{?suse_version} >= 1120 BuildArch: noarch %endif @@ -304,15 +270,12 @@ BuildArch: noarch 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 Group: Productivity/Networking/Web/Servers -%if 0%{?suse_version} >= 901 && 0%{?sles_version} != 9 +# Remove after 13.2 is out of support scope Provides: apache-example-pages Obsoletes: apache-example-pages -%endif %description example-pages Some Example pages for Apache that show information about the installed @@ -327,11 +290,6 @@ Utilities provided by the Apache 2 Web Server project which are useful to administrators of web servers in general. %prep -# -# O/ ._ .__ ._ -# /O |_)|(/_|_) -# | | -# %setup -q -n httpd-%{realver} %patch2 -p1 %patch23 -p1 @@ -347,42 +305,32 @@ to administrators of web servers in general. %patch112 -p1 cat $RPM_SOURCE_DIR/SUSE-NOTICE >> NOTICE # 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}-} +a=$(basename %{SOURCE22}) +cp %{SOURCE22} ./${a##%{name}-} +b=$(basename %{SOURCE23}) +cp %{SOURCE23} ./${b##%{name}-} +c=$(basename %{SOURCE24}) +cp %{SOURCE24} ./${c##%{name}-} # # 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,(" 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 # Use mtime of .changes for build time -CHANGES=`stat --format="%y" %SOURCE1` -sed -i -e "s/__DATE__ \" \" __TIME__;/\"$CHANGES\";/" server/buildmark.c +CHANGES=`stat --format="%{y}" %{SOURCE1}` +sed -i -e "s/__DATE__ \" \" __TIME__;/\"$CHANGES\";/" server/buildmark.c # -# now configure Apache +# now configure Apache # -%if 0%{?suse_version} > 910 autoreconf -fiv -%else -rm -rf aclocal.m4 autom4te*.cache -autoheader -autoconf -%endif %build -# -# O/ |_ o| _| -# /O |_)|_|||(_| -# function configure { - CFLAGS="$RPM_OPT_FLAGS -fPIC -Wall -DLDAP_DEPRECATED" \ + CFLAGS="%{optflags} -fPIC -Wall -DLDAP_DEPRECATED" \ CPPFLAGS="-DSSL_EXPERIMENTAL_ENGINE -DMAX_SERVER_LIMIT=200000 -DLDAP_DEPRECATED -DMAXLINE=4096" \ ./configure \ - --enable-layout=SuSE81%(test "%_lib" = lib64 && echo -n _64) \ + --enable-layout=SuSE81%(test "%{_lib}" = lib64 && echo -n _64) \ --with-program-name=httpd%{vers}$mpm_suffix \ --with-apr=%{_bindir}/apr-1-config \ --with-apr-util=%{_bindir}/apu-1-config \ @@ -394,17 +342,12 @@ function configure { %endif %endif %endif - \ --enable-exception-hook \ - \ -%if %{?suse_version:%suse_version}%{?!suse_version:9999} > 930 --with-pcre \ --enable-pie \ -%endif --enable-mods-shared=all \ --enable-mods-static="%{mods_static}" \ --enable-ssl=shared \ - \ --disable-isapi \ --enable-deflate \ --enable-echo \ @@ -417,12 +360,10 @@ function configure { --enable-bucketeer \ --enable-case_filter \ --enable-case_filter_in \ - --enable-imagemap \ - \ + --enable-imagemap \ --with-ldap \ --enable-ldap \ --enable-authnz_ldap \ - \ --enable-proxy \ --enable-proxy-connect \ --enable-proxy-ftp \ @@ -431,17 +372,15 @@ function configure { --enable-disk-cache \ --enable-mem-cache \ --enable-version \ - \ --enable-dav-lock \ --enable-authn-alias \ --enable-optional-hook-export \ --enable-optional-hook-import \ --enable-optional-fn-import \ - --enable-optional-fn-export \ - \ + --enable-optional-fn-export \ --enable-suexec \ --with-suexec-bin=%{_sbindir}/suexec%{vers} \ - --with-suexec-caller=%httpduser \ + --with-suexec-caller=%{httpduser} \ --with-suexec-docroot=%{datadir} \ --with-suexec-logfile=%{logfiledir}/suexec.log \ --with-suexec-userdir=%{userdir} \ @@ -451,33 +390,33 @@ function configure { --disable-heartbeat } -# +# # |_ o| _| | _ _ ._ # |_)|_|||(_| |(_)(_)|_) # | # # build the 3 multi-processing modules (MPM) in a loop # -[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT; +[ %{buildroot} != "/" ] && [ -d %{buildroot} ] && rm -rf %{buildroot}; for mpm in %{mpms_to_build}; do echo $mpm >> .status test -s Makefile && make clean >/dev/null echo -e "\n\n\n \e[01m***** Building $mpm MPM *****\e[00m\n\n\n" export mpm_suffix=-$mpm - configure + configure sed "s/%{vers}-$mpm//" include/ap_config_auto.h > include/ap_config_auto.h.new mv include/ap_config_auto.h.new include/ap_config_auto.h - sed -i -e "s@/var/run@%{runtimedir}@g" include/ap_config_layout.h + sed -i -e "s@%{_localstatedir}/run@%{runtimedir}@g" include/ap_config_layout.h - make CFLAGS="$RPM_OPT_FLAGS -fvisibility=hidden -fPIC \ + make CFLAGS="%{optflags} -fvisibility=hidden -fPIC \ -Wall \ -DDEFAULT_ERRORLOG='\"%{logfiledir}/error_log\"' " \ - %{?jobs:-j%jobs} + %{?_smp_mflags} - make DESTDIR=$RPM_BUILD_ROOT install + make DESTDIR=%{buildroot} install - #rm -rf $RPM_BUILD_ROOT.$mpm.pre - #cp -a $RPM_BUILD_ROOT/ $RPM_BUILD_ROOT.$mpm.pre + #rm -rf %{buildroot}.$mpm.pre + #cp -a %{buildroot}/ %{buildroot}.$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 ||: @@ -485,32 +424,32 @@ for mpm in %{mpms_to_build}; do 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 + #mv %{buildroot}/%{sysconfdir}/httpd-std.conf %{buildroot}/%{sysconfdir}/httpd-std.conf$mpm_suffix + #mv %{buildroot}/%{sysconfdir}/httpd2-prefork.conf %{buildroot}/%{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 "/^EXTRA_INCLUDES/s|-I$RPM_BUILD_DIR[^ ]* ||g" \ -e "/^AP._INCLUDEDIR/s|$RPM_BUILD_DIR.*$|%{includedir}$mpm_suffix|" \ -e "/abs_srcdir/d" \ -e "/AP_LIBS/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 + < %{buildroot}/%{installbuilddir}/config_vars.mk \ + > %{buildroot}/%{installbuilddir}/config_vars.mk$mpm_suffix + rm %{buildroot}/%{installbuilddir}/config_vars.mk + #rm -rf %{buildroot}.$mpm.post + #cp -a %{buildroot}/ %{buildroot}.$mpm.post done -mkdir -p $RPM_BUILD_ROOT/%{libexecdir} +mkdir -p %{buildroot}/%{libexecdir} # remove references to mpm type in config_vars -sed -e "s^/usr/%_lib/%{pname}-%{default_mpm}^/usr/%_lib/%{pname}^" \ +sed -e "s^%{_libdir}/%{pname}-%{default_mpm}^%{_libdir}/%{pname}^" \ -e "s/httpd$/%{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 + < %{buildroot}/%{installbuilddir}/config_vars.mk-%{default_mpm} \ + > %{buildroot}/%{installbuilddir}/config_vars.mk # 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} +ldir=%{buildroot}/%{libexecdir} for i in $(cd $ldir-%{default_mpm}; ls -1 *.so); do identical=true for mpm in %{mpms_to_build}; do @@ -535,7 +474,7 @@ done # merge the three /usr/include/apache2-* directories # by putting them in /usr/lib/apache%{vers} -idir=$RPM_BUILD_ROOT/%{includedir} +idir=%{buildroot}/%{includedir} mkdir -p $idir for i in $(cd $idir-%{default_mpm}; ls -1); do identical=true @@ -557,92 +496,82 @@ for i in ap_config_auto.h ap_config_layout.h; do done %install -# -# O/ o._ __|_ _.|| -# /O || |_> |_(_||| -# -# # (most installation (to build root) has already been done in %%build) # # save MODULE_MAGIC_NUMBER -cat > $RPM_BUILD_ROOT/%{_libdir}/%{pname}_MMN <<-EOF +cat > %{buildroot}/%{_libdir}/%{pname}_MMN <<-EOF #!/bin/sh echo %{apache_mmn} EOF -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 +cp -p %{buildroot}/%{sysconfdir}/%{httpd}-%{default_mpm}.conf %{buildroot}/%{sysconfdir}/httpd.conf +cp -p %{buildroot}/%{sysconfdir}/httpd.conf ./httpd.conf.default +rm %{buildroot}/%{sysconfdir}/%{httpd}-*.conf # # create directories -mkdir -p $RPM_BUILD_ROOT/%{_var}/adm/fillup-templates \ - $RPM_BUILD_ROOT/%{proxycachedir} \ - $RPM_BUILD_ROOT/%{localstatedir} +mkdir -p %{buildroot}/%{_var}/adm/fillup-templates \ + %{buildroot}/%{proxycachedir} \ + %{buildroot}/%{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} +install -m 755 support/log_server_status %{buildroot}/%{_bindir}/log_server_status%{vers} +install -m 755 support/split-logfile %{buildroot}/%{_bindir}/split-logfile%{vers} +install -m 755 support/logresolve.pl %{buildroot}/%{_sbindir}/logresolve.pl%{vers} +mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d +install -m 644 $RPM_SOURCE_DIR/%{pname}.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/%{pname} +install -m 755 $RPM_SOURCE_DIR/apache2-check_forensic %{buildroot}/%{_bindir}/check_forensic%{vers} # # xml stuff -install -d $RPM_BUILD_ROOT%{_datadir}/omc/svcinfo.d/ -install -m 644 %{S:48} $RPM_BUILD_ROOT%{_datadir}/omc/svcinfo.d/ +install -d %{buildroot}%{_datadir}/omc/svcinfo.d/ +install -m 644 %{SOURCE48} %{buildroot}%{_datadir}/omc/svcinfo.d/ # # ssl stuff -install -m 755 %{S:25} $RPM_BUILD_ROOT/%{_bindir}/ -tar xjf %{SOURCE29} -C $RPM_BUILD_ROOT/%{sysconfdir} +install -m 755 %{SOURCE25} %{buildroot}/%{_bindir}/ +tar xjf %{SOURCE29} -C %{buildroot}/%{sysconfdir} # # init script and friends -mkdir -p $RPM_BUILD_ROOT/etc/init.d -install -m 744 $RPM_SOURCE_DIR/rc.%{pname} $RPM_BUILD_ROOT/etc/init.d/%{pname} -install -m 700 $RPM_SOURCE_DIR/start_apache2 $RPM_BUILD_ROOT/usr/sbin/start_apache2 +mkdir -p %{buildroot}%{_sysconfdir}/init.d +install -m 744 $RPM_SOURCE_DIR/rc.%{pname} %{buildroot}%{_initddir}/%{pname} +install -m 700 $RPM_SOURCE_DIR/start_apache2 %{buildroot}%{_sbindir}/start_apache2 %if 0%{?suse_version} >= 1210 -mkdir -p $RPM_BUILD_ROOT%{_unitdir}/system/ -install -m 700 $RPM_SOURCE_DIR/apache2-systemd-ask-pass $RPM_BUILD_ROOT/usr/sbin/apache2-systemd-ask-pass -install -m 644 $RPM_SOURCE_DIR/apache2.service $RPM_BUILD_ROOT%{_unitdir}/system/apache2.service +mkdir -p %{buildroot}%{_unitdir}/ +install -m 700 $RPM_SOURCE_DIR/apache2-systemd-ask-pass %{buildroot}%{_sbindir}/apache2-systemd-ask-pass +install -m 644 $RPM_SOURCE_DIR/apache2.service %{buildroot}%{_unitdir}/apache2.service %endif -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 -install -m 755 $RPM_SOURCE_DIR/sysconf_addword $RPM_BUILD_ROOT/%{_prefix}/share/%{pname}/ -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 +ln -sf ../..%{_initddir}/%{pname} %{buildroot}/%{_sbindir}/rc%{pname} +install -m 755 $RPM_SOURCE_DIR/load_configuration %{buildroot}/%{_datadir}/%{pname}/ +install -m 755 $RPM_SOURCE_DIR/find_mpm %{buildroot}/%{_datadir}/%{pname}/ +install -m 755 $RPM_SOURCE_DIR/get_includes %{buildroot}/%{_datadir}/%{pname}/ +install -m 755 $RPM_SOURCE_DIR/find_httpd2_includes %{buildroot}/%{_datadir}/%{pname}/ +install -m 755 $RPM_SOURCE_DIR/apache-20-22-upgrade %{buildroot}/%{_datadir}/%{pname}/ +sed 's+%{_prefix}/lib+%{_libdir}+' $RPM_SOURCE_DIR/get_module_list \ + > %{buildroot}/%{_datadir}/%{pname}/get_module_list +chmod 755 %{buildroot}/%{_datadir}/%{pname}/get_module_list +install -m 755 $RPM_SOURCE_DIR/sysconf_addword %{buildroot}/%{_datadir}/%{pname}/ +install -m 755 $RPM_SOURCE_DIR/a2enflag %{buildroot}/%{_sbindir} +ln -s a2enflag %{buildroot}/%{_sbindir}/a2disflag +install -m 755 $RPM_SOURCE_DIR/a2enmod %{buildroot}/%{_sbindir} +ln -s a2enmod %{buildroot}/%{_sbindir}/a2dismod # # directories for files from other packages and other configuration for i in vhosts.d sysconfig.d; do - mkdir -p $RPM_BUILD_ROOT/%{sysconfdir}/$i + mkdir -p %{buildroot}/%{sysconfdir}/$i done # # make list of all modules, and install sysconfig template -for i in $(find $RPM_BUILD_ROOT/%{libexecdir}-%{default_mpm} -name "*.so" | sort); do +for i in $(find %{buildroot}/%{libexecdir}-%{default_mpm} -name "*.so" | sort); do modname=${i#*mod_}; modname=${modname%.so} modname=${modname##*lib} all_modules="$all_modules $modname" done all_modules=$(echo $all_modules | fmt | sed 's/\(.*\)/# \1\\/') sed "s+@@all_modules@@+$all_modules +" $RPM_SOURCE_DIR/sysconfig.%{pname} \ - > $RPM_BUILD_ROOT/%{_var}/adm/fillup-templates/sysconfig.%{pname} + > %{buildroot}/%{_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 +mkdir -p %{buildroot}/%{runtimedir} +touch %{buildroot}/%{sysconfdir}/sysconfig.d/include.conf +mkdir -p %{buildroot}/%{sysconfdir}/conf.d for i in default-server.conf \ errors.conf \ httpd.conf \ @@ -657,38 +586,38 @@ for i in default-server.conf \ server-tuning.conf \ ssl-global.conf do - install -m 644 $RPM_SOURCE_DIR/apache2-$i $RPM_BUILD_ROOT/%{sysconfdir}/$i + install -m 644 $RPM_SOURCE_DIR/apache2-$i %{buildroot}/%{sysconfdir}/$i done -cat > $RPM_BUILD_ROOT/%{sysconfdir}/uid.conf <<-EOF - User %httpduser - Group %httpdgroup +cat > %{buildroot}/%{sysconfdir}/uid.conf <<-EOF + User %{httpduser} + Group %{httpdgroup} EOF # remove configuration for mpms which have not been built -mpm_confs="$(awk '/IfModule .*\.c/ {print $2}' $RPM_BUILD_ROOT/%{sysconfdir}/server-tuning.conf | cut -d. -f1 | tr '\n' ' ')" +mpm_confs="$(awk '/IfModule .*\.c/ {print $2}' %{buildroot}/%{sysconfdir}/server-tuning.conf | cut -d. -f1 | tr '\n' ' ')" for mpm_conf in $mpm_confs; do case "%{mpms_to_build}" in *$mpm_conf*) ;; - *) sed "/^# $mpm_conf/, /^$/ 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 + *) sed "/^# $mpm_conf/, /^$/ d" %{buildroot}/%{sysconfdir}/server-tuning.conf > t + #diff -u %{buildroot}/%{sysconfdir}/server-tuning.conf t ||: + mv t %{buildroot}/%{sysconfdir}/server-tuning.conf ;; esac done -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 -m 644 %{SOURCE130} %{buildroot}/%{sysconfdir}/vhosts.d/vhost.template +install -m 644 %{SOURCE131} %{buildroot}/%{sysconfdir}/vhosts.d/vhost-ssl.template +install -m 644 %{SOURCE104} %{buildroot}/%{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}-} +dvh=$(basename %{SOURCE132}) +install -m 644 %{SOURCE132} %{buildroot}/%{sysconfdir}/${dvh##%{name}-} +dvhs=$(basename %{SOURCE133}) +install -m 644 %{SOURCE133} %{buildroot}/%{sysconfdir}/${dvhs##%{name}-} # for mod_auth_ldap -install -m 644 docs/conf/charset.conv $RPM_BUILD_ROOT/%{sysconfdir}/ +install -m 644 docs/conf/charset.conv %{buildroot}/%{sysconfdir}/ 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 +cp -p $RPM_SOURCE_DIR/favicon.ico %{buildroot}/%{htdocsdir}/ +cat > %{buildroot}/%{htdocsdir}/robots.txt <<-EOF User-Agent: * Disallow: / EOF @@ -696,30 +625,30 @@ EOF # # use official mime.types (more complete) # -ln -sf ../mime.types $RPM_BUILD_ROOT/%{sysconfdir}/mime.types +ln -sf ../mime.types %{buildroot}/%{sysconfdir}/mime.types -mv $RPM_BUILD_ROOT/%{cgidir}/printenv* . -mv $RPM_BUILD_ROOT/%{cgidir}/test-cgi . -pushd $RPM_BUILD_ROOT/%{_mandir} +mv %{buildroot}/%{cgidir}/printenv* . +mv %{buildroot}/%{cgidir}/test-cgi . +pushd %{buildroot}/%{_mandir} for i in $(find . -type f); do mv $i ${i%.*}%{vers}.${i#*.*.} || true done popd -pushd $RPM_BUILD_ROOT/%{_bindir} -for i in ab dbmmanage htdbm htdigest htpasswd logresolve;do -mv $i ${i}%{vers} || true +pushd %{buildroot}/%{_bindir} +for i in ab dbmmanage htdbm htdigest htpasswd logresolve; do + mv $i ${i}%{vers} || true done popd -pushd $RPM_BUILD_ROOT/%{_sbindir} +pushd %{buildroot}/%{_sbindir} for i in rotatelogs suexec; do mv $i ${i}%{vers} || true done mv apachectl apachectl.tmp; mv apachectl.tmp apache%{vers}ctl popd # fix up apxs -pushd $RPM_BUILD_ROOT/%{_bindir} +pushd %{buildroot}/%{_bindir} for mpm in %{mpms_to_build}; do cat <<-EOT_ED | ed -s apxs H @@ -744,96 +673,71 @@ pushd $RPM_BUILD_ROOT/%{_bindir} mv apxs apxs%{vers} popd -# install firewall information file -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 +# install firewall information file +install -d %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/ +install -m 644 %{SOURCE49} %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%{name} +install -m 644 %{SOURCE50} %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%{name}-ssl ln -sf %{_bindir}/apxs%{vers} %{buildroot}%{_sbindir} # # filelists # >filelist; >filelist-devel -for mpm in %{mpms_to_build}; do +for mpm in %{mpms_to_build}; do echo %dir %{_libdir}/%{pname}-$mpm >> filelist ( - echo %dir %{includedir}-$mpm + echo %dir %{includedir}-$mpm echo %{_bindir}/apxs%{vers}-$mpm ) >> filelist-devel done -find $RPM_BUILD_ROOT/%{includedir}/.. -type f -o -type l \ - | sed "s#$RPM_BUILD_ROOT##" \ +find %{buildroot}/%{includedir}/.. -type f -o -type l \ + | sed "s#%{buildroot}##" \ >> filelist-devel -find $RPM_BUILD_ROOT/%{installbuilddir} -type f \ - | sed "s#$RPM_BUILD_ROOT##" \ +find %{buildroot}/%{installbuilddir} -type f \ + | sed "s#%{buildroot}##" \ >> filelist-devel # 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 +rm -f %{buildroot}/%{_libdir}/%{pname}-*/*.exp # needed only on AIX +rm -f %{buildroot}/%{_libdir}/%{pname}/*.exp # needed only on AIX +rm -f %{buildroot}/%{_sbindir}/checkgid # needed only for user installations from tarball +rm -r %{buildroot}/%{sysconfdir}/extra # it is already in the documentation directory +%check +# now check wether httpd binary runs properly +# and validate httpd.conf file # -# O/ _|_ _ __|_ -# /O |_(/__> |_ -# -# -# now check wether httpd binary runs properly -# and validate httpd.conf file -# -pushd $RPM_BUILD_ROOT/%{sysconfdir} +pushd %{buildroot}/%{sysconfdir} for i in *.conf; do cp $i $i.test; done -%if %{?suse_version:%suse_version}%{?!suse_version:9999} < 810 - echo -e "User %httpduser \nGroup nogroup" > 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 "User nobody \nGroup nobody" > 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}+' \ +sed -e 's+%{_libdir}+'%{buildroot}'%{_libdir}+' \ + -e 's+%{_localstatedir}/run+'%{buildroot}'%{_localstatedir}/run+' \ + -e 's+%{sysconfdir}+'%{buildroot}'%{sysconfdir}+' \ + -e 's+%{datadir}+'%{buildroot}'%{datadir}+' \ -e 's+\.conf$+&.test+' \ - -e 's+/var/log+'$RPM_BUILD_ROOT'/var/log+' \ + -e 's+%{_localstatedir}/log+'%{buildroot}'%{_localstatedir}/log+' \ httpd.conf > httpd.conf.test -sed -e 's+%{sysconfdir}+'$RPM_BUILD_ROOT'%{sysconfdir}+' \ +sed -e 's+%{sysconfdir}+'%{buildroot}'%{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 +pushd %{buildroot} for i in $(export LC_ALL=C; find .%{libexecdir}-%{default_mpm} -name "*.so" | 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 + echo LoadModule $mod_id %{buildroot}/${i#.} >> .%{sysconfdir}/sysconfig.d/loadmodule.conf.test done # auth_ldap_module needs to be loaded after ldap_module echo -e "/authnz_ldap\n+\n-m/ldap\nwq" | ed -s ./%{sysconfdir}/sysconfig.d/loadmodule.conf.test popd -%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 . +LD_LIBRARY_PATH=%{buildroot}%{_libdir} \ +%{buildroot}/%{_sbindir}/httpd%{vers}-%{default_mpm} \ + -e debug -t -f %{buildroot}/%{sysconfdir}/httpd.conf.test || exit 1 +rm %{buildroot}/%{sysconfdir}/*.test +rm %{buildroot}/%{sysconfdir}/sysconfig.d/* +mv %{buildroot}/%{sysconfdir}/original . %files -f filelist -# _ -# O/ _|_o| _ _ -# /O | ||(/__> -# %defattr(-,root,root) %doc INSTALL READM* LICENSE ABOUT_APACHE CHANGES %doc support/SHA1 @@ -849,8 +753,8 @@ mv $RPM_BUILD_ROOT/%{sysconfdir}/original . %doc httpd.conf.default %doc original %attr(750,root,root) %dir %{logfiledir} -%attr(750,%httpduser,root) %dir %{proxycachedir} -%attr(750,%httpduser,root) %dir %{localstatedir} +%attr(750,%{httpduser},root) %dir %{proxycachedir} +%attr(750,%{httpduser},root) %dir %{localstatedir} %dir %{sysconfdir} %config %{sysconfdir}/magic %config %{sysconfdir}/mime.types @@ -866,16 +770,13 @@ mv $RPM_BUILD_ROOT/%{sysconfdir}/original . %dir %{sysconfdir}/conf.d %dir %{sysconfdir}/vhosts.d %dir %{sysconfdir}/sysconfig.d -%config(noreplace) /etc/logrotate.d/%{pname} +%config(noreplace) %{_sysconfdir}/logrotate.d/%{pname} %{_datadir}/omc/svcinfo.d/apache2.xml -%if %{?suse_version:%suse_version}%{?!suse_version:9999} < 1000 -%config(noreplace) /etc/permissions.d/%{pname} -%endif -%config /etc/init.d/%{pname} +%{_initddir}/%{pname} %if 0%{?suse_version} >= 1210 -%{_unitdir}/system/%{pname}.service +%{_unitdir}/%{pname}.service +%{_sbindir}/apache2-systemd-ask-pass %endif -# %{_sbindir}/rc%{pname} %{_sbindir}/apache%{vers}ctl %{_sbindir}/envvars @@ -886,9 +787,6 @@ mv $RPM_BUILD_ROOT/%{sysconfdir}/original . %{_sbindir}/a2disflag %{_sbindir}/a2dismod %{_sbindir}/start_apache2 -%if 0%{?suse_version} >= 1210 -%{_sbindir}/apache2-systemd-ask-pass -%endif %{_bindir}/log_server_status%{vers} %{iconsdir} %{errordir} @@ -897,35 +795,34 @@ mv $RPM_BUILD_ROOT/%{sysconfdir}/original . %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 -%{_prefix}/share/%{pname}/sysconf_addword +%dir %{_datadir}/%{pname} +%{_datadir}/%{pname}/apache-20-22-upgrade +%{_datadir}/%{pname}/get_module_list +%{_datadir}/%{pname}/get_includes +%{_datadir}/%{pname}/find_httpd2_includes +%{_datadir}/%{pname}/find_mpm +%{_datadir}/%{pname}/load_configuration +%{_datadir}/%{pname}/sysconf_addword %config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%{name} %config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%{name}-ssl -%if %prefork - +%if %{prefork} %files prefork %defattr(-,root,root) %{_sbindir}/%{httpd}-prefork %dir %{_libdir}/%{pname}-prefork %{_libdir}/%{pname}-prefork/mod_*.so %endif -%if %worker +%if %{worker} %files worker %defattr(-,root,root) %{_sbindir}/%{httpd}-worker %dir %{_libdir}/%{pname}-worker %{_libdir}/%{pname}-worker/mod_*.so %endif -%if %event +%if %{event} %files event %defattr(-,root,root) %{_sbindir}/%{httpd}-event @@ -935,7 +832,7 @@ mv $RPM_BUILD_ROOT/%{sysconfdir}/original . %files devel -f filelist-devel %defattr(-,root,root) -%dir %{_prefix}/share/%{pname} +%dir %{_datadir}/%{pname} %dir %{installbuilddir} %dir %{includedir} %{_bindir}/apxs%{vers} @@ -979,41 +876,27 @@ mv $RPM_BUILD_ROOT/%{sysconfdir}/original . %{_sbindir}/logresolve.pl%{vers} %{_bindir}/logresolve%{vers} %{_sbindir}/rotatelogs%{vers} -%verify(not mode) %attr(0755,root,root) %_sbindir/suexec2 -%if %prefork +%verify(not mode) %attr(0755,root,root) %{_sbindir}/suexec2 +%if %{prefork} %post prefork -/usr/share/%{pname}/get_module_list >/dev/null 2>&1 +%{_datadir}/%{pname}/get_module_list >/dev/null 2>&1 exit 0 %endif -%if %worker +%if %{worker} %post worker -/usr/share/%{pname}/get_module_list >/dev/null 2>&1 +%{_datadir}/%{pname}/get_module_list >/dev/null 2>&1 exit 0 %endif -%if %event +%if %{event} %post event -/usr/share/%{pname}/get_module_list >/dev/null 2>&1 +%{_datadir}/%{pname}/get_module_list >/dev/null 2>&1 exit 0 %endif -# -# O/ ._ .__ / ._ _ __|_ -# /O |_)|(/_ / |_)(_)_> |_ -# | | -# - %pre -%if %{?suse_version:0}%{!?suse_version:1} -# on Fedora, add the "apache" user -if ! /usr/bin/getent passwd %httpduser >/dev/null 2>&1; then - echo "Creating %httpduser user" - /usr/sbin/useradd -c "Apache" -u 48 \ - -s /sbin/nologin -r -d %{localstatedir} %httpduser 2> /dev/null || : -fi -%endif %if 0%{?suse_version} >= 1210 %service_add_pre apache2.service %endif @@ -1033,36 +916,34 @@ exit 0 %if 0%{?suse_version} >= 1210 %service_del_postun apache2.service %endif -#if %suse_version > 810 -#restart_on_update %{pname} -#endif %insserv_cleanup %post %if 0%{?suse_version} <= 1130 %run_permissions %else -%set_permissions /usr/sbin/suexec2 +%set_permissions %{_sbindir}/suexec2 %endif -%if 0%{?suse_version} -# a group wwwadmin has existed in the distant past, and it was renamed to www -if grep -q "^wwwadmin:" /etc/group; then +# wwwadmin group existed in past remove after openSUSE-13.2 out of support scope +if grep -q "^wwwadmin:" %{_sysconfdir}/group; then groupmod -n www wwwadmin 2>/dev/null ||: - usermod -g %httpdgroup %httpduser 2>/dev/null ||: - usermod -s /bin/false %httpduser 2>/dev/null ||: + usermod -g %{httpdgroup} %{httpduser} 2>/dev/null ||: + usermod -s /bin/false %{httpduser} 2>/dev/null ||: 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 "^LOADMODULES" etc/sysconfig/%{pname}; then +if test -s etc/sysconfig/%{pname} && grep -q "^LOADMODULES" etc/sysconfig/%{pname}; then sed "s/LOADMODULES/APACHE_MODULES/" etc/sysconfig/%{pname} >| $tmpfile \ && cp $tmpfile etc/sysconfig/%{pname} fi +%if 0%{?suse_version} >= 1210 +%service_add_post apache2.service +%endif %{fillup_and_insserv apache2} # Update ? -if [ ${FIRST_ARG:-0} -gt 1 ]; then +if [ $1 -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 + 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/ @@ -1072,10 +953,10 @@ if [ ${FIRST_ARG:-0} -gt 1 ]; then # sed " # generated files were renamed from suse_* to sysconfig.d/* - s|\(^Include /etc/apache2\)/suse_\(\(include\|loadmodule\|global\).conf\)|\1/sysconfig.d/\2| + s|\(^Include %{_sysconfdir}/apache2\)/suse_\(\(include\|loadmodule\|global\).conf\)|\1/sysconfig.d/\2| # the access_log configuration is now configurable - s|^CustomLog /var/log/apache2/access_log.*|# &| + s|^CustomLog %{_localstatedir}/log/apache2/access_log.*|# &| # group of wwwrun has changed s|^Group nogroup|Group www| @@ -1087,19 +968,11 @@ if [ ${FIRST_ARG:-0} -gt 1 ]; then fi rm -rf $tmpdir -/usr/share/%{pname}/apache-20-22-upgrade -/usr/share/%{pname}/get_module_list >/dev/null 2>&1 -%if 0%{?suse_version} >= 1210 -%service_add_post apache2.service -%endif +%{_datadir}/%{pname}/apache-20-22-upgrade +%{_datadir}/%{pname}/get_module_list >/dev/null 2>&1 exit 0 %verifyscript %verify_permissions -e %{_sbindir}/suexec2 -%clean -if ! test -f /.buildenv; then - rm -rf $RPM_BUILD_ROOT -fi - %changelog