]> git.pld-linux.org Git - packages/laptop-mode-tools.git/blob - laptop-mode-tools.spec
- mksh does not pass fds opened with exec redirecton to process
[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 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}
34 %else
35 %{?with_acpi:Requires:  acpid}
36 %{?with_apm:Requires:   apmd}
37 Obsoletes:      laptop-mode-tools-scripts
38 %endif
39 Suggests:       hdparm
40 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
42 %description
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).
49
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.
56
57 %package acpi
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}
62 Requires:       acpid
63 Provides:       %{name}-scripts = %{version}-%{release}
64
65 %description acpi
66 ACPI scripts for laptop mode tools.
67
68 %description acpi -l pl.UTF-8
69 Skrypty ACPI dla narzędzi do trybu laptopowego.
70
71 %package apm
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}
76 Requires:       apmd
77 Provides:       %{name}-scripts = %{version}-%{release}
78
79 %description apm
80 APM scripts for laptop mode tools.
81
82 %description apm -l pl.UTF-8
83 Skrypty APM dla narzędzi do trybu laptopowego.
84
85 %package gui
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"
93 BuildArch:      noarch
94 %endif
95
96 %description gui
97 GUI for laptop mode tools.
98
99 %description gui -l pl.UTF-8
100 GUI dla narzędzi do trybu laptopowego.
101
102 %prep
103 %setup -q
104 %patch0 -p1
105
106 %{__sed} -i -e 's|/usr/bin/env python2|/usr/bin/python|' gui/LMT.py
107
108 %install
109 rm -rf $RPM_BUILD_ROOT
110 install -d $RPM_BUILD_ROOT%{_bindir}
111
112 %{__make} install \
113         INSTALL=install \
114         INIT_D=$RPM_BUILD_ROOT/etc/rc.d/init.d \
115         ULIB_D=%{_libdir} \
116         MAN_D=%{_mandir} \
117         TMPFILES_D=/usr/lib/tmpfiles.d \
118         %{!?with_acpi:ACPI=disabled} \
119         %{!?with_apm:APM=disabled} \
120         DESTDIR=$RPM_BUILD_ROOT
121
122 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/laptop-mode
123
124 install -p gui/LMT.py $RPM_BUILD_ROOT%{_datadir}/%{name}/lmt.py
125 install -p gui/lmt-config-gui $RPM_BUILD_ROOT%{_bindir}/
126
127 %clean
128 rm -rf $RPM_BUILD_ROOT
129
130 %post
131 /sbin/chkconfig --add laptop-mode
132 %service laptop-mode restart
133
134 %preun
135 if [ "$1" = "0" ]; then
136         %service laptop-mode stop
137         /sbin/chkconfig --del laptop-mode
138 fi
139
140 %files
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*
173 # should be man5
174 %{_mandir}/man8/laptop-mode.conf.8*
175 %{_mandir}/man8/lm-profiler.conf.8*
176
177 %if %{with acpi}
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_*
183 %endif
184
185 %if %{with apm}
186 # skip subpackage if only one backend built
187 %{?with_acpi:%files apm}
188 %defattr(644,root,root,755)
189 # XXX: dir not owned
190 %attr(755,root,root) %{_sysconfdir}/apm/event.d/laptop-mode
191 %endif
192
193 %files gui
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
This page took 0.069726 seconds and 3 git commands to generate.