]> git.proxmox.com Git - mirror_corosync-qdevice.git/commitdiff
spec: Modernize spec file a bit
authorJan Friesse <jfriesse@redhat.com>
Thu, 25 Jan 2018 09:32:42 +0000 (10:32 +0100)
committerJan Friesse <jfriesse@redhat.com>
Thu, 25 Jan 2018 09:33:17 +0000 (10:33 +0100)
Thanks to Robert-AndrĂ© Mauchin <zebob.m@gmail.com> for spec file review
and comments.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
corosync-qdevice.spec.in

index eace00d795b93cffbaa6c2626a4ee8311dcbe313..77b0874e3f9cfac4cc841bb54cca0e8cc1de9ec2 100644 (file)
@@ -16,7 +16,6 @@ Summary: The Corosync Cluster Engine Qdevice
 Version: @version@
 Release: 1%{?gitver}%{?dist}
 License: BSD
-Group: System Environment/Base
 URL: https://github.com/corosync/corosync-qdevice
 Source0: https://github.com/corosync/corosync-qdevice/releases/download/v%{version}%{?gittarver}/%{name}-%{version}%{?gittarver}.tar.gz
 
@@ -26,9 +25,9 @@ Requires: corosynclib >= 2.4.0
 Requires: nss-tools
 
 %if %{with systemd}
-Requires(post): systemd
-Requires(preun): systemd
-Requires(postun): systemd
+%{?systemd_requires}
+BuildRequires: systemd
+BuildRequires: systemd-devel
 %else
 Requires(post): /sbin/chkconfig
 Requires(preun): /sbin/chkconfig
@@ -44,12 +43,6 @@ BuildRequires: sed
 %if %{with runautogen}
 BuildRequires: autoconf automake libtool
 %endif
-%if %{with systemd}
-BuildRequires: systemd-units
-BuildRequires: systemd-devel
-%endif
-
-BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
 
 %prep
 %setup -q -n %{name}-%{version}%{?gittarver}
@@ -71,8 +64,6 @@ BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
 make %{_smp_mflags}
 
 %install
-rm -rf %{buildroot}
-
 make install DESTDIR=%{buildroot}
 
 ## tree fixup
@@ -95,7 +86,6 @@ sed -i -e 's/^COROSYNC_QNETD_RUNAS=""$/COROSYNC_QNETD_RUNAS="coroqnetd"/' \
 %endif
 
 %clean
-rm -rf %{buildroot}
 
 %description
 This package contains the Corosync Cluster Engine Qdevice, script for creating
@@ -122,11 +112,10 @@ fi
 
 %postun
 %if %{with systemd} && 0%{?systemd_postun:1}
-%systemd_postun
+%systemd_postun corosync-qdevice.service
 %endif
 
 %files
-%defattr(-,root,root,-)
 %dir %{_sysconfdir}/corosync/qdevice
 %dir %config(noreplace) %{_sysconfdir}/corosync/qdevice/net
 %dir %{_localstatedir}/run/corosync-qdevice
@@ -145,15 +134,11 @@ fi
 
 %package -n corosync-qnetd
 Summary: The Corosync Cluster Engine Qdevice Network Daemon
-Group: System Environment/Base
 Requires: nss-tools
 Requires(pre): shadow-utils
-Requires(pre): /usr/sbin/useradd
 
 %if %{with systemd}
-Requires(post): systemd
-Requires(preun): systemd
-Requires(postun): systemd
+%{?systemd_requires}
 %endif
 
 %description -n corosync-qnetd
@@ -187,11 +172,10 @@ fi
 
 %postun -n corosync-qnetd
 %if %{with systemd} && 0%{?systemd_postun:1}
-%systemd_postun
+%systemd_postun corosync-qnetd.service
 %endif
 
 %files -n corosync-qnetd
-%defattr(-,root,root,-)
 %dir %config(noreplace) %attr(770, coroqnetd, coroqnetd) %{_sysconfdir}/corosync/qnetd
 %dir %attr(770, coroqnetd, coroqnetd) %{_localstatedir}/run/corosync-qnetd
 %{_bindir}/corosync-qnetd