]> git.pld-linux.org Git - packages/laptop-mode-tools.git/blob - laptop-mode-tools.spec
- disable debug packages
[packages/laptop-mode-tools.git] / laptop-mode-tools.spec
1 # TODO:
2 # - unpackaged:
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?
8 #
9 # Conditional build:
10 %bcond_with     apm     # build apm package
11 %bcond_without  acpi    # build acpi package
12
13 %ifnarch %{ix86} %{x8664} ia64
14 %undefine               with_acpi
15 %endif
16 %ifnarch %{ix86} %{arm} mips ppc sh
17 %undefine               with_apm
18 %endif
19 Summary:        Laptop Mode Tools
20 Summary(pl.UTF-8):      Narzędzia do trybu laptopowego
21 Name:           laptop-mode-tools
22 Version:        1.74
23 Release:        1
24 License:        GPL v2+
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
29 Source1:        %{name}.init
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}
39 %else
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}
45 %endif
46 Suggests:       hdparm
47 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
48
49 # no binaries; not noarch because of libdir paths
50 %define         _enable_debug_packages  0
51
52 %description
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).
59
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.
66
67 %package acpi
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}
72 Requires:       acpid
73 Provides:       %{name}-scripts = %{version}-%{release}
74
75 %description acpi
76 ACPI scripts for laptop mode tools.
77
78 %description acpi -l pl.UTF-8
79 Skrypty ACPI dla narzędzi do trybu laptopowego.
80
81 %package apm
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}
86 Requires:       apmd
87 Provides:       %{name}-scripts = %{version}-%{release}
88
89 %description apm
90 APM scripts for laptop mode tools.
91
92 %description apm -l pl.UTF-8
93 Skrypty APM dla narzędzi do trybu laptopowego.
94
95 %package -n pm-utils-lmt
96 Summary:        Laptop mode tools script for pm-utils
97 Group:          Applications/System
98 Requires:       %{name} = %{version}-%{release}
99 Requires:       pm-utils
100
101 %description -n pm-utils-lmt
102 Laptop mode tools script for pm-utils.
103
104 %package gui
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
111 BuildArch:      noarch
112
113 %description gui
114 GUI for laptop mode tools.
115
116 %description gui -l pl.UTF-8
117 GUI dla narzędzi do trybu laptopowego.
118
119 %prep
120 %setup -q -n %{name}_%{version}
121 %patch0 -p1
122 %patch2 -p1
123
124 %{__sed} -i -e '1s|/usr/bin/env python3|%{__python3}|' gui/lmt.py
125
126 %install
127 rm -rf $RPM_BUILD_ROOT
128 install -d $RPM_BUILD_ROOT{%{_bindir},%{_desktopdir}}
129
130 %{__make} install \
131         INSTALL=install \
132         INIT_D=$RPM_BUILD_ROOT/etc/rc.d/init.d \
133         ULIB_D=%{_libdir} \
134         MAN_D=%{_mandir} \
135         TMPFILES_D=%{systemdtmpfilesdir} \
136         %{!?with_acpi:ACPI=disabled} \
137         %{!?with_apm:APM=disabled} \
138         DESTDIR=$RPM_BUILD_ROOT
139
140 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/laptop-mode
141
142 %clean
143 rm -rf $RPM_BUILD_ROOT
144
145 %post
146 /sbin/chkconfig --add laptop-mode
147 %service laptop-mode restart
148
149 %preun
150 if [ "$1" = "0" ]; then
151         %service laptop-mode stop
152         /sbin/chkconfig --del laptop-mode
153 fi
154
155 %files
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*
186 # should be man5
187 %{_mandir}/man8/laptop-mode.conf.8*
188 %{_mandir}/man8/lm-profiler.conf.8*
189
190 %if %{with acpi}
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_*
196 %endif
197
198 %if %{with apm}
199 # skip subpackage if only one backend built
200 %{?with_acpi:%files apm}
201 %defattr(644,root,root,755)
202 # XXX: dir not owned
203 %attr(755,root,root) %{_sysconfdir}/apm/event.d/laptop-mode
204 %endif
205
206 %files -n pm-utils-lmt
207 %defattr(644,root,root,755)
208 %attr(755,root,root) %{_libdir}/pm-utils/sleep.d/01laptop-mode
209
210 %files gui
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
This page took 0.489843 seconds and 3 git commands to generate.