- Cleanup init/unit decision making and provide just systemd service

on systemd systems

OBS-URL: https://build.opensuse.org/package/show/Apache/apache2?expand=0&rev=435
This commit is contained in:
Tomáš Chvátal 2015-02-25 15:59:55 +00:00 committed by Git OBS Bridge
parent 75383b5f81
commit 8b05757aa0
2 changed files with 18 additions and 6 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Feb 25 15:59:26 UTC 2015 - tchvatal@suse.com
- Cleanup init/unit decision making and provide just systemd service
on systemd systems
-------------------------------------------------------------------
Wed Feb 25 13:53:16 UTC 2015 - tchvatal@suse.com

View File

@ -529,15 +529,17 @@ install -m 755 %{SOURCE25} %{buildroot}/%{_bindir}/
tar xjf %{SOURCE29} -C %{buildroot}/%{sysconfdir}
#
# init script and friends
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 %{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 service %{buildroot}/%{_sbindir}/rc%{pname}
%else
mkdir -p %{buildroot}%{_sysconfdir}/init.d
install -m 744 $RPM_SOURCE_DIR/rc.%{pname} %{buildroot}%{_initddir}/%{pname}
ln -sf ../..%{_initddir}/%{pname} %{buildroot}/%{_sbindir}/rc%{pname}
%endif
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}/
@ -771,10 +773,11 @@ mv %{buildroot}/%{sysconfdir}/original .
%dir %{sysconfdir}/sysconfig.d
%config(noreplace) %{_sysconfdir}/logrotate.d/%{pname}
%{_datadir}/omc/svcinfo.d/apache2.xml
%{_initddir}/%{pname}
%if 0%{?suse_version} >= 1210
%{_unitdir}/%{pname}.service
%{_sbindir}/apache2-systemd-ask-pass
%else
%{_initddir}/%{pname}
%endif
%{_sbindir}/rc%{pname}
%{_sbindir}/apache%{vers}ctl
@ -1244,8 +1247,9 @@ exit 0
%postun
%if 0%{?suse_version} >= 1210
%service_del_postun apache2.service
%endif
%else
%insserv_cleanup
%endif
%post
%if 0%{?suse_version} <= 1130
@ -1265,10 +1269,12 @@ if test -s etc/sysconfig/%{pname} && grep -q "^LOADMODULES" etc/sysconfig/%{pnam
sed "s/LOADMODULES/APACHE_MODULES/" etc/sysconfig/%{pname} >| $tmpfile \
&& cp $tmpfile etc/sysconfig/%{pname}
fi
%{fillup_only apache2}
%if 0%{?suse_version} >= 1210
%service_add_post apache2.service
%endif
%else
%{fillup_and_insserv apache2}
%endif
# Update ?
if [ $1 -gt 1 ]; then
# update from package with the old near-monolithic conf file?