From 5153d62b2d2b6dffd6dbdb21363d857bf1c9c2ba3afff03ae96e029970adda91 Mon Sep 17 00:00:00 2001 From: OBS User buildservice-autocommit Date: Tue, 6 Dec 2011 17:34:39 +0000 Subject: [PATCH 1/2] Updating link to change in openSUSE:Factory/openslp revision 28.0 OBS-URL: https://build.opensuse.org/package/show/network:utilities/openslp?expand=0&rev=717c65545e43864a5e1a2fe1686ba25c --- openslp.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openslp.spec b/openslp.spec index afed8c0..408ba4b 100644 --- a/openslp.spec +++ b/openslp.spec @@ -22,7 +22,7 @@ BuildRequires: bison flex libtool openssl-devel Summary: An OpenSLP Implementation of Service Location Protocol V2 Version: 1.2.0 Release: 186 -License: BSD3c +License: BSD-3-Clause Group: System/Daemons Url: http://www.openslp.org/ # bug437293 @@ -87,7 +87,7 @@ Authors: Praveen Kumar Amritaluru %package server -License: BSD3c +License: BSD-3-Clause Group: System/Daemons Summary: The OpenSLP Implementation of the Service Location Protocol V2 PreReq: %fillup_prereq %insserv_prereq /usr/sbin/useradd @@ -115,7 +115,7 @@ Authors: Praveen Kumar Amritaluru %package devel -License: BSD3c +License: BSD-3-Clause Requires: openssl-devel openslp = %version Group: System/Daemons Summary: OpenSLP Development SDK From 759447bc350501681d774466e1d4c7a2d99588be6379bfdb9a72afde2c82be08 Mon Sep 17 00:00:00 2001 From: Andreas Stieger Date: Fri, 23 Dec 2011 22:23:29 +0000 Subject: [PATCH 2/2] Accepting request 98001 from home:elvigia:branches:network:utilities - Add native systemd unit OBS-URL: https://build.opensuse.org/request/show/98001 OBS-URL: https://build.opensuse.org/package/show/network:utilities/openslp?expand=0&rev=14 --- openslp.changes | 5 +++++ openslp.spec | 25 ++++++++++++++++++++++++- slpd.service | 9 +++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 slpd.service diff --git a/openslp.changes b/openslp.changes index 5b4ade0..c193c7e 100644 --- a/openslp.changes +++ b/openslp.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Dec 22 23:42:12 UTC 2011 - crrodriguez@opensuse.org + +- Add native systemd unit + ------------------------------------------------------------------- Wed Nov 16 08:19:02 UTC 2011 - coolo@suse.com diff --git a/openslp.spec b/openslp.spec index 408ba4b..d45a630 100644 --- a/openslp.spec +++ b/openslp.spec @@ -19,6 +19,11 @@ Name: openslp BuildRequires: bison flex libtool openssl-devel +%if 0%{?suse_version} > 1140 +BuildRequires: systemd +%{?systemd_requires} +%define has_systemd 1 +%endif Summary: An OpenSLP Implementation of Service Location Protocol V2 Version: 1.2.0 Release: 186 @@ -40,6 +45,7 @@ Source5: openslp.logrotate Source6: slpd.xml Source7: openslp.SuSEfirewall2 Source8: baselibs.conf +Source9: slpd.service Patch1: openslp.diff Patch2: openslp.audit.diff Patch3: extensions.diff @@ -225,7 +231,9 @@ install -m 0644 %SOURCE6 $RPM_BUILD_ROOT/usr/share/omc/svcinfo.d install -D -m 644 %{S:7} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/openslp %endif -nm -C -D %{buildroot}%_libdir/libslp.so +%if 0%{?has_systemd} +install -D -m 644 %{S:9} %{buildroot}%{_unitdir}/slpd.service +%endif %post -p /sbin/ldconfig @@ -233,6 +241,9 @@ nm -C -D %{buildroot}%_libdir/libslp.so %pre server /usr/sbin/useradd -r -g daemon -d /var/lib/empty -s /sbin/nologin -c "openslp daemon" openslp 2>/dev/null || : +%if 0%{?has_systemd} +%service_add_pre slpd.service +%endif %post server %if 0%{?sles_version} == 9 || 0%{?sles_version} == 10 @@ -240,13 +251,22 @@ nm -C -D %{buildroot}%_libdir/libslp.so %else %{fillup_and_insserv slpd} %endif +%if 0%{?has_systemd} +%service_add_post slpd.service +%endif %postun server %restart_on_update slpd %insserv_cleanup +%if 0%{?has_systemd} +%service_del_postun slpd.service +%endif %preun server %stop_on_removal slpd +%if 0%{?has_systemd} +%service_del_preun slpd.service +%endif %clean rm -rf $RPM_BUILD_ROOT @@ -287,6 +307,9 @@ rm -rf $RPM_BUILD_ROOT %if 0%{?suse_version} > 0 %config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/openslp %endif +%if 0%{?has_systemd} +%{_unitdir}/slpd.service +%endif %files devel %defattr(-,root,root) diff --git a/slpd.service b/slpd.service new file mode 100644 index 0000000..03a29ea --- /dev/null +++ b/slpd.service @@ -0,0 +1,9 @@ +[Unit] +Description=OpenSLP daemon for the Service Location Protocol +After=network.target nss-lookup.target + +[Service] +ExecStart=/usr/sbin/slpd -d +ExecReload=/bin/kill -HUP $MAINPID +[Install] +WantedBy=multi-user.target \ No newline at end of file