]> git.pld-linux.org Git - packages/acpid.git/blob - acpid.spec
- rel 8
[packages/acpid.git] / acpid.spec
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 # - build and package kacpimon
11 Summary:        ACPI Event Daemon
12 Summary(pl.UTF-8):      Demon zdarzeń ACPI
13 Name:           acpid
14 Version:        2.0.10
15 Release:        8
16 License:        GPL v2+
17 Group:          Daemons
18 Source0:        http://tedfelix.com/linux/%{name}-%{version}.tar.gz
19 # Source0-md5:  d5dd88bcfaa4a0bf51905e95115da6df
20 Source1:        %{name}.init
21 Source2:        %{name}.sysconfig
22 Source3:        %{name}.logrotate
23 Source4:        %{name}.button.conf
24 Source5:        %{name}.battery.conf
25 Source6:        %{name}.button.sh
26 Source7:        %{name}.battery.sh
27 Source8:        %{name}.upstart
28 Source9:        %{name}.service
29 URL:            http://tedfelix.com/linux/acpid-netlink.html
30 BuildRequires:  rpmbuild(macros) >= 1.268
31 Requires(post,preun):   /sbin/chkconfig
32 Requires:       rc-scripts >= 0.4.3.0
33 Provides:       acpi-daemon
34 Obsoletes:      acpi-daemon
35 Obsoletes:      apm-daemon
36 ExclusiveArch:  %{ix86} %{x8664} ia64
37 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38
39 %description
40 acpid is a daemon that dispatches ACPI events to user-space programs.
41
42 %description -l pl.UTF-8
43 acpid to demon przekazujący zdarzenia ACPI do programów w przestrzeni
44 użytkownika.
45
46 %package policy
47 Summary:        ACPID policy files
48 Summary(pl.UTF-8):      Pliki z polityką dla ACPID
49 Group:          Daemons
50 Requires:       %{name} = %{version}-%{release}
51
52 %description policy
53 This package contains scripts and configuration files which allow
54 ACPID to take action on incoming ACPI events (eg. to run a script that
55 suspends the system when the power button is pressed).
56
57 Notice: on most current systems you DO NOT want this package
58 installed, since there are other software packages responsible for
59 handling ACPI events (one example being gnome-power-manager) and
60 having ACPID also respond will lead to problems. In such cases ACPID
61 should only act as a message broker.
62
63 %description policy -l pl.UTF-8
64 Ten pakiet zawiera skrypty i pliki konfiguracyjne, które umożliwiają
65 demonowi ACPI wykonywanie operacji na podstawie przychodzących zdarzeń
66 ACPI (np. uruchomienie skryptu usypiającego system, gdy użytkownik
67 naciśnie przycisk zasilania).
68
69 Uwaga: na większości obecnych systemów NIE NALEŻY instalować tego
70 pakietu, gdyż za reagowanie na zdarzenia ACPI są w nich odpowiedzialne
71 inne programy (np. gnome-power-manager), więc ACPID by tylko
72 przeszkadzał. W takich przypadkach demon ACPI powinien działać
73 wyłącznie jako dyspozytor wiadomości.
74
75 %prep
76 %setup -q
77
78 %build
79 %{__make} \
80         CC="%{__cc}" \
81         LDFLAGS="%{rpmcflags} %{rpmldflags}" \
82         OPT="%{rpmcppflags} %{rpmcflags} -Wno-error"
83
84 %install
85 rm -rf $RPM_BUILD_ROOT
86 install -d $RPM_BUILD_ROOT{/etc/{logrotate.d,rc.d/init.d,sysconfig,init},/var/log} \
87         $RPM_BUILD_ROOT{%{_sysconfdir}/acpi/{events,actions},%{systemdunitdir}}
88
89 %{__make} install \
90         DESTDIR=$RPM_BUILD_ROOT
91
92 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/acpid
93 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/acpid
94 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/acpid
95 cp -p %{SOURCE8} $RPM_BUILD_ROOT/etc/init/acpid.conf
96 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/acpi/events/button
97 cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/acpi/events/battery
98 install -p %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/acpi/actions/button.sh
99 install -p %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/acpi/actions/battery.sh
100 install %{SOURCE9} $RPM_BUILD_ROOT%{systemdunitdir}
101
102 > $RPM_BUILD_ROOT/var/log/acpid
103 rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name}
104
105 %clean
106 rm -rf $RPM_BUILD_ROOT
107
108 %post
109 /sbin/chkconfig --add acpid
110 %service acpid restart "ACPI daemon"
111 %systemd_post acpid.service
112
113 %preun
114 if [ "$1" = "0" ]; then
115         %service acpid stop
116         /sbin/chkconfig --del acpid
117 fi
118 %systemd_preun acpid.service
119
120 %postun
121 %systemd_reload
122
123 %triggerpostun -- %{name} < 2.0.10-6
124 %systemd_trigger acpid.service
125
126 %files
127 %defattr(644,root,root,755)
128 %doc Changelog README TODO TESTPLAN
129 %attr(755,root,root) %{_sbindir}/acpid
130 %attr(755,root,root) %{_bindir}/acpi_listen
131 %dir %{_sysconfdir}/acpi
132 %dir %{_sysconfdir}/acpi/events
133 %dir %{_sysconfdir}/acpi/actions
134 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/acpid
135 %attr(754,root,root) /etc/rc.d/init.d/acpid
136 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/acpid
137 %config(noreplace) %verify(not md5 mtime size) /etc/init/acpid.conf
138 %{systemdunitdir}/acpid.service
139 %attr(640,root,root) %ghost /var/log/acpid
140 %{_mandir}/man8/acpid.8*
141 %{_mandir}/man8/acpi_listen.8*
142
143 %files policy
144 %defattr(644,root,root,755)
145 %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/acpi/events/button
146 %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/acpi/events/battery
147 %attr(754,root,root) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/acpi/actions/*.sh
This page took 0.039295 seconds and 3 git commands to generate.