summaryrefslogtreecommitdiffstats
path: root/mbpfan/mbpfan.spec
blob: cc5199216029a1214a54fd28eaeeba36c29d49bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
Name:       mbpfan
Version:    2.2.1
Release:    2%{?dist}
Summary:    A simple daemon to control fan speed on all MacBook/MacBook Pros
License:    GPLv3
URL:        https://github.com/linux-on-mac/mbpfan
Source0:    https://github.com/linux-on-mac/mbpfan/archive/v%{version}/%{name}-%{version}.tar.gz

BuildRequires:  gcc
BuildRequires:  make
BuildRequires:  systemd
BuildRequires:  systemd-rpm-macros

ExclusiveArch:  x86_64

%description
This is an enhanced version of Allan McRae mbpfan

mbpfan is a daemon that uses input from coretemp module and sets the
fan speed using the applesmc module. This enhanced version assumes any
number of processors and fans (max. 10).

* It only uses the temperatures from the processors as input.
* It requires coretemp and applesmc kernel modules to be loaded.
* It requires root use
* It daemonizes or stays in foreground
* Verbose mode for both syslog and stdout
* Users can configure it using the file /etc/mbpfan.conf

%prep
%setup -q

%build
%set_build_flags
%make_build

%install
# Installing the binary
install -Dpm 0755 -t %{buildroot}%{_sbindir}/ bin/%{name}

# Installing the systemd service
install -Dpm 0644 -t %{buildroot}%{_unitdir}/ %{name}.service

# Installing the configuration file
install -Dpm 0644 -t %{buildroot}/etc/ %{name}.conf

# Installing the manual
install -Dpm 0644 -t %{buildroot}%{_mandir}/man8/ %{name}.8.gz

%post
%systemd_post %{name}.service

%preun
%systemd_preun %{name}.service

%postun
%systemd_postun_with_restart %{name}.service

%files
%{_sbindir}/%{name}
%{_unitdir}/%{name}.service
%{_mandir}/man8/mbpfan.8.*
%config(noreplace) /etc/%{name}.conf
%doc README.md AUTHORS
%license COPYING

%changelog
* Tue Dec 10 2019 Lyes Saadi <fedora@lyes.eu> - 2.2.1-2
- Improving the spec file, thanks to Robert-André Mauchin:
  - Adding Systemd scriptlets to automatically enable the mbpfan service.
  - Adding Fedora's build flags.
  - Ensuring that installed files are not executables.


* Sun Nov 24 2019 Lyes Saadi <fedora@lyes.eu> - 2.2.1-1
- Updating to 2.2.1.
- For additional information, see https://github.com/linux-on-mac/mbpfan/releases/tag/v2.2.1

* Sat Nov 09 2019 Lyes Saadi <fedora@lyes.eu> - 2.2.0-3
- Improving the spec file, thanks to Dominik 'Rathann' Mierzejewski.

* Fri Nov 01 2019 Lyes Saadi <fedora@lyes.eu> - 2.2.0-2
- Making the spec file compliant to Fedora Packaging Guidelines.
- Adding manpages.

* Fri Nov 01 2019 Lyes Saadi <fedora@lyes.eu> - 2.2.0-1
- Updating to 2.2.0.
- For additional information, see https://github.com/linux-on-mac/mbpfan/releases/tag/v2.2.0

* Fri Oct 04 2019 Lyes Saadi <fedora@lyes.eu> - 2.1.1-2
- Adding path for systemd.

* Thu Oct 03 2019 Lyes Saadi <fedora@lyes.eu> - 2.1.1-1
- Creating the spec file.