hddtemp/hddtemp.spec
2020-07-07 20:01:05 +08:00

93 lines
2.7 KiB
RPMSpec

Name: hddtemp
Version: 0.3
Release: 1.beta15%{?dist}
Summary: Hard disk temperature tool
License: GPLv2+
URL: http://savannah.nongnu.org/projects/hddtemp/
Source0: http://download.savannah.nongnu.org/releases/hddtemp/%{name}-%{version}-beta15.tar.bz2
Source1: %{name}.db
Source2: %{name}.service
Source3: %{name}.sysconfig
Source4: %{name}.pam
Source5: %{name}.consoleapp
Patch0: 0001-Try-attribute-190-if-194-doesn-t-exist.patch
Patch1: http://ftp.debian.org/debian/pool/main/h/hddtemp/hddtemp_0.3-beta15-53.diff.gz
Patch2: %{name}-0.3-beta15-autodetect-717479.patch
Patch3: 0001-Allow-binding-to-a-listen-address-that-doesn-t-exist.patch
Patch4: fix-model-length.patch
BuildRequires: gcc
BuildRequires: gettext
# systemd >= 186 for scriptlet macros
BuildRequires: systemd >= 186
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
Requires: %{_bindir}/consolehelper
%description
hddtemp is a tool that gives you the temperature of your hard drive by
reading S.M.A.R.T. information.
%prep
%setup -q -n %{name}-%{version}-beta15
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch0 -p1
%patch4 -p1
sed -i -e 's|/etc/hddtemp.db|/usr/share/misc/hddtemp.db|' doc/hddtemp.8
chmod -x contribs/analyze/*
rm COPYING ; cp -p GPL-2 COPYING
cp -p debian/changelog changelog.debian
%build
%configure --disable-dependency-tracking
make %{?_smp_mflags}
%install
make install DESTDIR=$RPM_BUILD_ROOT
install -Dpm 644 %{SOURCE1} $RPM_BUILD_ROOT/usr/share/misc/hddtemp.db
install -Dpm 644 %{SOURCE2} $RPM_BUILD_ROOT%{_unitdir}/hddtemp.service
install -Dpm 644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/hddtemp
install -dm 755 $RPM_BUILD_ROOT%{_bindir}
ln -s consolehelper $RPM_BUILD_ROOT%{_bindir}/hddtemp
install -Dpm 644 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/hddtemp
install -Dpm 644 %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/security/console.apps/hddtemp
%find_lang %{name}
%post
%systemd_post hddtemp.service
%preun
%systemd_preun hddtemp.service
%postun
%systemd_postun_with_restart hddtemp.service
%files -f %{name}.lang
%doc ChangeLog changelog.debian COPYING README TODO contribs/
%config(noreplace) %{_sysconfdir}/sysconfig/hddtemp
%config(noreplace) %{_sysconfdir}/pam.d/hddtemp
%config(noreplace) %{_sysconfdir}/security/console.apps/hddtemp
%{_unitdir}/hddtemp.service
%{_bindir}/hddtemp
%{_sbindir}/hddtemp
%config(noreplace) /usr/share/misc/hddtemp.db
%{_mandir}/man8/hddtemp.8*
%changelog
* Tue Jul 7 2020 Dillon Chen <dillon.chen@turbolinux.com.cn> - 0.3-1.beta15
- package from Fedora
- Update Debian patch set to 0.3-beta15-53