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 Patch0: %{name}-kver.patch
28 URL: http://www.samwel.tk/laptop_mode/
29 BuildRequires: rpmbuild(macros) >= 1.268
30 Requires(post,preun): /sbin/chkconfig
31 %if %{with apm} && %{with acpi}
32 Requires: %{name}-scripts = %{version}-%{release}
34 %{?with_acpi:Requires: acpid}
35 %{?with_apm:Requires: apmd}
36 Obsoletes: laptop-mode-tools-scripts
39 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
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).
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.
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}
62 Provides: %{name}-scripts = %{version}-%{release}
65 ACPI scripts for laptop mode tools.
67 %description acpi -l pl.UTF-8
68 Skrypty ACPI dla narzędzi do trybu laptopowego.
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}
76 Provides: %{name}-scripts = %{version}-%{release}
79 APM scripts for laptop mode tools.
81 %description apm -l pl.UTF-8
82 Skrypty APM dla narzędzi do trybu laptopowego.
85 %setup -q -n %{name}_%{version}
89 rm -rf $RPM_BUILD_ROOT
90 install -d $RPM_BUILD_ROOT/etc/{sysconfig,rc.d/init.d} \
91 $RPM_BUILD_ROOT{%{_mandir}/man8,%{_datadir}/%{name}/modules,%{_sbindir}} \
92 $RPM_BUILD_ROOT%{_sysconfdir}/laptop-mode/{{batt,lm-ac,nolm-ac}-{start,stop},conf.d} \
93 $RPM_BUILD_ROOT%{_varrun}/%{name}
95 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/laptop-mode
96 cp -a etc/laptop-mode/*.conf $RPM_BUILD_ROOT%{_sysconfdir}/laptop-mode
97 cp -a etc/laptop-mode/conf.d/*.conf $RPM_BUILD_ROOT%{_sysconfdir}/laptop-mode/conf.d
98 install usr/share/laptop-mode-tools/modules/* $RPM_BUILD_ROOT%{_datadir}/%{name}/modules
99 install -p usr/sbin/{laptop_mode,lm-syslog-setup,lm-profiler} $RPM_BUILD_ROOT%{_sbindir}
100 cp -a man/*.8 $RPM_BUILD_ROOT%{_mandir}/man8
103 install -d $RPM_BUILD_ROOT/etc/acpi/{actions,events}
104 install -p etc/acpi/actions/* $RPM_BUILD_ROOT/etc/acpi/actions
105 install -p etc/acpi/events/* $RPM_BUILD_ROOT/etc/acpi/events
109 install -d $RPM_BUILD_ROOT/etc/apm/event.d
110 install -p etc/apm/event.d/* $RPM_BUILD_ROOT/etc/apm/event.d
114 rm -rf $RPM_BUILD_ROOT
117 /sbin/chkconfig --add laptop-mode
118 %service laptop-mode restart
121 if [ "$1" = "0" ]; then
122 %service laptop-mode stop
123 /sbin/chkconfig --del laptop-mode
127 %defattr(644,root,root,755)
128 %doc README Documentation/*
129 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/laptop-mode/*.conf
130 %dir %{_sysconfdir}/laptop-mode
131 %dir %{_sysconfdir}/laptop-mode/batt-start
132 %dir %{_sysconfdir}/laptop-mode/batt-stop
133 %dir %{_sysconfdir}/laptop-mode/conf.d
134 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/laptop-mode/conf.d/*.conf
135 %dir %{_sysconfdir}/laptop-mode/lm-ac-start
136 %dir %{_sysconfdir}/laptop-mode/lm-ac-stop
137 %dir %{_sysconfdir}/laptop-mode/nolm-ac-start
138 %dir %{_sysconfdir}/laptop-mode/nolm-ac-stop
139 %attr(754,root,root) /etc/rc.d/init.d/laptop-mode
140 %dir %{_datadir}/%{name}
141 %dir %{_datadir}/%{name}/modules
142 %dir %{_varrun}/%{name}
143 %attr(755,root,root) %{_datadir}/%{name}/modules/*
144 %attr(755,root,root) %{_sbindir}/laptop_mode
145 %attr(755,root,root) %{_sbindir}/lm-profiler
146 %attr(755,root,root) %{_sbindir}/lm-syslog-setup
147 %{_mandir}/man8/laptop_mode.8*
148 %{_mandir}/man8/lm-profiler.8*
149 %{_mandir}/man8/lm-syslog-setup.8*
151 %{_mandir}/man8/laptop-mode.conf.8*
152 %{_mandir}/man8/lm-profiler.conf.8*
155 # skip subpackage if only one backend built
156 %{?with_apm:%files acpi}
157 %defattr(644,root,root,755)
158 %attr(755,root,root) %{_sysconfdir}/acpi/actions/lm_*.sh
159 %{_sysconfdir}/acpi/events/lm_*
163 # skip subpackage if only one backend built
164 %{?with_acpi:%files apm}
165 %defattr(644,root,root,755)
167 %attr(755,root,root) %{_sysconfdir}/apm/event.d/laptop-mode