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