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