From 6902ce257c25b3ca9175487fc96817ba51f170b79bda8f04d13a6b6d2ce0f7dd Mon Sep 17 00:00:00 2001 From: Stanislav Brabec Date: Tue, 13 Oct 2015 17:33:57 +0000 Subject: [PATCH] Accepting request 337023 from home:darix:branches:network - no longer install the init script on systemd systems OBS-URL: https://build.opensuse.org/request/show/337023 OBS-URL: https://build.opensuse.org/package/show/network/keepalived?expand=0&rev=18 --- keepalived.changes | 5 +++++ keepalived.spec | 33 +++++++++++++++++++-------------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/keepalived.changes b/keepalived.changes index 3fd88ab..9762a5c 100644 --- a/keepalived.changes +++ b/keepalived.changes @@ -26,6 +26,11 @@ Wed Oct 7 11:45:41 UTC 2015 - dimstar@opensuse.org gethostbyname function buffer overflow (boo#949238). + Lots of ipvs fixes. +------------------------------------------------------------------- +Wed Oct 7 10:31:50 UTC 2015 - mrueckert@suse.de + +- no longer install the init script on systemd systems + ------------------------------------------------------------------- Wed Mar 11 13:21:29 UTC 2015 - dimstar@opensuse.org diff --git a/keepalived.spec b/keepalived.spec index dc55605..8455765 100644 --- a/keepalived.spec +++ b/keepalived.spec @@ -17,7 +17,9 @@ %if 0%{?suse_version} > 1210 -%define has_systemd 1 +%bcond_without systemd +%else +%bcond_with systemd %endif Name: keepalived @@ -42,7 +44,7 @@ BuildRequires: cyrus-sasl-devel Requires(pre): pwdutils Requires(pre): %insserv_prereq Requires(pre): %fillup_prereq -%if 0%{?has_systemd} +%if %{with systemd} BuildRequires: systemd Requires: systemd %endif @@ -75,40 +77,42 @@ make %{?_smp_mflags} %install make install DESTDIR="%{buildroot}" install -dD -m 0750 %{buildroot}%{_var}/lib/%{name} -install -D -m 0750 keepalived/etc/init.d/keepalived.suse.init %{buildroot}/etc/init.d/keepalived -install -D -m 0644 %{buildroot}/etc/sysconfig/keepalived %{buildroot}/var/adm/fillup-templates/sysconfig.%{name} -%if 0%{?has_systemd} +install -D -m 0644 %{buildroot}/etc/sysconfig/keepalived %{buildroot}/var/adm/fillup-templates/sysconfig.%{name} + +%if %{with systemd} install -D -m0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service +ln -s /sbin/service %{buildroot}%{_sbindir}/rckeepalived +%else +install -D -m 0750 keepalived/etc/init.d/keepalived.suse.init %{buildroot}/etc/init.d/keepalived +ln -s /etc/init.d/keepalived %{buildroot}%{_sbindir}/rckeepalived %endif -rm %{buildroot}/etc/rc.d/init.d/keepalived %{buildroot}/etc/sysconfig/keepalived -ln -s /etc/init.d/keepalived %{buildroot}%{_sbindir}/rckeepalived chmod -R o= %{buildroot}/etc/keepalived -rm -rv %{buildroot}/etc/keepalived/samples/ +rm -rv %{buildroot}/etc/rc.d/init.d/keepalived %{buildroot}/etc/keepalived/samples/ %{buildroot}/etc/sysconfig/keepalived %pre /usr/sbin/groupadd -r %{name} >/dev/null 2>&1 || : /usr/sbin/useradd -g %{name} -s /bin/false -r -c "Keepalived" -d %{_var}/lib/%{name} %{name} >/dev/null 2>&1 || : -%if 0%{?has_systemd} +%if %{with systemd} %service_add_pre %{name}.service %{name}.socket %endif %preun %stop_on_removal %{name} -%if 0%{?has_systemd} +%if %{with systemd} %service_del_preun %{name}.service %{name}.socket %endif %post %fillup_only %{name} -%if 0%{?has_systemd} +%if %{with systemd} %service_add_post %{name}.service %{name}.socket %endif %postun %insserv_cleanup %restart_on_update %{name} -%if 0%{?has_systemd} +%if %{with systemd} %service_del_postun %{name}.service %{name}.socket %endif @@ -116,15 +120,16 @@ rm -rv %{buildroot}/etc/keepalived/samples/ %defattr(-,root,root) %doc README COPYING %config(noreplace) %attr(-,root,keepalived) /etc/keepalived/ -/etc/init.d/keepalived %{_bindir}/genhash %{_sbindir}/rckeepalived %{_sbindir}/keepalived %{_mandir}/man1/genhash.1.gz %{_mandir}/man5/keepalived.conf.5.gz %{_mandir}/man8/keepalived.8.gz -%if 0%{?has_systemd} +%if %{with systemd} %{_unitdir}/%name.service +%else +/etc/init.d/keepalived %endif %dir %attr(-,keepalived,keepalived) %{_var}/lib/%{name} /var/adm/fillup-templates/sysconfig.%{name}