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