From b51da05dd4809cacb07af78072b291d0a4174053 Mon Sep 17 00:00:00 2001 From: David King Date: Thu, 2 Jul 2015 13:57:47 +0100 Subject: [PATCH 1/2] Fix systemd service file (#1238664) --- udisks-1.0.5-fix-service-file.patch | 29 +++++++++++++++++++++++++++++ udisks.spec | 13 ++++++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 udisks-1.0.5-fix-service-file.patch diff --git a/udisks-1.0.5-fix-service-file.patch b/udisks-1.0.5-fix-service-file.patch new file mode 100644 index 0000000..9b3a999 --- /dev/null +++ b/udisks-1.0.5-fix-service-file.patch @@ -0,0 +1,29 @@ +From 7d61ad048856ee239870b917d6933e3ad63f0789 Mon Sep 17 00:00:00 2001 +From: David King +Date: Thu, 2 Jul 2015 13:49:22 +0100 +Subject: [PATCH] Fix systemd service file + +udisks-daemon is installed to $(libexecdir), not $(prefix)/lib/udisks. + +https://bugzilla.redhat.com/show_bug.cgi?id=1238664 +https://bugs.freedesktop.org/show_bug.cgi?id=91191 +--- + data/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/data/Makefile.am b/data/Makefile.am +index 411ea0f..08af5f4 100644 +--- a/data/Makefile.am ++++ b/data/Makefile.am +@@ -31,7 +31,7 @@ systemdservicedir = $(systemdsystemunitdir) + systemdservice_DATA = $(systemdservice_in_files:.service.in=.service) + + $(systemdservice_DATA): $(systemdservice_in_files) Makefile +- @sed -e "s|\@libexecdir\@|$(prefix)/lib/udisks|" $< > $@ ++ @sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@ + endif + + udevrulesdir = $(slashlibdir)/udev/rules.d +-- +2.4.5 + diff --git a/udisks.spec b/udisks.spec index ecf8191..bc146d0 100644 --- a/udisks.spec +++ b/udisks.spec @@ -15,7 +15,7 @@ Summary: Storage Management Service Name: udisks Version: 1.0.5 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ Group: System Environment/Libraries URL: http://www.freedesktop.org/wiki/Software/udisks @@ -23,6 +23,8 @@ Source0: http://hal.freedesktop.org/releases/%{name}-%{version}.tar.gz # https://bugs.freedesktop.org/show_bug.cgi?id=90778 Patch0: udisks-1.0.5-fix-build-with-glibc-2.20.patch Patch1: fix_bash_completion.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1238664 +Patch2: udisks-1.0.5-fix-service-file.patch BuildRequires: pkgconfig(gio-unix-2.0) >= %{glib2_version} BuildRequires: pkgconfig(dbus-1) >= %{dbus_version} BuildRequires: pkgconfig(dbus-glib-1) >= %{dbus_glib_version} @@ -40,6 +42,8 @@ BuildRequires: pkgconfig(libudev) >= %{udev_version} %endif BuildRequires: sg3_utils-devel >= %{sg3_utils_version} BuildRequires: gtk-doc +# Needed for patch 3. +BuildRequires: autoconf automake libtool # needed to pull in the system bus daemon Requires: dbus >= %{dbus_version} # needed to pull in the udev daemon @@ -96,10 +100,14 @@ D-Bus interface definitions and documentation for udisks. %setup -q %patch0 -p1 %patch1 -p1 +%patch2 -p1 # https://bugzilla.redhat.com/show_bug.cgi?id=673544#c15 rm -f src/*-glue.h tools/*-glue.h +autoreconf --force --install + + %build %configure --enable-gtk-doc %make_build @@ -158,6 +166,9 @@ mv $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/udisks-bash-completion.sh \ # Note: please don't forget the %{?dist} in the changelog. Thanks %changelog +* Thu Jul 02 2015 David King - 1.0.5-2 +- Fix systemd service file (#1238664) + * Thu Jun 04 2015 David King - 1.0.5-1 - Update to 1.0.5 (#1075003) - Use license macro for COPYING From 33c82330883bed68b83debf936efdc3c801f5573 Mon Sep 17 00:00:00 2001 From: David King Date: Thu, 2 Jul 2015 14:00:48 +0100 Subject: [PATCH 2/2] Use systemd scriptlet snippets https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Systemd --- udisks.spec | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/udisks.spec b/udisks.spec index bc146d0..fb9b806 100644 --- a/udisks.spec +++ b/udisks.spec @@ -44,6 +44,7 @@ BuildRequires: sg3_utils-devel >= %{sg3_utils_version} BuildRequires: gtk-doc # Needed for patch 3. BuildRequires: autoconf automake libtool +BuildRequires: systemd # needed to pull in the system bus daemon Requires: dbus >= %{dbus_version} # needed to pull in the udev daemon @@ -69,6 +70,9 @@ Requires: eject %ifnarch ppc ppc64 Requires: ntfsprogs %endif +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd # for /proc/self/mountinfo, only available in 2.6.26 or higher Conflicts: kernel < 2.6.26 @@ -131,6 +135,15 @@ mv $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/udisks-bash-completion.sh \ %find_lang %{name} +%post +%systemd_post udisks.service + +%preun +%systemd_preun udisks.service + +%postun +%systemd_postun_with_restart udisks.service + %files -f %{name}.lang %doc README AUTHORS NEWS HACKING doc/TODO %license COPYING @@ -168,6 +181,7 @@ mv $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/udisks-bash-completion.sh \ %changelog * Thu Jul 02 2015 David King - 1.0.5-2 - Fix systemd service file (#1238664) +- Use systemd scriptlet snippets * Thu Jun 04 2015 David King - 1.0.5-1 - Update to 1.0.5 (#1075003)