From 0e5585bd546cd625e983aeee0c0aaae25a22e812690fc2fa1bc1f285a67fe163 Mon Sep 17 00:00:00 2001 From: Christian Wittmer Date: Thu, 22 May 2014 12:50:35 +0000 Subject: [PATCH 1/2] Accepting request 234870 from home:jsegitz:branches:network - ensure proper handling of .service files with %service_add_pre OBS-URL: https://build.opensuse.org/request/show/234870 OBS-URL: https://build.opensuse.org/package/show/network/ddclient?expand=0&rev=33 --- ddclient.changes | 5 +++++ ddclient.spec | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ddclient.changes b/ddclient.changes index cea5829..e799497 100644 --- a/ddclient.changes +++ b/ddclient.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue May 20 14:29:35 UTC 2014 - jsegitz@novell.com + +- ensure proper handling of .service files with %service_add_pre + ------------------------------------------------------------------- Tue Dec 31 17:02:59 UTC 2013 - benoit.monin@gmx.fr diff --git a/ddclient.spec b/ddclient.spec index e8665ec..c2bd0a6 100644 --- a/ddclient.spec +++ b/ddclient.spec @@ -1,7 +1,7 @@ # # spec file for package ddclient # -# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -88,6 +88,11 @@ mv sample-* examples %{__install} -m 644 %{SOURCE2} %{buildroot}/var/adm/fillup-templates/sysconfig.%{name} %{__install} -d -m 755 %{buildroot}/var/cache/%{name} +%pre +%if 0%{?suse_version} >=1230 +%service_add_pre %{name}.service +%endif + %post %{fillup_only} %if 0%{?suse_version} >=1230 From 1cea4f58f87018640082099f1b5b6eba4e75e6fcaf0de8577ae324630a141071 Mon Sep 17 00:00:00 2001 From: Christian Wittmer Date: Thu, 22 May 2014 13:47:19 +0000 Subject: [PATCH 2/2] Accepting request 235113 from home:computersalat:devel:network update/fix systemd stuff OBS-URL: https://build.opensuse.org/request/show/235113 OBS-URL: https://build.opensuse.org/package/show/network/ddclient?expand=0&rev=34 --- ddclient.changes | 8 ++++++++ ddclient.spec | 40 +++++++++++++++++++--------------------- 2 files changed, 27 insertions(+), 21 deletions(-) diff --git a/ddclient.changes b/ddclient.changes index e799497..06aa28d 100644 --- a/ddclient.changes +++ b/ddclient.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Thu May 22 13:14:42 UTC 2014 - chris@computersalat.de + +- update systemd stuff + * add {?has_systemd} to fix build for Systems using init scripts +- spec cleanup + * add missing BuildRoot + ------------------------------------------------------------------- Tue May 20 14:29:35 UTC 2014 - jsegitz@novell.com diff --git a/ddclient.spec b/ddclient.spec index c2bd0a6..a4ad523 100644 --- a/ddclient.spec +++ b/ddclient.spec @@ -29,11 +29,17 @@ Source2: %{name}.sysconfig Source3: %{name}-tmpfiles.conf Source4: rc.%{name} Patch0: %{name}-3.8.1-config.patch -BuildRequires: pkgconfig(systemd) +BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch Requires(pre): %fillup_prereq -Requires: perl >= 5.004 + +%if 0%{?suse_version} >= 1230 +BuildRequires: pkgconfig(systemd) %{?systemd_requires} +%define has_systemd 1 +%endif + +Requires: perl >= 5.004 Recommends: perl-IO-Socket-SSL %description @@ -65,49 +71,41 @@ mv sample-* examples %install #make DESTDIR=$RPM_BUILD_ROOT install -%{__mkdir_p} %{buildroot}%{_sbindir} -%{__mkdir_p} %{buildroot}%{_sysconfdir} -%if 0%{?suse_version} >=1230 -%{__mkdir_p} %{buildroot}%{_unitdir} -%{__mkdir_p} %{buildroot}%{_libexecdir}/tmpfiles.d -%else -%{__mkdir_p} %{buildroot}%{_sysconfdir}/init.d -%endif -%{__install} -m 755 %{name} %{buildroot}%{_sbindir}/ -%{__install} -m 644 examples/sample-etc_ddclient.conf %{buildroot}%{_sysconfdir}/%{name}.conf +%{__install} -D -m 755 %{name} %{buildroot}%{_sbindir}/%{name} +%{__install} -D -m 644 examples/sample-etc_ddclient.conf %{buildroot}%{_sysconfdir}/%{name}.conf # init script and config file -%if 0%{?suse_version} >=1230 -%{__install} -m 644 %{SOURCE1} %{buildroot}/%{_unitdir}/%{name}.service -%{__install} -m 644 %{SOURCE3} %{buildroot}%{_libexecdir}/tmpfiles.d/%{name}.conf +%if 0%{?has_systemd} +%{__install} -D -m 644 %{SOURCE1} %{buildroot}/%{_unitdir}/%{name}.service +%{__install} -D -m 644 %{SOURCE3} %{buildroot}%{_libexecdir}/tmpfiles.d/%{name}.conf %{__ln_s} %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name} %else -%{__install} -m 755 %{SOURCE4} %{buildroot}%{_sysconfdir}/init.d/%{name} +%{__install} -D -m 755 %{SOURCE4} %{buildroot}%{_sysconfdir}/init.d/%{name} %{__ln_s} %{_sysconfdir}/init.d/%{name} %{buildroot}%{_sbindir}/rc%{name} %endif %{__install} -d -m 755 %{buildroot}/var/adm/fillup-templates %{__install} -m 644 %{SOURCE2} %{buildroot}/var/adm/fillup-templates/sysconfig.%{name} %{__install} -d -m 755 %{buildroot}/var/cache/%{name} +%if 0%{?has_systemd} %pre -%if 0%{?suse_version} >=1230 %service_add_pre %{name}.service %endif %post %{fillup_only} -%if 0%{?suse_version} >=1230 +%if 0%{?has_systemd} %service_add_post %{name}.service %endif %preun -%if 0%{?suse_version} >=1230 +%if 0%{?has_systemd} %service_del_preun %{name}.service %else %stop_on_removal ddclient %endif %postun -%if 0%{?suse_version} >=1230 +%if 0%{?has_systemd} %service_del_postun %{name}.service %else %restart_on_update ddclient @@ -118,7 +116,7 @@ mv sample-* examples %defattr(-, root, root) %doc COPY* README* examples %config(noreplace) %attr(600,root,root) %{_sysconfdir}/%{name}.conf -%if 0%{?suse_version} >=1230 +%if 0%{?has_systemd} %{_unitdir}/%{name}.service %{_libexecdir}/tmpfiles.d/ddclient.conf %else