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: 8a7b3658b0137ce893fe6a224fffd7ba
27 Patch0: no-exec-redirection.patch
28 Patch1: cpufreq-pstate.patch
29 Patch2: intel_perf_bias.patch
30 URL: https://github.com/rickysarraf/laptop-mode-tools
31 BuildRequires: rpm-pythonprov
32 BuildRequires: rpmbuild(macros) >= 1.714
33 Requires(post,preun): /sbin/chkconfig
34 %if %{with apm} && %{with acpi}
35 Requires: %{name}-scripts = %{version}-%{release}
37 %{?with_acpi:Requires: acpid}
38 %{?with_apm:Requires: apmd}
39 Obsoletes: laptop-mode-tools-acpi < %{version}-%{release}
40 Obsoletes: laptop-mode-tools-apm < %{version}-%{release}
41 Obsoletes: laptop-mode-tools-scripts < %{version}-%{release}
44 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47 Laptop mode (also known as laptopmode, laptop-mode and laptop_mode,
48 for search engine purposes :) ) is a kernel "mode" that allows you to
49 extend the battery life of your laptop. It does this by intelligently
50 grouping write activity on your disks, so that only reads of uncached
51 data result in a disk spinup. It causes a significant improvement in
52 battery life (for usage patterns that allow it).
54 %description -l pl.UTF-8
55 Tryb laptopowy (laptop mode) to "tryb" pracy jądra umożliwiający
56 wydłużenie czasu życia baterii laptopa. Czyni to inteligentnie
57 grupując zapisy na dyski w ten sposób, że tylko odczyt
58 niezbuforowanych danych powoduje rozpędzenie dysku. Powoduje znaczącą
59 poprawę czasu życia baterii.
62 Summary: ACPI scripts for laptop mode tools
63 Summary(pl.UTF-8): Skrypty ACPI dla narzędzi do trybu laptopowego
64 Group: Applications/System
65 Requires: %{name} = %{version}-%{release}
67 Provides: %{name}-scripts = %{version}-%{release}
70 ACPI scripts for laptop mode tools.
72 %description acpi -l pl.UTF-8
73 Skrypty ACPI dla narzędzi do trybu laptopowego.
76 Summary: APM scripts for laptop mode tools
77 Summary(pl.UTF-8): Skrypty APM dla narzędzi do trybu laptopowego
78 Group: Applications/System
79 Requires: %{name} = %{version}-%{release}
81 Provides: %{name}-scripts = %{version}-%{release}
84 APM scripts for laptop mode tools.
86 %description apm -l pl.UTF-8
87 Skrypty APM dla narzędzi do trybu laptopowego.
89 %package -n pm-utils-lmt
90 Summary: Laptop mode tools script for pm-utils
91 Group: Applications/System
92 Requires: %{name} = %{version}-%{release}
95 %description -n pm-utils-lmt
96 Laptop mode tools script for pm-utils.
99 Summary: GUI for laptop mode tools
100 Summary(pl.UTF-8): GUI dla narzędzi do trybu laptopowego
101 Group: Applications/X11
102 Requires: python-PyQt4
103 Requires: python-modules
104 Requires: %{name} = %{version}-%{release}
108 GUI for laptop mode tools.
110 %description gui -l pl.UTF-8
111 GUI dla narzędzi do trybu laptopowego.
119 %{__sed} -i -e 's|/usr/bin/env python2|/usr/bin/python|' gui/LMT.py
122 rm -rf $RPM_BUILD_ROOT
123 install -d $RPM_BUILD_ROOT{%{_bindir},%{_desktopdir}}
127 INIT_D=$RPM_BUILD_ROOT/etc/rc.d/init.d \
130 TMPFILES_D=%{systemdtmpfilesdir} \
131 %{!?with_acpi:ACPI=disabled} \
132 %{!?with_apm:APM=disabled} \
133 DESTDIR=$RPM_BUILD_ROOT
135 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/laptop-mode
137 %{__mv} $RPM_BUILD_ROOT%{_datadir}/%{name}/{LMT,lmt}.py
140 rm -rf $RPM_BUILD_ROOT
143 /sbin/chkconfig --add laptop-mode
144 %service laptop-mode restart
147 if [ "$1" = "0" ]; then
148 %service laptop-mode stop
149 /sbin/chkconfig --del laptop-mode
153 %defattr(644,root,root,755)
154 %doc README.md Documentation/*
155 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/laptop-mode/*.conf
156 %dir %{_sysconfdir}/laptop-mode
157 %dir %{_sysconfdir}/laptop-mode/batt-start
158 %dir %{_sysconfdir}/laptop-mode/batt-stop
159 %dir %{_sysconfdir}/laptop-mode/conf.d
160 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/laptop-mode/conf.d/*.conf
161 %dir %{_sysconfdir}/laptop-mode/lm-ac-start
162 %dir %{_sysconfdir}/laptop-mode/lm-ac-stop
163 %dir %{_sysconfdir}/laptop-mode/nolm-ac-start
164 %dir %{_sysconfdir}/laptop-mode/nolm-ac-stop
165 %attr(754,root,root) /etc/rc.d/init.d/laptop-mode
166 %attr(755,root,root) /lib/udev/lmt-udev
167 /lib/udev/rules.d/99-laptop-mode.rules
168 %{systemdtmpfilesdir}/laptop-mode.conf
169 %{systemdunitdir}/laptop-mode.service
170 %{systemdunitdir}/laptop-mode.timer
171 %{systemdunitdir}/lmt-poll.service
172 %dir %{_datadir}/%{name}
173 %dir %{_datadir}/%{name}/modules
174 %attr(755,root,root) %{_datadir}/%{name}/modules/*
175 %dir %{_datadir}/%{name}/module-helpers
176 %attr(755,root,root) %{_datadir}/%{name}/module-helpers/*
177 %attr(755,root,root) %{_sbindir}/laptop_mode
178 %attr(755,root,root) %{_sbindir}/lm-profiler
179 %attr(755,root,root) %{_sbindir}/lm-syslog-setup
180 %{_mandir}/man8/laptop_mode.8*
181 %{_mandir}/man8/lm-profiler.8*
182 %{_mandir}/man8/lm-syslog-setup.8*
184 %{_mandir}/man8/laptop-mode.conf.8*
185 %{_mandir}/man8/lm-profiler.conf.8*
188 # skip subpackage if only one backend built
189 %{?with_apm:%files acpi}
190 %defattr(644,root,root,755)
191 %attr(755,root,root) %{_sysconfdir}/acpi/actions/lm_*.sh
192 %{_sysconfdir}/acpi/events/lm_*
196 # skip subpackage if only one backend built
197 %{?with_acpi:%files apm}
198 %defattr(644,root,root,755)
200 %attr(755,root,root) %{_sysconfdir}/apm/event.d/laptop-mode
203 %files -n pm-utils-lmt
204 %defattr(644,root,root,755)
205 %attr(755,root,root) %{_libdir}/pm-utils/sleep.d/01laptop-mode
208 %defattr(644,root,root,755)
209 %attr(755,root,root) %{_sbindir}/lmt-config-gui
210 %attr(755,root,root) %{_sbindir}/lmt-config-gui-pkexec
211 %{_datadir}/%{name}/lmt.py
212 %{_datadir}/polkit-1/actions/org.linux.lmt.gui.policy
213 %{_desktopdir}/laptop-mode-tools.desktop
214 %{_pixmapsdir}/laptop-mode-tools.svg