]> git.pld-linux.org Git - packages/thinkfan.git/blob - thinkfan.spec
04271cebab0d1550e8a527512c9d279910650ee5
[packages/thinkfan.git] / thinkfan.spec
1 Summary:        ThinkPad fan control program
2 Summary(pl.UTF-8):      Program do sterowania wiatraczkiem w ThinkPadach
3 Name:           thinkfan
4 Version:        1.3.1
5 Release:        1
6 License:        GPL v3+
7 Group:          Applications/System
8 #Source0Download: https://github.com/vmatare/thinkfan/releases
9 Source0:        https://github.com/vmatare/thinkfan/archive/refs/tags/%{version}.tar.gz
10 # Source0-md5:  8f7cdec0a524ed99fe6836f95d749da1
11 Source1:        %{name}.init
12 URL:            https://github.com/vmatare/thinkfan
13 BuildRequires:  cmake >= 2.6
14 BuildRequires:  libatasmart-devel
15 BuildRequires:  rpmbuild(macros) >= 1.605
16 BuildRequires:  sed >= 4.0
17 BuildRequires:  systemd-devel
18 BuildRequires:  yaml-cpp-devel >= 0.5.4
19 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
20
21 %description
22 A minimalist fan control program. Supports any kind of system via the
23 sysfs hwmon interface (/sys/class/hwmon). It is designed to eat as
24 little CPU power as possible. The development was inspired by the
25 excellent work people have done on thinkwiki.org.
26
27 %description -l pl.UTF-8
28 Minimalistyczny program do sterowania wiatraczkiem. Obsługuje dowolny
29 system poprzez interfejs sysfs hwmon (/sys/class/hwmon). Został tak
30 zaprojektowany, aby obciążać procesor w najmniejszym możliwym stopniu.
31 Stworzenie tego narzędzia zostało zainspirowane wspaniałą pracą
32 wykonaną przez ludzi na thinkwiki.org.
33
34 %prep
35 %setup -q
36
37 %build
38 install -d build
39 cd build
40 %cmake \
41         ..
42
43 %install
44 rm -rf $RPM_BUILD_ROOT
45 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d \
46 $RPM_BUILD_ROOT{%{systemdunitdir},%{_sysconfdir}/systemd/system}
47
48
49 %{__make} -C build install \
50         DESTDIR=$RPM_BUILD_ROOT
51
52 # Packaged by %doc
53 %{__rm} $RPM_BUILD_ROOT%{_docdir}/{COPYING,README.md,thinkfan.yaml}
54
55 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
56 cp -p examples/thinkfan.yaml $RPM_BUILD_ROOT%{_sysconfdir}/thinkfan.yaml
57 mv $RPM_BUILD_ROOT%{_prefix}%{systemdunitdir}/*.service $RPM_BUILD_ROOT%{systemdunitdir}
58
59 %clean
60 rm -rf $RPM_BUILD_ROOT
61
62 %post
63 /sbin/chkconfig --add thinkfan
64 %service thinkfan restart
65 %systemd_post thinkfan.service
66
67 %preun
68 if [ "$1" = "0" ]; then
69         /sbin/chkconfig --del thinkfan
70         %service thinkfan stop
71 fi
72 %systemd_preun thinkfan.service
73
74 %postun
75 %systemd_reload
76
77 %triggerpostun -- %{name} < 5.42-5
78 %systemd_trigger smartd.service
79
80 %files
81 %defattr(644,root,root,755)
82 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.yaml
83 %dir %{_sysconfdir}/systemd/system/thinkfan.service.d
84 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/systemd/system/thinkfan.service.d/override.conf
85 %attr(754,root,root) /etc/rc.d/init.d/%{name}
86 %attr(755,root,root) %{_sbindir}/thinkfan
87 %doc COPYING README.md examples/thinkfan.yaml
88 %{_mandir}/man1/thinkfan.1*
89 %{_mandir}/man5/thinkfan.conf.5*
90 %{_mandir}/man5/thinkfan.conf.legacy.5*
91 %{systemdunitdir}/%{name}.service
92 %{systemdunitdir}/%{name}-sleep.service
93 %{systemdunitdir}/%{name}-wakeup.service
This page took 0.041972 seconds and 2 git commands to generate.