3 %bcond_with apm # build apm package
4 %bcond_without acpi # build acpi package
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?
11 %ifnarch %{ix86} %{x8664} ia64
14 %ifnarch %{ix86} arm mips ppc sh
17 Summary: Laptop Mode Tools
18 Summary(pl.UTF-8): Narzędzia do trybu laptopowego
19 Name: laptop-mode-tools
23 Group: Applications/System
24 Source0: http://samwel.tk/laptop_mode/tools/downloads/%{name}_%{version}.tar.gz
25 # Source0-md5: c7a234ada284eaaece0e04bd260e87af
27 Source2: %{name}.tmpfiles
28 Patch0: %{name}-kver.patch
29 URL: http://www.samwel.tk/laptop_mode/
30 BuildRequires: rpmbuild(macros) >= 1.268
31 Requires(post,preun): /sbin/chkconfig
32 %if %{with apm} && %{with acpi}
33 Requires: %{name}-scripts = %{version}-%{release}
35 %{?with_acpi:Requires: acpid}
36 %{?with_apm:Requires: apmd}
37 Obsoletes: laptop-mode-tools-scripts
40 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
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).
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.
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}
63 Provides: %{name}-scripts = %{version}-%{release}
66 ACPI scripts for laptop mode tools.
68 %description acpi -l pl.UTF-8
69 Skrypty ACPI dla narzędzi do trybu laptopowego.
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}
77 Provides: %{name}-scripts = %{version}-%{release}
80 APM scripts for laptop mode tools.
82 %description apm -l pl.UTF-8
83 Skrypty APM dla narzędzi do trybu laptopowego.
86 %setup -q -n %{name}_%{version}
90 rm -rf $RPM_BUILD_ROOT
91 install -d $RPM_BUILD_ROOT/etc/{sysconfig,rc.d/init.d} \
92 $RPM_BUILD_ROOT{%{_mandir}/man8,%{_datadir}/%{name}/modules,%{_sbindir}} \
93 $RPM_BUILD_ROOT%{_sysconfdir}/laptop-mode/{{batt,lm-ac,nolm-ac}-{start,stop},conf.d} \
94 $RPM_BUILD_ROOT%{_varrun}/%{name} \
95 $RPM_BUILD_ROOT/usr/lib/tmpfiles.d
97 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/laptop-mode
98 cp -a etc/laptop-mode/*.conf $RPM_BUILD_ROOT%{_sysconfdir}/laptop-mode
99 cp -a etc/laptop-mode/conf.d/*.conf $RPM_BUILD_ROOT%{_sysconfdir}/laptop-mode/conf.d
100 install usr/share/laptop-mode-tools/modules/* $RPM_BUILD_ROOT%{_datadir}/%{name}/modules
101 install -p usr/sbin/{laptop_mode,lm-syslog-setup,lm-profiler} $RPM_BUILD_ROOT%{_sbindir}
102 cp -a man/*.8 $RPM_BUILD_ROOT%{_mandir}/man8
104 install %{SOURCE2} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/%{name}.conf
107 install -d $RPM_BUILD_ROOT/etc/acpi/{actions,events}
108 install -p etc/acpi/actions/* $RPM_BUILD_ROOT/etc/acpi/actions
109 install -p etc/acpi/events/* $RPM_BUILD_ROOT/etc/acpi/events
113 install -d $RPM_BUILD_ROOT/etc/apm/event.d
114 install -p etc/apm/event.d/* $RPM_BUILD_ROOT/etc/apm/event.d
118 rm -rf $RPM_BUILD_ROOT
121 /sbin/chkconfig --add laptop-mode
122 %service laptop-mode restart
125 if [ "$1" = "0" ]; then
126 %service laptop-mode stop
127 /sbin/chkconfig --del laptop-mode
131 %defattr(644,root,root,755)
132 %doc README Documentation/*
133 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/laptop-mode/*.conf
134 %dir %{_sysconfdir}/laptop-mode
135 %dir %{_sysconfdir}/laptop-mode/batt-start
136 %dir %{_sysconfdir}/laptop-mode/batt-stop
137 %dir %{_sysconfdir}/laptop-mode/conf.d
138 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/laptop-mode/conf.d/*.conf
139 %dir %{_sysconfdir}/laptop-mode/lm-ac-start
140 %dir %{_sysconfdir}/laptop-mode/lm-ac-stop
141 %dir %{_sysconfdir}/laptop-mode/nolm-ac-start
142 %dir %{_sysconfdir}/laptop-mode/nolm-ac-stop
143 %attr(754,root,root) /etc/rc.d/init.d/laptop-mode
144 %dir %{_datadir}/%{name}
145 %dir %{_datadir}/%{name}/modules
146 %dir %{_varrun}/%{name}
147 /usr/lib/tmpfiles.d/%{name}.conf
148 %attr(755,root,root) %{_datadir}/%{name}/modules/*
149 %attr(755,root,root) %{_sbindir}/laptop_mode
150 %attr(755,root,root) %{_sbindir}/lm-profiler
151 %attr(755,root,root) %{_sbindir}/lm-syslog-setup
152 %{_mandir}/man8/laptop_mode.8*
153 %{_mandir}/man8/lm-profiler.8*
154 %{_mandir}/man8/lm-syslog-setup.8*
156 %{_mandir}/man8/laptop-mode.conf.8*
157 %{_mandir}/man8/lm-profiler.conf.8*
160 # skip subpackage if only one backend built
161 %{?with_apm:%files acpi}
162 %defattr(644,root,root,755)
163 %attr(755,root,root) %{_sysconfdir}/acpi/actions/lm_*.sh
164 %{_sysconfdir}/acpi/events/lm_*
168 # skip subpackage if only one backend built
169 %{?with_acpi:%files apm}
170 %defattr(644,root,root,755)
172 %attr(755,root,root) %{_sysconfdir}/apm/event.d/laptop-mode