diff --git a/apache2.changes b/apache2.changes index a05f913..29c01a2 100644 --- a/apache2.changes +++ b/apache2.changes @@ -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 diff --git a/apache2.spec b/apache2.spec index ca797a4..ab9e97d 100644 --- a/apache2.spec +++ b/apache2.spec @@ -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?