]>
Commit | Line | Data |
---|---|---|
21cec536 ER |
1 | # TODO: |
2 | # - better event handling in power.sh | |
3 | # - better default configuration of events in /etc/acpi | |
4 | # - processor and fan module support (?) | |
beca40f2 ER |
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 | |
e5bcd3b5 | 10 | Summary: ACPI Event Daemon |
e0dc1852 | 11 | Summary(pl.UTF-8): Demon zdarzeń ACPI |
e5bcd3b5 | 12 | Name: acpid |
beca40f2 ER |
13 | Version: 2.0.3 |
14 | Release: 0.2 | |
2c9e8004 | 15 | License: GPL v2+ |
e5bcd3b5 | 16 | Group: Daemons |
beca40f2 ER |
17 | Source0: http://tedfelix.com/linux/%{name}-%{version}.tar.gz |
18 | # Source0-md5: 6242a20d86cf0223db6fa0d58488e274 | |
258a99b0 PG |
19 | Source1: %{name}.init |
20 | Source2: %{name}.sysconfig | |
3f9b4ca2 | 21 | Source3: %{name}.logrotate |
393dd5c2 | 22 | Source4: %{name}.button.conf |
23 | Source5: %{name}.battery.conf | |
24 | Source6: %{name}.button.sh | |
25 | Source7: %{name}.battery.sh | |
beca40f2 | 26 | URL: http://tedfelix.com/linux/acpid-netlink.html |
d26689d0 | 27 | BuildRequires: rpmbuild(macros) >= 1.268 |
8c4ef41e | 28 | Requires(post,preun): /sbin/chkconfig |
d26689d0 | 29 | Requires: rc-scripts |
2c9e8004 JB |
30 | Provides: acpi-daemon |
31 | Obsoletes: acpi-daemon | |
32 | Obsoletes: apm-daemon | |
33 | ExclusiveArch: %{ix86} %{x8664} ia64 | |
e5bcd3b5 | 34 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
11f5d39c AM |
35 | |
36 | %description | |
37 | acpid is a daemon that dispatches ACPI events to user-space programs. | |
38 | ||
6d2541a2 | 39 | %description -l pl.UTF-8 |
cd3a030e | 40 | acpid to demon przekazujący zdarzenia ACPI do programów w user-space. |
dd33996b MM |
41 | |
42 | %package policy | |
43 | Summary: ACPID policy files | |
cd3a030e | 44 | Summary(pl.UTF-8): Pliki z polityką dla ACPID |
dd33996b | 45 | Group: Daemons |
cd3a030e | 46 | Requires: %{name} = %{version}-%{release} |
dd33996b MM |
47 | |
48 | %description policy | |
49 | This package contains scripts and configuration files which allow | |
cd3a030e | 50 | ACPID to take action on incoming ACPI events (eg. to run a script that |
dd33996b MM |
51 | suspends the system when the power button is pressed). |
52 | ||
53 | Notice: on most current systems you DO NOT want this package | |
54 | installed, since there are other software packages responsible for | |
cd3a030e | 55 | handling ACPI events (one example being gnome-power-manager) and |
dd33996b MM |
56 | having ACPID also respond will lead to problems. In such cases ACPID |
57 | should only act as a message broker. | |
58 | ||
59 | %description policy -l pl.UTF-8 | |
cd3a030e | 60 | Ten pakiet zawiera skrypty i pliki konfiguracyjne, które umożliwiają |
ffb56f1a ER |
61 | demonowi ACPI wykonywanie operacji na podstawie przychodzących zdarzeń |
62 | ACPI (np. uruchomienie skryptu usypiającego system, gdy użytkownik | |
63 | naciśnie przycisk zasilania). | |
dd33996b | 64 | |
cd3a030e JB |
65 | Uwaga: na większości obecnych systemów NIE NALEŻY instalować tego |
66 | pakietu, gdyż za reagowanie na zdarzenia ACPI są w nich odpowiedzialne | |
67 | inne programy (np. gnome-power-manager), więc ACPID by tylko | |
68 | przeszkadzał. W takich przypadkach demon ACPI powinien działać | |
69 | wyłącznie jako dyspozytor wiadomości. | |
11f5d39c AM |
70 | |
71 | %prep | |
e5bcd3b5 | 72 | %setup -q |
11f5d39c AM |
73 | |
74 | %build | |
8e1353a0 ER |
75 | %{__make} \ |
76 | CC="%{__cc}" \ | |
ffb56f1a | 77 | LDFLAGS="%{rpmldflags}" \ |
97461ed1 | 78 | CFLAGS='-Wall -Werror %{rpmcflags} -D_GNU_SOURCE $(DEFS)' |
11f5d39c AM |
79 | |
80 | %install | |
81 | rm -rf $RPM_BUILD_ROOT | |
eacfdd80 | 82 | install -d $RPM_BUILD_ROOT{%{_sysconfdir}/{logrotate.d,rc.d/init.d,sysconfig},/var/log} \ |
ffb56f1a ER |
83 | $RPM_BUILD_ROOT{%{_sysconfdir}/acpi/{events,actions},%{_sbindir},%{_bindir},%{_mandir}/man8} |
84 | ||
85 | install -p acpid $RPM_BUILD_ROOT%{_sbindir} | |
86 | install -p acpi_listen $RPM_BUILD_ROOT%{_bindir} | |
87 | cp -a acpid.8 acpi_listen.8 $RPM_BUILD_ROOT%{_mandir}/man8 | |
88 | install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/acpid | |
89 | cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/acpid | |
90 | cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/acpid | |
beca40f2 ER |
91 | cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/acpi/events/button |
92 | cp -a %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/acpi/events/battery | |
ffb56f1a ER |
93 | install -p %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/acpi/actions/button.sh |
94 | install -p %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/acpi/actions/battery.sh | |
3f9b4ca2 | 95 | > $RPM_BUILD_ROOT/var/log/acpid |
11f5d39c | 96 | |
e5bcd3b5 JB |
97 | %clean |
98 | rm -rf $RPM_BUILD_ROOT | |
11f5d39c AM |
99 | |
100 | %post | |
e5bcd3b5 | 101 | /sbin/chkconfig --add acpid |
d26689d0 | 102 | %service acpid restart "ACPI daemon" |
11f5d39c AM |
103 | |
104 | %preun | |
11f5d39c | 105 | if [ "$1" = "0" ]; then |
d26689d0 | 106 | %service acpid stop |
11f5d39c AM |
107 | /sbin/chkconfig --del acpid |
108 | fi | |
e5bcd3b5 | 109 | |
11b701eb ER |
110 | %triggerpostun -- %{name} < 1.0.4-4 |
111 | %banner -e %{name} << 'EOF' | |
393dd5c2 | 112 | Default configuration files have changed. |
1916c5da | 113 | You might want to review your configuration in /etc/acpi |
393dd5c2 | 114 | EOF |
63950c22 | 115 | |
e5bcd3b5 JB |
116 | %files |
117 | %defattr(644,root,root,755) | |
893b1623 | 118 | %doc Changelog README TODO |
2c9e8004 | 119 | %attr(755,root,root) %{_sbindir}/acpid |
ffb56f1a | 120 | %attr(755,root,root) %{_bindir}/acpi_listen |
e5bcd3b5 JB |
121 | %dir %{_sysconfdir}/acpi |
122 | %dir %{_sysconfdir}/acpi/events | |
123 | %dir %{_sysconfdir}/acpi/actions | |
893b1623 | 124 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/acpid |
f9bd0618 | 125 | %attr(754,root,root) /etc/rc.d/init.d/acpid |
893b1623 | 126 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/acpid |
3f9b4ca2 | 127 | %attr(640,root,root) %ghost /var/log/acpid |
3c10aae9 | 128 | %{_mandir}/man8/acpid.8* |
ffb56f1a | 129 | %{_mandir}/man8/acpi_listen.8* |
dd33996b MM |
130 | |
131 | %files policy | |
132 | %defattr(644,root,root,755) | |
beca40f2 ER |
133 | %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/acpi/events/button |
134 | %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/acpi/events/battery | |
dd33996b | 135 | %attr(754,root,root) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/acpi/actions/*.sh |