summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2017-09-21 11:31:20 +0200
committerNiels de Vos <ndevos@redhat.com>2017-09-22 11:56:35 +0200
commite364da11481eead41395231ed14a6e056d9eeb91 (patch)
tree21c895494b22b4d32522c6f136d241fce816dc85
parentfeb517ae133fd4af0dc35725070e80522ea43539 (diff)
rpm: include suggested changes from Fedora package review
gluster-block has been packaged for Fedora and reviewing the .spec showed some areas where improvements could be done. The following changes are part of the Fedora package, so it would be good to include them here as well: - added systemd macros in the scriptlets - use pkgconfig for BuildRequires - run setup in quiet mode - run make_* macros instead of make commands in build/install section - drop the INSTALL file from the documentation Change-Id: Ic0d28eb900aabd2199b6a021db3790ec023cdf25 URL: https://src.fedoraproject.org/rpms/gluster-block BUG: https://bugzilla.redhat.com/1467677 Signed-off-by: Niels de Vos <ndevos@redhat.com>
-rw-r--r--gluster-block.spec.in32
1 files changed, 25 insertions, 7 deletions
diff --git a/gluster-block.spec.in b/gluster-block.spec.in
index b14c5d5..03e6b9e 100644
--- a/gluster-block.spec.in
+++ b/gluster-block.spec.in
@@ -20,11 +20,12 @@ License: GPLv2 or LGPLv3+
URL: https://github.com/gluster/gluster-block
Source0: @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz
-BuildRequires: glusterfs-api-devel >= 3.6.0
-BuildRequires: json-c-devel
+BuildRequires: pkgconfig(glusterfs-api)
+BuildRequires: pkgconfig(json-c)
BuildRequires: help2man >= 1.36
%if ( 0%{?_with_systemd:1} )
-BuildRequires: systemd-units
+%{?systemd_requires}
+BuildRequires: systemd
%endif
Requires: tcmu-runner >= 1.0.4
@@ -36,28 +37,38 @@ gluster-block is a CLI utility, which aims at making gluster backed block
storage creation and maintenance as simple as possible.
%prep
-%setup
+%setup -q
%build
%configure
-make
+%make_build
%install
-make DESTDIR=${RPM_BUILD_ROOT} install
+%make_install
%if ( 0%{?_with_initd:1} )
mv %{buildroot}/%{_initddir}/gluster-blockd.initd %{buildroot}/%{_initddir}/gluster-blockd
%endif
+%if ( 0%{?_with_systemd:1} )
+%post
+%systemd_post gluster-blockd.service
+
+%preun
+%systemd_preun gluster-blockd.service
+
+%postun
+%systemd_postun_with_restart gluster-blockd.service
+
%clean
rm -rf ${RPM_BUILD_ROOT}
%files
+%doc README.md
%if ( 0%{?_with_initd:1} )
%doc COPYING-GPLV2 COPYING-LGPLV3
%else
%license COPYING-GPLV2 COPYING-LGPLV3
%endif
-%doc README.md INSTALL
%{_sbindir}/gluster-block
%{_sbindir}/gluster-blockd
%{_mandir}/man8/gluster-block*.8*
@@ -70,6 +81,13 @@ rm -rf ${RPM_BUILD_ROOT}
%config(noreplace) %{_sysconfdir}/sysconfig/gluster-blockd
%changelog
+* Thu Sep 21 2017 Niels de Vos <ndevos@redhat.com>
+- added systemd macros in the scriptlets
+- use pkgconfig for BuildRequires
+- run setup in quiet mode
+- run make_* macros instead of make commands in build/install section
+- drop the INSTALL file from the documentation
+
* Fri Sep 15 2017 Ji-Hyeon Gim <potatogim@potatogim.net>
- update with sysconfig handling for non-systemd distros