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
15 # Source0-size: 3858266
17 Source2: %{name}.logrotate
18 Source3: %{name}.sysconfig
19 Patch0: %{name}-configure.patch
20 URL: http://www.apcupsd.com/
21 BuildRequires: autoconf
22 BuildRequires: automake
23 Requires(post,preun): /sbin/chkconfig
24 Requires(post): fileutils
25 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27 %define _sysconfdir /etc/apcupsd
30 UPS power management under Linux for APCC Products. It allows your
31 computer/server to run during power problems for a specified length of
32 time or the life of the batteries in your BackUPS, BackUPS Pro,
33 SmartUPS v/s, or SmartUPS, and then properly executes a controlled
34 shutdown during an extended power failure.
37 Oprogramowanie do zarz±dzania energi± dla UPS-ów APC. Pozwala
38 komputerowi dzia³aæ po awarii zasilania przez okre¶lony czas lub czas
39 ¿ycia akumulatorów w BackUPS, BackUPS Pro, SmartUPS v/s, SmartUPS oraz
40 odpowiednio uruchamia kontrolowany shutdown przy d³u¿szej awarii
49 cp -f /usr/share/automake/config.sub .
54 --with-log-dir=%{_var}/log \
55 --with-stat-dir=%{_var}/lib/apcupsd \
61 --with-serial-dev=/dev/usb/hiddev[0-15] \
69 rm -rf $RPM_BUILD_ROOT
70 install -d $RPM_BUILD_ROOT/etc/{apcupsd,logrotate.d,rc.d/init.d,sysconfig} \
71 $RPM_BUILD_ROOT/var/{log,lib/apcupsd}
74 DESTDIR=$RPM_BUILD_ROOT
76 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/apcupsd
77 install %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/apcupsd
78 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/apcupsd
80 touch $RPM_BUILD_ROOT/var/log/apcupsd.events
81 touch $RPM_BUILD_ROOT/var/lib/apcupsd/apcupsd.status
83 cat > $RPM_BUILD_ROOT/etc/rc.d/init.d/halt << EOF
85 /etc/rc.d/init.d/apcupsd powerdown
89 rm -rf $RPM_BUILD_ROOT
92 /sbin/chkconfig --add apcupsd
93 if [ -f /var/lock/subsys/apcupsd ]; then
94 /etc/rc.d/init.d/apcupsd restart >&2
96 echo "Run \"/etc/rc.d/init.d/apcupsd start\" to start apcupsd daemon."
100 if [ "$1" = "0" ]; then
101 if [ -f /var/lock/subsys/apcupsd ]; then
102 /etc/rc.d/init.d/apcupsd stop >&2
104 /sbin/chkconfig --del apcupsd
108 %defattr(644,root,root,755)
109 %doc ChangeLog Developers doc/{README.apcaccess,README.solaris}
110 %{_mandir}/man8/apcupsd.*
111 %attr(755,root,root) %{_sbindir}/*
112 %attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/apcupsd.conf
113 %attr(640,root,root) %config(noreplace) /etc/sysconfig/apcupsd
114 %attr(754,root,root) %{_sysconfdir}/apccontrol
115 %attr(754,root,root) %{_sysconfdir}/changeme
116 %attr(754,root,root) %{_sysconfdir}/commfailure
117 %attr(754,root,root) %{_sysconfdir}/commok
118 %attr(754,root,root) %{_sysconfdir}/mainsback
119 %attr(754,root,root) %{_sysconfdir}/masterconnect
120 %attr(754,root,root) %{_sysconfdir}/mastertimeout
121 %attr(754,root,root) %{_sysconfdir}/onbattery
122 %attr(754,root,root) /etc/rc.d/init.d/apcupsd
123 %attr(754,root,root) /etc/rc.d/init.d/halt
124 %attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/logrotate.d/apcupsd
126 %dir /var/lib/apcupsd
127 %attr(640,root,root) %ghost /var/log/apcupsd.events
128 %attr(640,root,root) %ghost /var/lib/apcupsd/apcupsd.status