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