diff --git a/Makefile b/Makefile index 262cabffbcd564347a158f53a48a6d773d90491d..7de1655bd9c079bb8ea22544d1d29585d984f466 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,9 @@ install: mkdir -p $(DESTDIR)$(SYSCONFDIR)/dbus-1/system.d mkdir -p $(DESTDIR)$(DATADIR)/polkit-1/actions mkdir -p $(DESTDIR)$(PKGDIR) + mkdir -p $(DESTDIR)/usr/lib/systemd/system install -m644 dbus/$(ORG_NAME).service $(DESTDIR)$(DATADIR)/dbus-1/system-services/. + install -m644 dbus/dnfdaemon.service $(DESTDIR)/usr/lib/systemd/system/. install -m644 dbus/$(ORG_RO_NAME).service $(DESTDIR)$(DATADIR)/dbus-1/services/. install -m644 dbus/$(ORG_NAME).conf $(DESTDIR)$(SYSCONFDIR)/dbus-1/system.d/. install -m644 policykit1/$(ORG_NAME).policy $(DESTDIR)$(DATADIR)/polkit-1/actions/. diff --git a/dbus/dnfdaemon.service b/dbus/dnfdaemon.service new file mode 100644 index 0000000000000000000000000000000000000000..3aca80e60f27445b442540ead3dc5d94ecaac3de --- /dev/null +++ b/dbus/dnfdaemon.service @@ -0,0 +1,8 @@ +[Unit] +Description=Package management dnf daemon + +[Service] +Type=dbus +BusName=org.baseurl.DnfSystem +User=root +ExecStart=/usr/share/dnfdaemon/dnfdaemon-system diff --git a/dbus/org.baseurl.DnfSystem.service b/dbus/org.baseurl.DnfSystem.service index da910db292ce57aca4260b49ea815fe642dd58f3..23ab6db3be2542fcb5daf2e263fa2fff5fb4f1be 100644 --- a/dbus/org.baseurl.DnfSystem.service +++ b/dbus/org.baseurl.DnfSystem.service @@ -2,3 +2,4 @@ Name=org.baseurl.DnfSystem Exec=/usr/share/dnfdaemon/dnfdaemon-system User=root +SystemdService=dnfdaemon.service diff --git a/dnfdaemon.spec b/dnfdaemon.spec index fb95b81bf67c06d67d2788c3cac291e682b43e3b..86f8351e38ba450108d5b29aeba9dc329af6a8a8 100644 --- a/dnfdaemon.spec +++ b/dnfdaemon.spec @@ -3,7 +3,7 @@ Name: dnfdaemon Version: 0.3.11 -Release: 1%{?dist} +Release: 2%{?dist} Summary: DBus daemon for dnf package actions License: GPLv2+ URL: https://github.com/timlau/dnf-daemon @@ -11,6 +11,7 @@ Source0: https://github.com/timlau/dnf-daemon/releases/download/%{name}-% BuildArch: noarch BuildRequires: python3-devel +BuildRequires: systemd Requires: python3-gobject Requires: python3-dbus Requires: python3-dnf >= %{dnf_version} @@ -24,6 +25,10 @@ Requires(post): policycoreutils-python Requires(postun): policycoreutils-python %endif +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd + %description Dbus daemon for performing package actions with the dnf package manager @@ -62,17 +67,23 @@ Python 2 api for communicating with the dnf-daemon DBus service %post semanage fcontext -a -t rpm_exec_t '%{_datadir}/%{name}/%{name}-system' 2>/dev/null || : restorecon -R %{_datadir}/%{name}/%{name}-system || : +%systemd_post %{name}.service %postun if [ $1 -eq 0 ] ; then # final removal semanage fcontext -d -t rpm_exec_t '%{_datadir}/%{name}/%{name}-system' 2>/dev/null || : fi +%systemd_postun %{name}.service + +%preun +%systemd_preun %{name}.service %files %doc README.md ChangeLog COPYING %{_datadir}/dbus-1/system-services/%{dnf_org}* %{_datadir}/dbus-1/services/%{dnf_org}* %{_datadir}/%{name}/ +%{_unitdir}/%{name}.service %{_datadir}/polkit-1/actions/%{dnf_org}* # this should not be edited by the user, so no %%config %{_sysconfdir}/dbus-1/system.d/%{dnf_org}* @@ -88,7 +99,10 @@ fi %{python3_sitelib}/%{name}/client %changelog -* Wed Nov 18 2015 Tim Lauridsen <timlau@fedoraproject.org> 0.3.11 +* Sat Nov 28 2015 Tim Lauridsen <timlau@fedoraproject.org> 0.3.11-2 +- added systemd service + +* Wed Nov 18 2015 Tim Lauridsen <timlau@fedoraproject.org> 0.3.11-1 - bumped release * Wed Sep 30 2015 Tim Lauridsen <timlau@fedoraproject.org> 0.3.10-2