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}.tar.gz
25 # Source0-md5: 8b9a2d9db7dd9d0a99b635a1185f292c
27 Patch0: no-exec-redirection.patch
28 URL: https://github.com/rickysarraf/laptop-mode-tools
29 BuildRequires: rpm-pythonprov
30 BuildRequires: rpmbuild(macros) >= 1.714
31 Requires(post,preun): /sbin/chkconfig
32 %if %{with apm} && %{with acpi}
33 Requires: %{name}-scripts = %{version}-%{release}
35 %{?with_acpi:Requires: acpid}
36 %{?with_apm:Requires: apmd}
37 Obsoletes: laptop-mode-tools-scripts
40 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43 Laptop mode (also known as laptopmode, laptop-mode and laptop_mode,
44 for search engine purposes :) ) is a kernel "mode" that allows you to
45 extend the battery life of your laptop. It does this by intelligently
46 grouping write activity on your disks, so that only reads of uncached
47 data result in a disk spinup. It causes a significant improvement in
48 battery life (for usage patterns that allow it).
50 %description -l pl.UTF-8
51 Tryb laptopowy (laptop mode) to "tryb" pracy jądra umożliwiający
52 wydłużenie czasu życia baterii laptopa. Czyni to inteligentnie
53 grupując zapisy na dyski w ten sposób, że tylko odczyt
54 niezbuforowanych danych powoduje rozpędzenie dysku. Powoduje znaczącą
55 poprawę czasu życia baterii.
58 Summary: ACPI scripts for laptop mode tools
59 Summary(pl.UTF-8): Skrypty ACPI dla narzędzi do trybu laptopowego
60 Group: Applications/System
61 Requires: %{name} = %{version}-%{release}
63 Provides: %{name}-scripts = %{version}-%{release}
66 ACPI scripts for laptop mode tools.
68 %description acpi -l pl.UTF-8
69 Skrypty ACPI dla narzędzi do trybu laptopowego.
72 Summary: APM scripts for laptop mode tools
73 Summary(pl.UTF-8): Skrypty APM dla narzędzi do trybu laptopowego
74 Group: Applications/System
75 Requires: %{name} = %{version}-%{release}
77 Provides: %{name}-scripts = %{version}-%{release}
80 APM scripts for laptop mode tools.
82 %description apm -l pl.UTF-8
83 Skrypty APM dla narzędzi do trybu laptopowego.
86 Summary: GUI for laptop mode tools
87 Summary(pl.UTF-8): GUI dla narzędzi do trybu laptopowego
88 Group: Applications/X11
89 Requires: python-PyQt4
90 Requires: python-modules
91 Requires: %{name} = %{version}-%{release}
92 %if "%{_rpmversion}" >= "5"
97 GUI for laptop mode tools.
99 %description gui -l pl.UTF-8
100 GUI dla narzędzi do trybu laptopowego.
106 %{__sed} -i -e 's|/usr/bin/env python2|/usr/bin/python|' gui/LMT.py
109 rm -rf $RPM_BUILD_ROOT
110 install -d $RPM_BUILD_ROOT%{_bindir}
114 INIT_D=$RPM_BUILD_ROOT/etc/rc.d/init.d \
117 TMPFILES_D=/usr/lib/tmpfiles.d \
118 %{!?with_acpi:ACPI=disabled} \
119 %{!?with_apm:APM=disabled} \
120 DESTDIR=$RPM_BUILD_ROOT
122 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/laptop-mode
124 install -p gui/LMT.py $RPM_BUILD_ROOT%{_datadir}/%{name}/lmt.py
125 install -p gui/lmt-config-gui $RPM_BUILD_ROOT%{_bindir}/
128 rm -rf $RPM_BUILD_ROOT
131 /sbin/chkconfig --add laptop-mode
132 %service laptop-mode restart
135 if [ "$1" = "0" ]; then
136 %service laptop-mode stop
137 /sbin/chkconfig --del laptop-mode
141 %defattr(644,root,root,755)
142 %doc README.md Documentation/*
143 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/laptop-mode/*.conf
144 %dir %{_sysconfdir}/laptop-mode
145 %dir %{_sysconfdir}/laptop-mode/batt-start
146 %dir %{_sysconfdir}/laptop-mode/batt-stop
147 %dir %{_sysconfdir}/laptop-mode/conf.d
148 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/laptop-mode/conf.d/*.conf
149 %dir %{_sysconfdir}/laptop-mode/lm-ac-start
150 %dir %{_sysconfdir}/laptop-mode/lm-ac-stop
151 %dir %{_sysconfdir}/laptop-mode/nolm-ac-start
152 %dir %{_sysconfdir}/laptop-mode/nolm-ac-stop
153 %attr(754,root,root) /etc/rc.d/init.d/laptop-mode
154 %attr(755,root,root) /lib/udev/lmt-udev
155 /lib/udev/rules.d/99-laptop-mode.rules
156 /usr/lib/tmpfiles.d/laptop-mode.conf
157 /lib/systemd/system/laptop-mode.service
158 /lib/systemd/system/laptop-mode.timer
159 /lib/systemd/system/lmt-poll.service
160 %dir %{_libdir}/pm-utils/sleep.d
161 %attr(755,root,root) %{_libdir}/pm-utils/sleep.d/01laptop-mode
162 %dir %{_datadir}/%{name}
163 %dir %{_datadir}/%{name}/modules
164 %attr(755,root,root) %{_datadir}/%{name}/modules/*
165 %dir %{_datadir}/%{name}/module-helpers
166 %attr(755,root,root) %{_datadir}/%{name}/module-helpers/*
167 %attr(755,root,root) %{_sbindir}/laptop_mode
168 %attr(755,root,root) %{_sbindir}/lm-profiler
169 %attr(755,root,root) %{_sbindir}/lm-syslog-setup
170 %{_mandir}/man8/laptop_mode.8*
171 %{_mandir}/man8/lm-profiler.8*
172 %{_mandir}/man8/lm-syslog-setup.8*
174 %{_mandir}/man8/laptop-mode.conf.8*
175 %{_mandir}/man8/lm-profiler.conf.8*
178 # skip subpackage if only one backend built
179 %{?with_apm:%files acpi}
180 %defattr(644,root,root,755)
181 %attr(755,root,root) %{_sysconfdir}/acpi/actions/lm_*.sh
182 %{_sysconfdir}/acpi/events/lm_*
186 # skip subpackage if only one backend built
187 %{?with_acpi:%files apm}
188 %defattr(644,root,root,755)
190 %attr(755,root,root) %{_sysconfdir}/apm/event.d/laptop-mode
194 %defattr(644,root,root,755)
195 %{_datadir}/%{name}/lmt.py
196 %attr(755,root,root) %{_bindir}/lmt-config-gui
197 %{_datadir}/polkit-1/actions/org.linux.lmt.gui.policy