From a6a4466a0842d57bcec93becd44af943384ec1e1d5f45585e8f4b999f80b99f8 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Fri, 16 Aug 2019 16:16:24 +0000 Subject: [PATCH] - Add missing %service_* scriptlets OBS-URL: https://build.opensuse.org/package/show/filesharing/rtorrent?expand=0&rev=3 --- rtorrent.changes | 5 +++++ rtorrent.spec | 22 ++++++++++++++-------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/rtorrent.changes b/rtorrent.changes index 82ddfab..c3a5ceb 100644 --- a/rtorrent.changes +++ b/rtorrent.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Aug 16 15:54:27 UTC 2019 - Jan Engelhardt + +- Add missing %service_* scriptlets + ------------------------------------------------------------------- Wed Jul 24 17:52:33 UTC 2019 - hiwatari.seiji@gmail.com diff --git a/rtorrent.spec b/rtorrent.spec index 063f2c4..bcfb7dd 100644 --- a/rtorrent.spec +++ b/rtorrent.spec @@ -28,12 +28,11 @@ License: SUSE-GPL-2.0+-with-openssl-exception Group: Productivity/Networking/File-Sharing Url: http://github.com/rakshasa/rtorrent -Source: https://github.com/rakshasa/rtorrent/releases/download/v%{version}/%{name}-%{version}.tar.gz +Source: https://github.com/rakshasa/rtorrent/releases/download/v%version/%name-%version.tar.gz Source2: rtorrent.desktop # This manpage copied from the 0.9.2 tarball as it was missing in later versions Source3: rtorrent.1 Source4: rtorrent.service -BuildRoot: %{_tmppath}/%{name}-%{version}-build %if %{with xmlrpc} BuildRequires: xmlrpc-c-devel %endif @@ -74,27 +73,34 @@ autoreconf -fiv --enable-ipv6 make %{?_smp_mflags} -%pre -getent passwd rtorrent >/dev/null || useradd -r rtorrent - %install b="%buildroot" -make install DESTDIR="$b" +%make_install install -Dm0644 "%{S:2}" "$b/%_datadir/applications/%name.desktop" mkdir -p "$b/%_mandir/man1" install -pm0644 "%{S:3}" "$b/%_mandir/man1/" %suse_update_desktop_file -r "%name" Network P2P -install -Dm0644 "%{S:4}" "$b/%{_unitdir}/rtorrent.service" +install -Dm0644 "%{S:4}" "$b/%_unitdir/rtorrent.service" + +%pre +getent passwd rtorrent >/dev/null || useradd -r rtorrent +%service_add_pre rtorrent.service %post %service_add_post rtorrent.service +%preun +%service_del_preun rtorrent.service + +%postun +%service_del_postun rtorrent.service + %files %defattr(-,root,root) %doc doc/rtorrent.rc COPYING %_bindir/rtorrent %_datadir/applications/%name.desktop %_mandir/man1/rtorrent.1* -%{_unitdir}/rtorrent.service +%_unitdir/rtorrent.service %changelog