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?
10 %bcond_with apm # build apm package
11 %bcond_without acpi # build acpi package
13 %ifnarch %{ix86} %{x8664} ia64
16 %ifnarch %{ix86} %{arm} mips ppc sh
19 Summary: Laptop Mode Tools
20 Summary(pl.UTF-8): Narzędzia do trybu laptopowego
21 Name: laptop-mode-tools
25 Group: Applications/System
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
30 Patch0: no-exec-redirection.patch
31 Patch2: intel_perf_bias.patch
32 URL: https://github.com/rickysarraf/laptop-mode-tools
33 BuildRequires: rpm-build >= 4.6
34 BuildRequires: rpm-pythonprov
35 BuildRequires: rpmbuild(macros) >= 1.714
36 Requires(post,preun): /sbin/chkconfig
37 %if %{with apm} && %{with acpi}
38 Requires: %{name}-scripts = %{version}-%{release}
40 %{?with_acpi:Requires: acpid}
41 %{?with_apm:Requires: apmd}
42 Obsoletes: laptop-mode-tools-acpi < %{version}-%{release}
43 Obsoletes: laptop-mode-tools-apm < %{version}-%{release}
44 Obsoletes: laptop-mode-tools-scripts < %{version}-%{release}
47 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
49 # no binaries; not noarch because of libdir paths
50 %define _enable_debug_packages 0
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).
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.
68 Summary: ACPI scripts for laptop mode tools
69 Summary(pl.UTF-8): Skrypty ACPI dla narzędzi do trybu laptopowego
70 Group: Applications/System
71 Requires: %{name} = %{version}-%{release}
73 Provides: %{name}-scripts = %{version}-%{release}
76 ACPI scripts for laptop mode tools.
78 %description acpi -l pl.UTF-8
79 Skrypty ACPI dla narzędzi do trybu laptopowego.
82 Summary: APM scripts for laptop mode tools
83 Summary(pl.UTF-8): Skrypty APM dla narzędzi do trybu laptopowego
84 Group: Applications/System
85 Requires: %{name} = %{version}-%{release}
87 Provides: %{name}-scripts = %{version}-%{release}
90 APM scripts for laptop mode tools.
92 %description apm -l pl.UTF-8
93 Skrypty APM dla narzędzi do trybu laptopowego.
95 %package -n pm-utils-lmt
96 Summary: Laptop mode tools script for pm-utils
97 Group: Applications/System
98 Requires: %{name} = %{version}-%{release}
101 %description -n pm-utils-lmt
102 Laptop mode tools script for pm-utils.
105 Summary: GUI for laptop mode tools
106 Summary(pl.UTF-8): GUI dla narzędzi do trybu laptopowego
107 Group: Applications/X11
108 Requires: %{name} = %{version}-%{release}
109 Requires: python3-PyQt5
110 Requires: python3-modules
114 GUI for laptop mode tools.
116 %description gui -l pl.UTF-8
117 GUI dla narzędzi do trybu laptopowego.
120 %setup -q -n %{name}_%{version}
124 %{__sed} -i -e '1s|/usr/bin/env python3|%{__python3}|' gui/lmt.py
127 rm -rf $RPM_BUILD_ROOT
128 install -d $RPM_BUILD_ROOT{%{_bindir},%{_desktopdir}}
132 INIT_D=$RPM_BUILD_ROOT/etc/rc.d/init.d \
135 TMPFILES_D=%{systemdtmpfilesdir} \
136 %{!?with_acpi:ACPI=disabled} \
137 %{!?with_apm:APM=disabled} \
138 DESTDIR=$RPM_BUILD_ROOT
140 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/laptop-mode
143 rm -rf $RPM_BUILD_ROOT
146 /sbin/chkconfig --add laptop-mode
147 %service laptop-mode restart
150 if [ "$1" = "0" ]; then
151 %service laptop-mode stop
152 /sbin/chkconfig --del laptop-mode
156 %defattr(644,root,root,755)
157 %doc README.md Documentation/*
158 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/laptop-mode/*.conf
159 %dir %{_sysconfdir}/laptop-mode
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
168 %attr(754,root,root) /etc/rc.d/init.d/laptop-mode
169 %attr(755,root,root) /lib/udev/lmt-udev
170 /lib/udev/rules.d/99-laptop-mode.rules
171 %{systemdtmpfilesdir}/laptop-mode.conf
172 %{systemdunitdir}/laptop-mode.service
173 %{systemdunitdir}/laptop-mode.timer
174 %{systemdunitdir}/lmt-poll.service
175 %dir %{_datadir}/%{name}
176 %dir %{_datadir}/%{name}/modules
177 %attr(755,root,root) %{_datadir}/%{name}/modules/*
178 %dir %{_datadir}/%{name}/module-helpers
179 %attr(755,root,root) %{_datadir}/%{name}/module-helpers/*
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*
187 %{_mandir}/man8/laptop-mode.conf.8*
188 %{_mandir}/man8/lm-profiler.conf.8*
191 # skip subpackage if only one backend built
192 %{?with_apm:%files acpi}
193 %defattr(644,root,root,755)
194 %attr(755,root,root) %{_sysconfdir}/acpi/actions/lm_*.sh
195 %{_sysconfdir}/acpi/events/lm_*
199 # skip subpackage if only one backend built
200 %{?with_acpi:%files apm}
201 %defattr(644,root,root,755)
203 %attr(755,root,root) %{_sysconfdir}/apm/event.d/laptop-mode
206 %files -n pm-utils-lmt
207 %defattr(644,root,root,755)
208 %attr(755,root,root) %{_libdir}/pm-utils/sleep.d/01laptop-mode
211 %defattr(644,root,root,755)
212 %attr(755,root,root) %{_sbindir}/lmt-config-gui
213 %attr(755,root,root) %{_sbindir}/lmt-config-gui-pkexec
214 %{_datadir}/%{name}/lmt.py
215 %{_datadir}/polkit-1/actions/org.linux.lmt.gui.policy
216 %{_desktopdir}/laptop-mode-tools.desktop
217 %{_pixmapsdir}/laptop-mode-tools.svg