]>
Commit | Line | Data |
---|---|---|
1 | # TODO: | |
2 | # - better event handling in power.sh | |
3 | # - better default configuration of events in /etc/acpi | |
4 | # - processor and fan module support (?) | |
5 | # - run-parts(8)-like [A-Z...] regexp from Debian for config scan is evil as it | |
6 | # is locale dependant (http://www.gentoo.org/news/en/gwn/20060522-newsletter.xml#doc_chap2) | |
7 | # also it does not allow *.conf files (missing "."), which is not backward | |
8 | # compatible (custom files can be left unprocessed) | |
9 | # but if patch is made to allow ".", must consider to ignore .rpm{new,old,save} files | |
10 | Summary: ACPI Event Daemon | |
11 | Summary(pl.UTF-8): Demon zdarzeń ACPI | |
12 | Name: acpid | |
13 | Version: 2.0.34 | |
14 | Release: 1 | |
15 | License: GPL v2+ | |
16 | Group: Daemons | |
17 | Source0: http://downloads.sourceforge.net/acpid2/%{name}-%{version}.tar.xz | |
18 | # Source0-md5: 988c2e3fd5ba0ea4492d3ba7273af295 | |
19 | Source1: %{name}.init | |
20 | Source2: %{name}.sysconfig | |
21 | Source3: %{name}.logrotate | |
22 | Source4: %{name}.button.conf | |
23 | Source5: %{name}.battery.conf | |
24 | Source6: %{name}.button.sh | |
25 | Source7: %{name}.battery.sh | |
26 | Source9: %{name}.service | |
27 | Source10: %{name}.preconfig | |
28 | URL: http://sourceforge.net/projects/acpid2/ | |
29 | BuildRequires: rpmbuild(macros) >= 1.647 | |
30 | BuildRequires: tar >= 1:1.22 | |
31 | BuildRequires: xz | |
32 | Requires(post,preun): /sbin/chkconfig | |
33 | Requires(post,preun,postun): systemd-units >= 38 | |
34 | Requires: rc-scripts >= 0.4.3.0 | |
35 | Requires: systemd-units >= 38 | |
36 | Provides: acpi-daemon | |
37 | Obsoletes: acpi-daemon | |
38 | Obsoletes: apm-daemon | |
39 | ExclusiveArch: %{ix86} %{x8664} x32 ia64 | |
40 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
41 | ||
42 | %description | |
43 | acpid is a daemon that dispatches ACPI events to user-space programs. | |
44 | ||
45 | %description -l pl.UTF-8 | |
46 | acpid to demon przekazujący zdarzenia ACPI do programów w przestrzeni | |
47 | użytkownika. | |
48 | ||
49 | %package policy | |
50 | Summary: ACPID policy files | |
51 | Summary(pl.UTF-8): Pliki z polityką dla ACPID | |
52 | Group: Daemons | |
53 | Requires: %{name} = %{version}-%{release} | |
54 | ||
55 | %description policy | |
56 | This package contains scripts and configuration files which allow | |
57 | ACPID to take action on incoming ACPI events (eg. to run a script that | |
58 | suspends the system when the power button is pressed). | |
59 | ||
60 | Notice: on most current systems you DO NOT want this package | |
61 | installed, since there are other software packages responsible for | |
62 | handling ACPI events (one example being gnome-power-manager) and | |
63 | having ACPID also respond will lead to problems. In such cases ACPID | |
64 | should only act as a message broker. | |
65 | ||
66 | %description policy -l pl.UTF-8 | |
67 | Ten pakiet zawiera skrypty i pliki konfiguracyjne, które umożliwiają | |
68 | demonowi ACPI wykonywanie operacji na podstawie przychodzących zdarzeń | |
69 | ACPI (np. uruchomienie skryptu usypiającego system, gdy użytkownik | |
70 | naciśnie przycisk zasilania). | |
71 | ||
72 | Uwaga: na większości obecnych systemów NIE NALEŻY instalować tego | |
73 | pakietu, gdyż za reagowanie na zdarzenia ACPI są w nich odpowiedzialne | |
74 | inne programy (np. gnome-power-manager), więc ACPID by tylko | |
75 | przeszkadzał. W takich przypadkach demon ACPI powinien działać | |
76 | wyłącznie jako dyspozytor wiadomości. | |
77 | ||
78 | %prep | |
79 | %setup -q | |
80 | ||
81 | %build | |
82 | %configure | |
83 | ||
84 | %{__make} | |
85 | ||
86 | %install | |
87 | rm -rf $RPM_BUILD_ROOT | |
88 | install -d $RPM_BUILD_ROOT{/etc/{logrotate.d,rc.d/init.d,sysconfig,init},/var/log} \ | |
89 | $RPM_BUILD_ROOT{%{_sysconfdir}/acpi/{events,actions},%{systemdunitdir}} \ | |
90 | $RPM_BUILD_ROOT%{_datadir}/%{name} | |
91 | ||
92 | %{__make} install \ | |
93 | DESTDIR=$RPM_BUILD_ROOT | |
94 | ||
95 | install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/acpid | |
96 | cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/acpid | |
97 | cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/acpid | |
98 | cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/acpi/events/button | |
99 | cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/acpi/events/battery | |
100 | install -p %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/acpi/actions/button.sh | |
101 | install -p %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/acpi/actions/battery.sh | |
102 | install %{SOURCE9} $RPM_BUILD_ROOT%{systemdunitdir} | |
103 | install %{SOURCE10} $RPM_BUILD_ROOT%{_datadir}/%{name} | |
104 | ||
105 | > $RPM_BUILD_ROOT/var/log/acpid | |
106 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name} | |
107 | ||
108 | %clean | |
109 | rm -rf $RPM_BUILD_ROOT | |
110 | ||
111 | %post | |
112 | /sbin/chkconfig --add acpid | |
113 | %service acpid restart "ACPI daemon" | |
114 | %systemd_post acpid.service | |
115 | ||
116 | %preun | |
117 | if [ "$1" = "0" ]; then | |
118 | %service acpid stop | |
119 | /sbin/chkconfig --del acpid | |
120 | fi | |
121 | %systemd_preun acpid.service | |
122 | ||
123 | %postun | |
124 | %systemd_reload | |
125 | ||
126 | %triggerpostun -- %{name} < 2.0.10-12 | |
127 | if [ -f /etc/sysconfig/acpid ]; then | |
128 | . /etc/sysconfig/acpid | |
129 | __PROGRAM_ARGS= | |
130 | [ "$NETLINK" = "yes" ] && __PROGRAM_ARGS="-n" | |
131 | [ -n "$CLIENTMAX" ] && __PROGRAM_ARGS="$__PROGRAM_ARGS -C $CLIENTMAX" | |
132 | if [ -n "$__PROGRAM_ARGS" ]; then | |
133 | %{__cp} -f /etc/sysconfig/acpid{,.rpmsave} | |
134 | echo >>/etc/sysconfig/acpid | |
135 | echo "# Added by rpm trigger" >>/etc/sysconfig/acpid | |
136 | echo "PROGRAM_ARGS=\"$PROGRAM_ARGS $__PROGRAM_ARGS\"" >>/etc/sysconfig/acpid | |
137 | fi | |
138 | fi | |
139 | %systemd_trigger acpid.service | |
140 | ||
141 | %files | |
142 | %defattr(644,root,root,755) | |
143 | %doc Changelog README TESTPLAN TODO | |
144 | %attr(755,root,root) %{_sbindir}/acpid | |
145 | %attr(755,root,root) %{_sbindir}/kacpimon | |
146 | %attr(755,root,root) %{_bindir}/acpi_listen | |
147 | %dir %{_sysconfdir}/acpi | |
148 | %dir %{_sysconfdir}/acpi/events | |
149 | %dir %{_sysconfdir}/acpi/actions | |
150 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/acpid | |
151 | %attr(754,root,root) /etc/rc.d/init.d/acpid | |
152 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/acpid | |
153 | %{systemdunitdir}/acpid.service | |
154 | %attr(640,root,root) %ghost /var/log/acpid | |
155 | %{_mandir}/man8/acpid.8* | |
156 | %{_mandir}/man8/acpi_listen.8* | |
157 | %{_mandir}/man8/kacpimon.8* | |
158 | %dir %{_datadir}/%{name} | |
159 | %attr(755,root,root) %{_datadir}/%{name}/acpid.preconfig | |
160 | ||
161 | %files policy | |
162 | %defattr(644,root,root,755) | |
163 | %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/acpi/events/button | |
164 | %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/acpi/events/battery | |
165 | %attr(754,root,root) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/acpi/actions/*.sh |