Accepting request 85408 from Apache

- Fix systemd files packaging, %ghost is not a good idea.
- Use systemd rpm macros for openSUSE 12.1 and later. (forwarded request 85398 from fcrozat)

OBS-URL: https://build.opensuse.org/request/show/85408
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/apache2?expand=0&rev=52
This commit is contained in:
Lars Vogdt 2011-10-02 07:47:51 +00:00 committed by Git OBS Bridge
commit 20d1030bba
2 changed files with 36 additions and 4 deletions

View File

@ -1,3 +1,14 @@
-------------------------------------------------------------------
Tue Sep 27 08:19:35 UTC 2011 - fcrozat@suse.com
- Fix systemd files packaging, %ghost is not a good idea.
- Use systemd rpm macros for openSUSE 12.1 and later.
-------------------------------------------------------------------
Thu Sep 15 13:33:30 CEST 2011 - draht@suse.de
- don't create $RPM_BUILD_ROOT/etc/init.d twice in %install.
-------------------------------------------------------------------
Wed Sep 14 01:11:55 CEST 2011 - draht@suse.de

View File

@ -26,6 +26,10 @@ BuildRequires: libcap
%else
BuildRequires: libcap-devel
%endif
%if 0%{?suse_version} >= 1210
BuildRequires: systemd
%endif
%if %{?suse_version:1}0
%define httpduser wwwrun
%define httpdgroup www
@ -145,6 +149,7 @@ Requires: logrotate
# see https://bugzilla.redhat.com/show_bug.cgi?id=516331
Requires: libapr1 >= 1.4.2
Requires: libapr1 < 2.0
%{?systemd_requires}
PreReq: fileutils textutils grep sed
%if %{?suse_version:1}0
PreReq: %insserv_prereq %fillup_prereq permissions pwdutils
@ -600,11 +605,13 @@ tar xjf %{SOURCE29} -C $RPM_BUILD_ROOT/%{sysconfdir}
#
# init script and friends
mkdir -p $RPM_BUILD_ROOT/etc/init.d
mkdir -p $RPM_BUILD_ROOT/etc/init.d $RPM_BUILD_ROOT/lib/systemd/system/
install -m 744 $RPM_SOURCE_DIR/rc.%{pname} $RPM_BUILD_ROOT/etc/init.d/%{pname}
install -m 744 $RPM_SOURCE_DIR/start_apache2 $RPM_BUILD_ROOT/usr/sbin/start_apache2
%if 0%{?suse_version} >= 1210
mkdir -p $RPM_BUILD_ROOT/lib/systemd/system/
install -m 744 $RPM_SOURCE_DIR/apache2-systemd-ask-pass $RPM_BUILD_ROOT/usr/sbin/apache2-systemd-ask-pass
install -m 744 $RPM_SOURCE_DIR/apache2.service $RPM_BUILD_ROOT/lib/systemd/system/apache2.service
install -m 644 $RPM_SOURCE_DIR/apache2.service $RPM_BUILD_ROOT/lib/systemd/system/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}/
@ -862,7 +869,9 @@ mv $RPM_BUILD_ROOT/%{sysconfdir}/original .
%config(noreplace) /etc/permissions.d/%{pname}
%endif
%config /etc/init.d/%{pname}
%if 0%{?suse_version} >= 1210
/lib/systemd/system/%{pname}.service
%endif
#
%{_sbindir}/rc%{pname}
%{_sbindir}/apache%{vers}ctl
@ -874,7 +883,9 @@ 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}
@ -893,8 +904,6 @@ mv $RPM_BUILD_ROOT/%{sysconfdir}/original .
%{_prefix}/share/%{pname}/sysconf_addword
%config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%{name}
%config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%{name}-ssl
%ghost /lib/systemd
%ghost /lib/systemd/system
%if %prefork
@ -1012,9 +1021,15 @@ if ! /usr/bin/getent passwd %httpduser &>/dev/null; then
/usr/sbin/useradd -c "Apache" -u 48 \
-s /sbin/nologin -r -d %{localstatedir} %httpduser 2> /dev/null || :
fi
%if 0%{?suse_version} >= 1210
%service_add_pre apache2.service
%endif
%endif
%preun
%if 0%{?suse_version} >= 1210
%service_del_preun apache2.service
%endif
for i in %{_sbindir}/%{httpd} \
%{installbuilddir}/config_vars.mk
do
@ -1023,6 +1038,9 @@ done
exit 0
%postun
%if 0%{?suse_version} >= 1210
%service_del_postun apache2.service
%endif
#if %suse_version > 810
#restart_on_update %{pname}
#endif
@ -1075,6 +1093,9 @@ fi
rm -rf $tmpdir
/usr/share/%{pname}/apache-20-22-upgrade
/usr/share/%{pname}/get_module_list &>/dev/null
%if 0%{?suse_version} >= 1210
%service_add_post apache2.service
%endif
exit 0
%verifyscript