3 %bcond_without test # without TEST support
4 %bcond_with usb # with USB support
6 Summary: Power management software for APC UPS hardware
7 Summary(pl): Oprogramowanie do zarz±dzania energi± dla UPS-ów APC
12 Group: Networking/Daemons
13 Source0: http://dl.sourceforge.net/apcupsd/%{name}-%{version}.tar.gz
14 # Source0-md5: 21b2b744ebcaa0010367a403a9c5e66c
16 Source2: %{name}.logrotate
17 Patch0: %{name}-configure.patch
18 URL: http://www.apcupsd.com/
19 BuildRequires: autoconf
20 BuildRequires: automake
21 Requires(post,preun): /sbin/chkconfig
22 Requires(post): fileutils
23 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25 %define _sysconfdir /etc/apcupsd
28 UPS power management under Linux for APCC Products. It allows your
29 computer/server to run during power problems for a specified length of
30 time or the life of the batteries in your BackUPS, BackUPS Pro,
31 SmartUPS v/s, or SmartUPS, and then properly executes a controlled
32 shutdown during an extended power failure.
35 Oprogramowanie do zarz±dzania energi± dla UPS-ów APC. Pozwala
36 komputerowi dzia³aæ po awarii zasilania przez okre¶lony czas lub czas
37 ¿ycia akumulatorów w BackUPS, BackUPS Pro, SmartUPS v/s, SmartUPS oraz
38 odpowiednio uruchamia kontrolowany shutdown przy d³u¿szej awarii
47 cp -f /usr/share/automake/config.sub .
52 --with-log-dir=%{_var}/log \
53 --with-stat-dir=%{_var}/lib/apcupsd \
59 --with-serial-dev=/dev/usb/hiddev[0-15] \
67 rm -rf $RPM_BUILD_ROOT
68 install -d $RPM_BUILD_ROOT/etc/{apcupsd,logrotate.d,rc.d/init.d} \
69 $RPM_BUILD_ROOT/var/{log,lib/apcupsd}
72 DESTDIR=$RPM_BUILD_ROOT
74 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/apcupsd
75 install %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/apcupsd
77 touch $RPM_BUILD_ROOT/var/log/apcupsd.events
78 touch $RPM_BUILD_ROOT/var/lib/apcupsd/apcupsd.status
80 cat > $RPM_BUILD_ROOT/etc/rc.d/init.d/halt << EOF
82 /etc/rc.d/init.d/apcupsd powerdown
86 rm -rf $RPM_BUILD_ROOT
89 /sbin/chkconfig --add apcupsd
90 if [ -f /var/lock/subsys/apcupsd ]; then
91 /etc/rc.d/init.d/apcupsd restart >&2
93 echo "Run \"/etc/rc.d/init.d/apcupsd start\" to start apcupsd daemon."
97 if [ "$1" = "0" ]; then
98 if [ -f /var/lock/subsys/apcupsd ]; then
99 /etc/rc.d/init.d/apcupsd stop >&2
101 /sbin/chkconfig --del apcupsd
105 %defattr(644,root,root,755)
106 %doc ChangeLog Developers doc/{README.apcaccess,README.solaris}
107 %{_mandir}/man8/apcupsd.*
108 %attr(755,root,root) %{_sbindir}/*
109 %attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/apcupsd.conf
110 %attr(754,root,root) %{_sysconfdir}/apccontrol
111 %attr(754,root,root) %{_sysconfdir}/changeme
112 %attr(754,root,root) %{_sysconfdir}/commfailure
113 %attr(754,root,root) %{_sysconfdir}/commok
114 %attr(754,root,root) %{_sysconfdir}/mainsback
115 %attr(754,root,root) %{_sysconfdir}/masterconnect
116 %attr(754,root,root) %{_sysconfdir}/mastertimeout
117 %attr(754,root,root) %{_sysconfdir}/onbattery
118 %attr(754,root,root) /etc/rc.d/init.d/apcupsd
119 %attr(754,root,root) /etc/rc.d/init.d/halt
120 %attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/logrotate.d/apcupsd
122 %dir /var/lib/apcupsd
123 %attr(640,root,root) %ghost /var/log/apcupsd.events
124 %attr(640,root,root) %ghost /var/lib/apcupsd/apcupsd.status