]>
Commit | Line | Data |
---|---|---|
f691fe0a JB |
1 | # TODO: |
2 | # - unpackaged: | |
3 | # /etc/power/event.d/laptop-mode | |
4 | # /etc/power/scripts.d/laptop-mode | |
5 | # - (PPC) subpackage with files for pbbuttonsd and pmud | |
6 | # - fix *.conf manuals (should be .5 and referenced as such) | |
7 | # - /etc/apm not owned, should it be /etc/pm? | |
48da88cf | 8 | # |
b552d668 | 9 | # Conditional build: |
f99e4c95 | 10 | %bcond_with apm # build apm package |
b552d668 ER |
11 | %bcond_without acpi # build acpi package |
12 | ||
b552d668 ER |
13 | %ifnarch %{ix86} %{x8664} ia64 |
14 | %undefine with_acpi | |
15 | %endif | |
a0dbd5c6 | 16 | %ifnarch %{ix86} %{arm} mips ppc sh |
b552d668 ER |
17 | %undefine with_apm |
18 | %endif | |
3aa88ade | 19 | Summary: Laptop Mode Tools |
1ff27b94 | 20 | Summary(pl.UTF-8): Narzędzia do trybu laptopowego |
3aa88ade | 21 | Name: laptop-mode-tools |
f691fe0a JB |
22 | Version: 1.74 |
23 | Release: 1 | |
24 | License: GPL v2+ | |
3aa88ade | 25 | Group: Applications/System |
f691fe0a JB |
26 | #Source0Download: https://github.com/rickysarraf/laptop-mode-tools/releases |
27 | Source0: https://github.com/rickysarraf/laptop-mode-tools/releases/download/%{version}/%{name}_%{version}.tar.gz | |
28 | # Source0-md5: c035e95e24f6f368952a20414c4ac224 | |
3aa88ade | 29 | Source1: %{name}.init |
1221a1ea | 30 | Patch0: no-exec-redirection.patch |
3d4a09f4 | 31 | Patch2: intel_perf_bias.patch |
c534031f | 32 | URL: https://github.com/rickysarraf/laptop-mode-tools |
f691fe0a | 33 | BuildRequires: rpm-build >= 4.6 |
38699cec JR |
34 | BuildRequires: rpm-pythonprov |
35 | BuildRequires: rpmbuild(macros) >= 1.714 | |
3aa88ade | 36 | Requires(post,preun): /sbin/chkconfig |
b552d668 ER |
37 | %if %{with apm} && %{with acpi} |
38 | Requires: %{name}-scripts = %{version}-%{release} | |
39 | %else | |
40 | %{?with_acpi:Requires: acpid} | |
41 | %{?with_apm:Requires: apmd} | |
a0dbd5c6 JB |
42 | Obsoletes: laptop-mode-tools-acpi < %{version}-%{release} |
43 | Obsoletes: laptop-mode-tools-apm < %{version}-%{release} | |
44 | Obsoletes: laptop-mode-tools-scripts < %{version}-%{release} | |
e57763de | 45 | %endif |
df741575 | 46 | Suggests: hdparm |
3aa88ade AM |
47 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
48 | ||
6295fbfe JB |
49 | # no binaries; not noarch because of libdir paths |
50 | %define _enable_debug_packages 0 | |
51 | ||
3aa88ade AM |
52 | %description |
53 | Laptop mode (also known as laptopmode, laptop-mode and laptop_mode, | |
54 | for search engine purposes :) ) is a kernel "mode" that allows you to | |
55 | extend the battery life of your laptop. It does this by intelligently | |
56 | grouping write activity on your disks, so that only reads of uncached | |
57 | data result in a disk spinup. It causes a significant improvement in | |
58 | battery life (for usage patterns that allow it). | |
59 | ||
4d82385c JR |
60 | %description -l pl.UTF-8 |
61 | Tryb laptopowy (laptop mode) to "tryb" pracy jądra umożliwiający | |
62 | wydłużenie czasu życia baterii laptopa. Czyni to inteligentnie | |
63 | grupując zapisy na dyski w ten sposób, że tylko odczyt | |
64 | niezbuforowanych danych powoduje rozpędzenie dysku. Powoduje znaczącą | |
65 | poprawę czasu życia baterii. | |
c9dfa2d1 | 66 | |
3aa88ade AM |
67 | %package acpi |
68 | Summary: ACPI scripts for laptop mode tools | |
1ff27b94 | 69 | Summary(pl.UTF-8): Skrypty ACPI dla narzędzi do trybu laptopowego |
3aa88ade | 70 | Group: Applications/System |
b552d668 | 71 | Requires: %{name} = %{version}-%{release} |
3aa88ade | 72 | Requires: acpid |
b552d668 | 73 | Provides: %{name}-scripts = %{version}-%{release} |
3aa88ade AM |
74 | |
75 | %description acpi | |
76 | ACPI scripts for laptop mode tools. | |
77 | ||
4d82385c JR |
78 | %description acpi -l pl.UTF-8 |
79 | Skrypty ACPI dla narzędzi do trybu laptopowego. | |
c9dfa2d1 | 80 | |
3aa88ade AM |
81 | %package apm |
82 | Summary: APM scripts for laptop mode tools | |
1ff27b94 | 83 | Summary(pl.UTF-8): Skrypty APM dla narzędzi do trybu laptopowego |
3aa88ade | 84 | Group: Applications/System |
b552d668 | 85 | Requires: %{name} = %{version}-%{release} |
3aa88ade | 86 | Requires: apmd |
b552d668 | 87 | Provides: %{name}-scripts = %{version}-%{release} |
3aa88ade AM |
88 | |
89 | %description apm | |
90 | APM scripts for laptop mode tools. | |
91 | ||
4d82385c JR |
92 | %description apm -l pl.UTF-8 |
93 | Skrypty APM dla narzędzi do trybu laptopowego. | |
c9dfa2d1 | 94 | |
f99e4c95 JR |
95 | %package -n pm-utils-lmt |
96 | Summary: Laptop mode tools script for pm-utils | |
97 | Group: Applications/System | |
98 | Requires: %{name} = %{version}-%{release} | |
99 | Requires: pm-utils | |
100 | ||
101 | %description -n pm-utils-lmt | |
102 | Laptop mode tools script for pm-utils. | |
103 | ||
38699cec JR |
104 | %package gui |
105 | Summary: GUI for laptop mode tools | |
106 | Summary(pl.UTF-8): GUI dla narzędzi do trybu laptopowego | |
107 | Group: Applications/X11 | |
38699cec | 108 | Requires: %{name} = %{version}-%{release} |
f691fe0a JB |
109 | Requires: python3-PyQt5 |
110 | Requires: python3-modules | |
38699cec JR |
111 | BuildArch: noarch |
112 | ||
113 | %description gui | |
114 | GUI for laptop mode tools. | |
115 | ||
116 | %description gui -l pl.UTF-8 | |
117 | GUI dla narzędzi do trybu laptopowego. | |
118 | ||
3aa88ade | 119 | %prep |
f691fe0a | 120 | %setup -q -n %{name}_%{version} |
1221a1ea | 121 | %patch0 -p1 |
3d4a09f4 | 122 | %patch2 -p1 |
3aa88ade | 123 | |
f691fe0a | 124 | %{__sed} -i -e '1s|/usr/bin/env python3|%{__python3}|' gui/lmt.py |
38699cec | 125 | |
3aa88ade AM |
126 | %install |
127 | rm -rf $RPM_BUILD_ROOT | |
f99e4c95 | 128 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_desktopdir}} |
3aa88ade | 129 | |
c534031f AM |
130 | %{__make} install \ |
131 | INSTALL=install \ | |
132 | INIT_D=$RPM_BUILD_ROOT/etc/rc.d/init.d \ | |
133 | ULIB_D=%{_libdir} \ | |
134 | MAN_D=%{_mandir} \ | |
ab35f8e4 | 135 | TMPFILES_D=%{systemdtmpfilesdir} \ |
c534031f AM |
136 | %{!?with_acpi:ACPI=disabled} \ |
137 | %{!?with_apm:APM=disabled} \ | |
138 | DESTDIR=$RPM_BUILD_ROOT | |
3aa88ade | 139 | |
c534031f | 140 | install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/laptop-mode |
38699cec | 141 | |
3aa88ade AM |
142 | %clean |
143 | rm -rf $RPM_BUILD_ROOT | |
144 | ||
145 | %post | |
146 | /sbin/chkconfig --add laptop-mode | |
9d2c8548 | 147 | %service laptop-mode restart |
3aa88ade AM |
148 | |
149 | %preun | |
150 | if [ "$1" = "0" ]; then | |
9d2c8548 | 151 | %service laptop-mode stop |
3aa88ade AM |
152 | /sbin/chkconfig --del laptop-mode |
153 | fi | |
154 | ||
155 | %files | |
156 | %defattr(644,root,root,755) | |
c534031f | 157 | %doc README.md Documentation/* |
48da88cf | 158 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/laptop-mode/*.conf |
e57d0ad0 | 159 | %dir %{_sysconfdir}/laptop-mode |
48da88cf MB |
160 | %dir %{_sysconfdir}/laptop-mode/batt-start |
161 | %dir %{_sysconfdir}/laptop-mode/batt-stop | |
162 | %dir %{_sysconfdir}/laptop-mode/conf.d | |
163 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/laptop-mode/conf.d/*.conf | |
164 | %dir %{_sysconfdir}/laptop-mode/lm-ac-start | |
165 | %dir %{_sysconfdir}/laptop-mode/lm-ac-stop | |
166 | %dir %{_sysconfdir}/laptop-mode/nolm-ac-start | |
167 | %dir %{_sysconfdir}/laptop-mode/nolm-ac-stop | |
3aa88ade | 168 | %attr(754,root,root) /etc/rc.d/init.d/laptop-mode |
c534031f AM |
169 | %attr(755,root,root) /lib/udev/lmt-udev |
170 | /lib/udev/rules.d/99-laptop-mode.rules | |
ab35f8e4 JR |
171 | %{systemdtmpfilesdir}/laptop-mode.conf |
172 | %{systemdunitdir}/laptop-mode.service | |
173 | %{systemdunitdir}/laptop-mode.timer | |
174 | %{systemdunitdir}/lmt-poll.service | |
df741575 SP |
175 | %dir %{_datadir}/%{name} |
176 | %dir %{_datadir}/%{name}/modules | |
df741575 | 177 | %attr(755,root,root) %{_datadir}/%{name}/modules/* |
c534031f AM |
178 | %dir %{_datadir}/%{name}/module-helpers |
179 | %attr(755,root,root) %{_datadir}/%{name}/module-helpers/* | |
807a754c JB |
180 | %attr(755,root,root) %{_sbindir}/laptop_mode |
181 | %attr(755,root,root) %{_sbindir}/lm-profiler | |
182 | %attr(755,root,root) %{_sbindir}/lm-syslog-setup | |
183 | %{_mandir}/man8/laptop_mode.8* | |
184 | %{_mandir}/man8/lm-profiler.8* | |
185 | %{_mandir}/man8/lm-syslog-setup.8* | |
186 | # should be man5 | |
187 | %{_mandir}/man8/laptop-mode.conf.8* | |
188 | %{_mandir}/man8/lm-profiler.conf.8* | |
189 | ||
b552d668 ER |
190 | %if %{with acpi} |
191 | # skip subpackage if only one backend built | |
192 | %{?with_apm:%files acpi} | |
3aa88ade | 193 | %defattr(644,root,root,755) |
807a754c JB |
194 | %attr(755,root,root) %{_sysconfdir}/acpi/actions/lm_*.sh |
195 | %{_sysconfdir}/acpi/events/lm_* | |
196 | %endif | |
3aa88ade | 197 | |
b552d668 ER |
198 | %if %{with apm} |
199 | # skip subpackage if only one backend built | |
200 | %{?with_acpi:%files apm} | |
3aa88ade | 201 | %defattr(644,root,root,755) |
b552d668 | 202 | # XXX: dir not owned |
807a754c | 203 | %attr(755,root,root) %{_sysconfdir}/apm/event.d/laptop-mode |
47dd4901 | 204 | %endif |
38699cec | 205 | |
f99e4c95 JR |
206 | %files -n pm-utils-lmt |
207 | %defattr(644,root,root,755) | |
208 | %attr(755,root,root) %{_libdir}/pm-utils/sleep.d/01laptop-mode | |
209 | ||
38699cec JR |
210 | %files gui |
211 | %defattr(644,root,root,755) | |
ab35f8e4 JR |
212 | %attr(755,root,root) %{_sbindir}/lmt-config-gui |
213 | %attr(755,root,root) %{_sbindir}/lmt-config-gui-pkexec | |
3d4a09f4 | 214 | %{_datadir}/%{name}/lmt.py |
38699cec | 215 | %{_datadir}/polkit-1/actions/org.linux.lmt.gui.policy |
ab35f8e4 JR |
216 | %{_desktopdir}/laptop-mode-tools.desktop |
217 | %{_pixmapsdir}/laptop-mode-tools.svg |