3 %bcond_with apm # build apm package
4 %bcond_without acpi # build acpi package
7 # - subpackage with files for pbbuttonsd and pmud
8 # - fix *.conf manuals (should be .5 and referenced as such)
9 # - /etc/apm not owned, should it be /etc/pm?
11 %ifnarch %{ix86} %{x8664} ia64
14 %ifnarch %{ix86} arm mips ppc sh
17 Summary: Laptop Mode Tools
18 Summary(pl.UTF-8): Narzędzia do trybu laptopowego
19 Name: laptop-mode-tools
23 Group: Applications/System
24 Source0: https://github.com/rickysarraf/laptop-mode-tools/archive/%{version}/%{name}-%{version}.tar.gz
25 # Source0-md5: 8b9a2d9db7dd9d0a99b635a1185f292c
27 Patch0: no-exec-redirection.patch
28 Patch1: cpufreq-pstate.patch
29 URL: https://github.com/rickysarraf/laptop-mode-tools
30 BuildRequires: rpm-pythonprov
31 BuildRequires: rpmbuild(macros) >= 1.714
32 Requires(post,preun): /sbin/chkconfig
33 %if %{with apm} && %{with acpi}
34 Requires: %{name}-scripts = %{version}-%{release}
36 %{?with_acpi:Requires: acpid}
37 %{?with_apm:Requires: apmd}
38 Obsoletes: laptop-mode-tools-scripts
41 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44 Laptop mode (also known as laptopmode, laptop-mode and laptop_mode,
45 for search engine purposes :) ) is a kernel "mode" that allows you to
46 extend the battery life of your laptop. It does this by intelligently
47 grouping write activity on your disks, so that only reads of uncached
48 data result in a disk spinup. It causes a significant improvement in
49 battery life (for usage patterns that allow it).
51 %description -l pl.UTF-8
52 Tryb laptopowy (laptop mode) to "tryb" pracy jądra umożliwiający
53 wydłużenie czasu życia baterii laptopa. Czyni to inteligentnie
54 grupując zapisy na dyski w ten sposób, że tylko odczyt
55 niezbuforowanych danych powoduje rozpędzenie dysku. Powoduje znaczącą
56 poprawę czasu życia baterii.
59 Summary: ACPI scripts for laptop mode tools
60 Summary(pl.UTF-8): Skrypty ACPI dla narzędzi do trybu laptopowego
61 Group: Applications/System
62 Requires: %{name} = %{version}-%{release}
64 Provides: %{name}-scripts = %{version}-%{release}
67 ACPI scripts for laptop mode tools.
69 %description acpi -l pl.UTF-8
70 Skrypty ACPI dla narzędzi do trybu laptopowego.
73 Summary: APM scripts for laptop mode tools
74 Summary(pl.UTF-8): Skrypty APM dla narzędzi do trybu laptopowego
75 Group: Applications/System
76 Requires: %{name} = %{version}-%{release}
78 Provides: %{name}-scripts = %{version}-%{release}
81 APM scripts for laptop mode tools.
83 %description apm -l pl.UTF-8
84 Skrypty APM dla narzędzi do trybu laptopowego.
87 Summary: GUI for laptop mode tools
88 Summary(pl.UTF-8): GUI dla narzędzi do trybu laptopowego
89 Group: Applications/X11
90 Requires: python-PyQt4
91 Requires: python-modules
92 Requires: %{name} = %{version}-%{release}
93 %if "%{_rpmversion}" >= "5"
98 GUI for laptop mode tools.
100 %description gui -l pl.UTF-8
101 GUI dla narzędzi do trybu laptopowego.
108 %{__sed} -i -e 's|/usr/bin/env python2|/usr/bin/python|' gui/LMT.py
111 rm -rf $RPM_BUILD_ROOT
112 install -d $RPM_BUILD_ROOT%{_bindir}
116 INIT_D=$RPM_BUILD_ROOT/etc/rc.d/init.d \
119 TMPFILES_D=/usr/lib/tmpfiles.d \
120 %{!?with_acpi:ACPI=disabled} \
121 %{!?with_apm:APM=disabled} \
122 DESTDIR=$RPM_BUILD_ROOT
124 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/laptop-mode
126 install -p gui/LMT.py $RPM_BUILD_ROOT%{_datadir}/%{name}/lmt.py
127 install -p gui/lmt-config-gui $RPM_BUILD_ROOT%{_bindir}/
130 rm -rf $RPM_BUILD_ROOT
133 /sbin/chkconfig --add laptop-mode
134 %service laptop-mode restart
137 if [ "$1" = "0" ]; then
138 %service laptop-mode stop
139 /sbin/chkconfig --del laptop-mode
143 %defattr(644,root,root,755)
144 %doc README.md Documentation/*
145 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/laptop-mode/*.conf
146 %dir %{_sysconfdir}/laptop-mode
147 %dir %{_sysconfdir}/laptop-mode/batt-start
148 %dir %{_sysconfdir}/laptop-mode/batt-stop
149 %dir %{_sysconfdir}/laptop-mode/conf.d
150 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/laptop-mode/conf.d/*.conf
151 %dir %{_sysconfdir}/laptop-mode/lm-ac-start
152 %dir %{_sysconfdir}/laptop-mode/lm-ac-stop
153 %dir %{_sysconfdir}/laptop-mode/nolm-ac-start
154 %dir %{_sysconfdir}/laptop-mode/nolm-ac-stop
155 %attr(754,root,root) /etc/rc.d/init.d/laptop-mode
156 %attr(755,root,root) /lib/udev/lmt-udev
157 /lib/udev/rules.d/99-laptop-mode.rules
158 /usr/lib/tmpfiles.d/laptop-mode.conf
159 /lib/systemd/system/laptop-mode.service
160 /lib/systemd/system/laptop-mode.timer
161 /lib/systemd/system/lmt-poll.service
162 %dir %{_libdir}/pm-utils/sleep.d
163 %attr(755,root,root) %{_libdir}/pm-utils/sleep.d/01laptop-mode
164 %dir %{_datadir}/%{name}
165 %dir %{_datadir}/%{name}/modules
166 %attr(755,root,root) %{_datadir}/%{name}/modules/*
167 %dir %{_datadir}/%{name}/module-helpers
168 %attr(755,root,root) %{_datadir}/%{name}/module-helpers/*
169 %attr(755,root,root) %{_sbindir}/laptop_mode
170 %attr(755,root,root) %{_sbindir}/lm-profiler
171 %attr(755,root,root) %{_sbindir}/lm-syslog-setup
172 %{_mandir}/man8/laptop_mode.8*
173 %{_mandir}/man8/lm-profiler.8*
174 %{_mandir}/man8/lm-syslog-setup.8*
176 %{_mandir}/man8/laptop-mode.conf.8*
177 %{_mandir}/man8/lm-profiler.conf.8*
180 # skip subpackage if only one backend built
181 %{?with_apm:%files acpi}
182 %defattr(644,root,root,755)
183 %attr(755,root,root) %{_sysconfdir}/acpi/actions/lm_*.sh
184 %{_sysconfdir}/acpi/events/lm_*
188 # skip subpackage if only one backend built
189 %{?with_acpi:%files apm}
190 %defattr(644,root,root,755)
192 %attr(755,root,root) %{_sysconfdir}/apm/event.d/laptop-mode
196 %defattr(644,root,root,755)
197 %{_datadir}/%{name}/lmt.py
198 %attr(755,root,root) %{_bindir}/lmt-config-gui
199 %{_datadir}/polkit-1/actions/org.linux.lmt.gui.policy