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
This commit is contained in:
Andreas Stieger 2011-12-23 22:23:29 +00:00 committed by Git OBS Bridge
parent 5153d62b2d
commit 759447bc35
3 changed files with 38 additions and 1 deletions

View File

@ -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

View File

@ -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)

9
slpd.service Normal file
View File

@ -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