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