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