From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH] smartmontools: Rework package. Date: Wed, 12 Oct 2016 14:40:01 +0200 Message-ID: <1476276001-952-1-git-send-email-stefan.schantl@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0248094066750312604==" List-Id: --===============0248094066750312604== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable * Enable useage of libcap-ng. * Drop support for SELinux. * Replace hardcoded path values. * Enable testsuite. * Add scriptlet for systemd. Fixes #11229. Signed-off-by: Stefan Schantl --- smartmontools/smartmontools.nm | 55 ++++++++++++++++++++++++++++++++++------= -- 1 file changed, 45 insertions(+), 10 deletions(-) diff --git a/smartmontools/smartmontools.nm b/smartmontools/smartmontools.nm index 222d5d9..9e85375 100644 --- a/smartmontools/smartmontools.nm +++ b/smartmontools/smartmontools.nm @@ -5,7 +5,7 @@ =20 name =3D smartmontools version =3D 6.5 -release =3D 1 +release =3D 2 =20 groups =3D System/Statistics url =3D http://smartmontools.sourceforge.net/ @@ -13,11 +13,11 @@ license =3D GPLv2 summary =3D A set of tools that watches HDD S.M.A.R.T status. =20 description - The smartmontools package contains two utility programs (smartctl \ - and smartd) to control and monitor storage systems using the \ - Self-Monitoring, Analysis and Reporting Technology System (SMART) \ - built into most modern ATA and SCSI harddisks. In many cases, \ - these utilities will provide advanced warning of disk degradation \ + The smartmontools package contains two utility programs (smartctl + and smartd) to control and monitor storage systems using the + Self-Monitoring, Analysis and Reporting Technology System (SMART) + built into most modern ATA and SCSI harddisks. In many cases, + these utilities will provide advanced warning of disk degradation and failure. end =20 @@ -26,21 +26,56 @@ source_dl =3D http://sourceforge.net/projects/smartmonto= ols/files/smartmontools/% build requires gcc-c++ - libselinux-devel + libcap-ng-devel end =20 configure_options +=3D \ - --mandir=3D/usr/share/man \ - --sysconfdir=3D/etc \ - --with-selinux + --mandir=3D%{mandir} \ + --sysconfdir=3D%{sysconfdir}/%{name} \ + --with-libcap-ng=3Dyes \ + --with-systemdsystemunitdir=3D%{unitdir} + + test + make check + end =20 install_cmds + # Drop old sysvinit script. rm -rvf %{BUILDROOT}/etc/rc.d + + # Fix sysconfig path in systemd file. + sed -i 's|/etc/smartmontools/sysconfig|/etc/sysconfig|g' \ + %{BUILDROOT}%{unitdir}/smartd.service end end =20 packages package %{name} + configfiles + %{sysconfdir}/smartmontools/smartd.conf + end + + prerequires + systemd-units + end + + script postin + systemctl daemon-reload >/dev/null 2>&1 || : + end + + script preun + systemctl --no-reload disable smartd.service >/dev/null 2>&1 || : + systemctl stop smartd.service >/dev/null 2>&1 || : + end + + script postun + systemctl daemon-reload >/dev/null 2>&1 || : + end + + script postup + systemctl daemon-reload >/dev/null 2>&1 || : + systemctl try-restart smartd.service >/dev/null 2>&1 || : + end end =20 package %{name}-debuginfo --=20 2.7.4 --===============0248094066750312604==--