diff --git a/openslp.service b/openslp.service new file mode 100644 index 0000000..21a9e91 --- /dev/null +++ b/openslp.service @@ -0,0 +1,11 @@ +[Unit] +Description=Service Location Protocol +After=network.target + +[Service] +Type=forking +ExecStart=/usr/sbin/slpd -c /etc/slp/slp.conf -r /etc/slp/slp.reg -s /etc/slp/slp.spi +ExecReload=/bin/kill -HUP $MAINPID + +[Install] +WantedBy=network.target diff --git a/openslp.spec b/openslp.spec index 7fb854d..c9e2894 100644 --- a/openslp.spec +++ b/openslp.spec @@ -1,6 +1,6 @@ Name: openslp Version: 2.0.0 -Release: 2mamba +Release: 3mamba Summary: An open-source implementation of Service Location Protocol Group: System/Servers Vendor: openmamba @@ -8,13 +8,13 @@ Distribution: openmamba Packager: Silvan Calarco URL: http://www.openslp.org Source: http://downloads.sourceforge.net/sourceforge/openslp/%{name}-%{version}.tar.gz +Source1: openslp.service Patch0: %{name}-1.2.1-optflags.patch Patch1: %{name}-1.2.1-export_slp_net_symbols Patch2: openslp-2.0.0-openssl-1.1.patch License: BSD ## AUTOBUILDREQ-BEGIN BuildRequires: glibc-devel -BuildRequires: ldconfig BuildRequires: libe2fs-devel BuildRequires: libkrb5-devel BuildRequires: libnsl-devel @@ -26,7 +26,6 @@ BuildRequires: flex BuildRequires: bison BuildRequires: libtool Requires: libopenslp = %{?epoch:%epoch:}%{version}-%{release} -BuildRoot: %{_tmppath}/%{name}-%{version}-root %description Service Location Protocol is an IETF standards track protocol that provides a framework to allow networking applications to discover the existence, location, and configuration of networked services in enterprise networks. @@ -53,7 +52,7 @@ This package contains static libraries and header files needed for development. %prep %setup -q -%patch2 -p1 +%patch 2 -p1 %build %configure \ @@ -73,8 +72,7 @@ This package contains static libraries and header files needed for development. [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" %makeinstall -install -D -m 755 etc/slpd.all_init \ - %{buildroot}%{_initrddir}/slpd +install -D -m0644 %{SOURCE1} %{buildroot}%{_unitdir}/openslp.service #rm -rf rpmdoc #mv %{buildroot}%{_prefix}/doc/%{name}-%{version} rpmdoc @@ -83,16 +81,29 @@ install -D -m 755 etc/slpd.all_init \ %clean [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +%post +%systemd_post openslp +: + +%preun +%systemd_preun openslp +: + +%postun +%systemd_postun openslp +: + %post -n libopenslp -p /sbin/ldconfig %postun -n libopenslp -p /sbin/ldconfig %files %defattr(-,root,root) -%config(noreplace) %{_initrddir}/slpd +#%config(noreplace) %{_initrddir}/slpd %dir %{_sysconfdir}/slp %config(noreplace) %{_sysconfdir}/slp/slp.conf %config(noreplace) %{_sysconfdir}/slp/slp.reg %config(noreplace) %{_sysconfdir}/slp/slp.spi +%{_unitdir}/openslp.service %{_bindir}/slptool %{_sbindir}/slpd @@ -104,13 +115,15 @@ install -D -m 755 etc/slpd.all_init \ %files -n libopenslp-devel %defattr(-,root,root) %{_libdir}/libslp.a -%{_libdir}/libslp.la %{_libdir}/libslp.so %{_includedir}/*.h %doc ChangeLog FAQ NEWS README THANKS #%doc rpmdoc/* %changelog +* Sat Apr 22 2023 Silvan Calarco 2.0.0-3mamba +- port from sysv5 to systemd + * Sun Dec 06 2020 Silvan Calarco 2.0.0-2mamba - added debug package, openssl 1.1 patch