]>
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 | |
3f3c20dc | 10 | # - build and package kacpimon |
e5bcd3b5 | 11 | Summary: ACPI Event Daemon |
e0dc1852 | 12 | Summary(pl.UTF-8): Demon zdarzeń ACPI |
e5bcd3b5 | 13 | Name: acpid |
a8549c1d | 14 | Version: 2.0.10 |
f1c2225b | 15 | Release: 15 |
2c9e8004 | 16 | License: GPL v2+ |
e5bcd3b5 | 17 | Group: Daemons |
beca40f2 | 18 | Source0: http://tedfelix.com/linux/%{name}-%{version}.tar.gz |
a8549c1d | 19 | # Source0-md5: d5dd88bcfaa4a0bf51905e95115da6df |
258a99b0 PG |
20 | Source1: %{name}.init |
21 | Source2: %{name}.sysconfig | |
3f9b4ca2 | 22 | Source3: %{name}.logrotate |
393dd5c2 | 23 | Source4: %{name}.button.conf |
24 | Source5: %{name}.battery.conf | |
25 | Source6: %{name}.button.sh | |
26 | Source7: %{name}.battery.sh | |
513e3ad0 | 27 | Source8: %{name}.upstart |
914b6166 | 28 | Source9: %{name}.service |
14aa70d3 | 29 | Source10: %{name}.preconfig |
beca40f2 | 30 | URL: http://tedfelix.com/linux/acpid-netlink.html |
f1c2225b | 31 | BuildRequires: rpmbuild(macros) >= 1.647 |
8c4ef41e | 32 | Requires(post,preun): /sbin/chkconfig |
f1c2225b | 33 | Requires(post,preun,postun): systemd-units >= 38 |
d80b7c34 | 34 | Requires: rc-scripts >= 0.4.3.0 |
f1c2225b | 35 | Requires: systemd-units >= 38 |
2c9e8004 JB |
36 | Provides: acpi-daemon |
37 | Obsoletes: acpi-daemon | |
38 | Obsoletes: apm-daemon | |
39 | ExclusiveArch: %{ix86} %{x8664} ia64 | |
e5bcd3b5 | 40 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
11f5d39c AM |
41 | |
42 | %description | |
43 | acpid is a daemon that dispatches ACPI events to user-space programs. | |
44 | ||
6d2541a2 | 45 | %description -l pl.UTF-8 |
d35e6720 JB |
46 | acpid to demon przekazujący zdarzenia ACPI do programów w przestrzeni |
47 | użytkownika. | |
dd33996b MM |
48 | |
49 | %package policy | |
50 | Summary: ACPID policy files | |
cd3a030e | 51 | Summary(pl.UTF-8): Pliki z polityką dla ACPID |
dd33996b | 52 | Group: Daemons |
cd3a030e | 53 | Requires: %{name} = %{version}-%{release} |
dd33996b MM |
54 | |
55 | %description policy | |
56 | This package contains scripts and configuration files which allow | |
cd3a030e | 57 | ACPID to take action on incoming ACPI events (eg. to run a script that |
dd33996b MM |
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 | |
cd3a030e | 62 | handling ACPI events (one example being gnome-power-manager) and |
dd33996b MM |
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 | |
cd3a030e | 67 | Ten pakiet zawiera skrypty i pliki konfiguracyjne, które umożliwiają |
ffb56f1a ER |
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). | |
dd33996b | 71 | |
cd3a030e JB |
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. | |
11f5d39c AM |
77 | |
78 | %prep | |
e5bcd3b5 | 79 | %setup -q |
11f5d39c AM |
80 | |
81 | %build | |
8e1353a0 ER |
82 | %{__make} \ |
83 | CC="%{__cc}" \ | |
830eabe3 | 84 | LDFLAGS="%{rpmcflags} %{rpmldflags}" \ |
85 | OPT="%{rpmcppflags} %{rpmcflags} -Wno-error" | |
11f5d39c AM |
86 | |
87 | %install | |
88 | rm -rf $RPM_BUILD_ROOT | |
feb72aac | 89 | install -d $RPM_BUILD_ROOT{/etc/{logrotate.d,rc.d/init.d,sysconfig,init},/var/log} \ |
14aa70d3 JR |
90 | $RPM_BUILD_ROOT{%{_sysconfdir}/acpi/{events,actions},%{systemdunitdir}} \ |
91 | $RPM_BUILD_ROOT%{_datadir}/%{name} | |
3f3c20dc ER |
92 | |
93 | %{__make} install \ | |
94 | DESTDIR=$RPM_BUILD_ROOT | |
ffb56f1a | 95 | |
ffb56f1a | 96 | install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/acpid |
feb72aac ER |
97 | cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/acpid |
98 | cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/acpid | |
99 | cp -p %{SOURCE8} $RPM_BUILD_ROOT/etc/init/acpid.conf | |
100 | cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/acpi/events/button | |
101 | cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/acpi/events/battery | |
ffb56f1a ER |
102 | install -p %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/acpi/actions/button.sh |
103 | install -p %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/acpi/actions/battery.sh | |
914b6166 | 104 | install %{SOURCE9} $RPM_BUILD_ROOT%{systemdunitdir} |
14aa70d3 | 105 | install %{SOURCE10} $RPM_BUILD_ROOT%{_datadir}/%{name} |
914b6166 | 106 | |
3f9b4ca2 | 107 | > $RPM_BUILD_ROOT/var/log/acpid |
3f3c20dc | 108 | rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name} |
11f5d39c | 109 | |
e5bcd3b5 JB |
110 | %clean |
111 | rm -rf $RPM_BUILD_ROOT | |
11f5d39c AM |
112 | |
113 | %post | |
e5bcd3b5 | 114 | /sbin/chkconfig --add acpid |
d26689d0 | 115 | %service acpid restart "ACPI daemon" |
914b6166 | 116 | %systemd_post acpid.service |
11f5d39c AM |
117 | |
118 | %preun | |
11f5d39c | 119 | if [ "$1" = "0" ]; then |
d26689d0 | 120 | %service acpid stop |
11f5d39c AM |
121 | /sbin/chkconfig --del acpid |
122 | fi | |
914b6166 PG |
123 | %systemd_preun acpid.service |
124 | ||
125 | %postun | |
126 | %systemd_reload | |
e5bcd3b5 | 127 | |
0005777e | 128 | %triggerpostun -- %{name} < 2.0.10-12 |
14aa70d3 JR |
129 | if [ -f /etc/sysconfig/acpid ]; then |
130 | . /etc/sysconfig/acpid | |
131 | __PROGRAM_ARGS= | |
132 | [ "$NETLINK" = "yes" ] && __PROGRAM_ARGS="-n" | |
133 | [ -n "$CLIENTMAX" ] && __PROGRAM_ARGS="$__PROGRAM_ARGS -C $CLIENTMAX" | |
791e67f9 | 134 | if [ -n "$__PROGRAM_ARGS" ]; then |
e9143fad | 135 | %{__cp} -f /etc/sysconfig/acpid{,.rpmsave} |
791e67f9 JR |
136 | echo >>/etc/sysconfig/acpid |
137 | echo "# Added by rpm trigger" >>/etc/sysconfig/acpid | |
138 | echo "PROGRAM_ARGS=\"$PROGRAM_ARGS $__PROGRAM_ARGS\"" >>/etc/sysconfig/acpid | |
139 | fi | |
14aa70d3 | 140 | fi |
8cfce282 | 141 | %systemd_trigger acpid.service |
63950c22 | 142 | |
e5bcd3b5 JB |
143 | %files |
144 | %defattr(644,root,root,755) | |
3f3c20dc | 145 | %doc Changelog README TODO TESTPLAN |
2c9e8004 | 146 | %attr(755,root,root) %{_sbindir}/acpid |
ffb56f1a | 147 | %attr(755,root,root) %{_bindir}/acpi_listen |
e5bcd3b5 JB |
148 | %dir %{_sysconfdir}/acpi |
149 | %dir %{_sysconfdir}/acpi/events | |
150 | %dir %{_sysconfdir}/acpi/actions | |
893b1623 | 151 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/acpid |
f9bd0618 | 152 | %attr(754,root,root) /etc/rc.d/init.d/acpid |
893b1623 | 153 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/acpid |
feb72aac | 154 | %config(noreplace) %verify(not md5 mtime size) /etc/init/acpid.conf |
7bddd2e1 | 155 | %{systemdunitdir}/acpid.service |
3f9b4ca2 | 156 | %attr(640,root,root) %ghost /var/log/acpid |
3c10aae9 | 157 | %{_mandir}/man8/acpid.8* |
ffb56f1a | 158 | %{_mandir}/man8/acpi_listen.8* |
a161e82d | 159 | %dir %{_datadir}/%{name} |
14aa70d3 | 160 | %attr(755,root,root) %{_datadir}/%{name}/acpid.preconfig |
dd33996b MM |
161 | |
162 | %files policy | |
163 | %defattr(644,root,root,755) | |
beca40f2 ER |
164 | %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/acpi/events/button |
165 | %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/acpi/events/battery | |
dd33996b | 166 | %attr(754,root,root) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/acpi/actions/*.sh |