Blob Blame History Raw
Name:		thinkfan
Version:	0.8.1
Release:	5%{?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:	systemd-units
Requires(post): systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units

%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.


%prep
%setup -q

# Make man page documentation UTF-8
iconv -f ISO-8859-1 -t UTF-8 thinkfan.1 > thinkfan.1.new
rm thinkfan.1
mv thinkfan.1.new thinkfan.1


%build
CFLAGS="-ggdb" make %{?_smp_mflags}


%install
# Install unit file
install -d $RPM_BUILD_ROOT%{_unitdir}
install -pm 0644 rcscripts/thinkfan.service $RPM_BUILD_ROOT%{_unitdir}

# Install configuration file
install -d $RPM_BUILD_ROOT%{_sysconfdir}
install -pm 0644 examples/thinkfan.conf.thinkpad $RPM_BUILD_ROOT%{_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 thinkfan daemon
install -d $RPM_BUILD_ROOT%{_sbindir}
install -pm 0755 thinkfan $RPM_BUILD_ROOT%{_sbindir}

# Install manpages
install -d $RPM_BUILD_ROOT%{_mandir}/man1
install -pm 0644 thinkfan.1 $RPM_BUILD_ROOT%{_mandir}/man1

%post
%systemd_post thinkfan.service

%preun
%systemd_preun thinkfan.service

%postun
%systemd_postun_with_restart thinkfan.service


%files
%{_sbindir}/thinkfan
%{_unitdir}/thinkfan.service
%config(noreplace) %{_sysconfdir}/thinkfan.conf
%config(noreplace) %{_sysconfdir}/modprobe.d/thinkfan.conf
%{_mandir}/man1/thinkfan.1.*
%doc examples ChangeLog README NEWS COPYING



%changelog
* Sat Aug 17 2013 Matt Spaulding <mspaulding06@gmail.com> - 0.8.1-5
- Fixed empty man pages
- Fixed config in wrong location (RHBZ#998110)

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Mon Oct 01 2012 Matt Spaulding <mspaulding06@gmail.com> - 0.8.1-2
- Fixed license type
- Fixed manpages entry in files section

* Sat Sep 29 2012 Matt Spaulding <mspaulding06@gmail.com> - 0.8.1-1
- Initial packaging