diff --git a/thinkfan.spec b/thinkfan.spec index da61e55..7096648 100644 --- a/thinkfan.spec +++ b/thinkfan.spec @@ -1,26 +1,26 @@ -Name: thinkfan -Version: 0.9.2 -Release: 3%{?dist} -Summary: A simple fan control program - -Group: Applications/System -License: GPLv3+ -URL: http://thinkfan.sourceforge.net/ -Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz -Source1: thinkfan.modprobe - -BuildRequires: cmake -BuildRequires: systemd-units -BuildRequires: libatasmart-devel -Requires(post): systemd-units -Requires(preun): systemd-units -Requires(postun): systemd-units -Requires: libatasmart +Name: thinkfan +Version: 0.9.2 +Release: 4%{?dist} +Summary: A simple fan control program + +License: GPLv3+ +URL: http://thinkfan.sourceforge.net/ +Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz +Source1: thinkfan.modprobe +Source2: thinkfan.service +Source3: thinkfan.sysconfig + +BuildRequires: cmake +BuildRequires: gcc-c++ +BuildRequires: systemd-units +BuildRequires: libatasmart-devel +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd %description -A simple fan control program. Works with any Linux hwmon driver, -especially with thinkpad_acpi. It is designed to eat as little -CPU power as possible. +A simple fan control program. Works with any Linux hwmon driver, especially +with thinkpad_acpi. It is designed to eat as little CPU power as possible. %prep @@ -34,31 +34,27 @@ mv thinkfan.1.new thinkfan.1 %build %{cmake} -DUSE_ATASMART:BOOL=ON -make +make %{?_smp_mflags} %install -make install DESTDIR=%{buildroot} +%make_install # Install unit file -install -d $RPM_BUILD_ROOT%{_unitdir} -install -pm 0644 rcscripts/thinkfan.service $RPM_BUILD_ROOT%{_unitdir} +install -Dpm 0644 %{SOURCE2} %{buildroot}%{_unitdir}/thinkfan.service + +# Install sysconfig +install -Dpm 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/thinkfan/thinkfan.sysconfig # Install configuration file -install -d $RPM_BUILD_ROOT%{_sysconfdir} -install -pm 0644 examples/thinkfan.conf.simple $RPM_BUILD_ROOT%{_sysconfdir}/thinkfan.conf +install -Dpm 0644 examples/thinkfan.conf.simple %{buildroot}%{_sysconfdir}/thinkfan.conf # Install modprobe configuration file -install -d $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d -install -pm 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d/thinkfan.conf +install -Dpm 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/modprobe.d/thinkfan.conf -# Install thinkfan daemon -install -d $RPM_BUILD_ROOT%{_sbindir} -install -pm 0755 thinkfan $RPM_BUILD_ROOT%{_sbindir} +# Installed through %%license +rm -f %{buildroot}/%{_pkgdocdir}/COPYING -# Install manpages -install -d $RPM_BUILD_ROOT%{_mandir}/man1 -install -pm 0644 thinkfan.1 $RPM_BUILD_ROOT%{_mandir}/man1 %post %systemd_post thinkfan.service @@ -71,16 +67,21 @@ install -pm 0644 thinkfan.1 $RPM_BUILD_ROOT%{_mandir}/man1 %files +%license COPYING +%doc README NEWS +%doc %{_pkgdocdir}/thinkfan.conf.* %{_sbindir}/thinkfan %{_unitdir}/thinkfan.service +%config(noreplace) %{_sysconfdir}/sysconfig/thinkfan %config(noreplace) %{_sysconfdir}/thinkfan.conf %config(noreplace) %{_sysconfdir}/modprobe.d/thinkfan.conf %{_mandir}/man1/thinkfan.1.* -%doc README NEWS COPYING -%doc %{_pkgdocdir}/thinkfan.conf.* - %changelog +* Wed Oct 21 2015 Sandro Mani - 0.9.2-4 +- Install sysconfig file (#1189976) +- Modernize spec + * Fri Oct 09 2015 Matt Spaulding - 0.9.2-3 - Add libatasmart support (RHBZ#1243367) - Add config files to docs