1 Summary: Power management software for APC UPS hardware
6 Group: Networking/Daemons
7 Group(de): Netzwerkwesen/Server
8 Group(pl): Sieciowe/Serwery
9 Source0: http://www.sibbald.com/apcupsd/download/%{name}-%{version}.tar.gz
10 Patch0: %{name}-paths.patch
11 #Patch1: apcups-makefile.patch
12 #Patch2: %{name}-Makefile-fix.patch
13 URL: http://www.sibbald.com/apcupsd/
14 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
15 #Icon: apcupsd-logo.xpm
17 %define _sysconfdir /etc/apcupsd
20 UPS power management under Linux for APCC Products. It allows your
21 computer/server to run during power problems for a specified length of
22 time or the life of the batteries in your BackUPS, BackUPS Pro,
23 SmartUPS v/s, or SmartUPS, and then properly executes a controlled
24 shutdown during an extended power failure.
37 rm -rf $RPM_BUILD_ROOT
38 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_bindir},%{_mandir}/man8,%{_sysconfdir}/,/etc/rc.d/init.d,/var/log}
40 install apcupsd apcnetd $RPM_BUILD_ROOT%{_sbindir}
41 install apcaccess $RPM_BUILD_ROOT%{_bindir}
42 install etc/* $RPM_BUILD_ROOT%{_sysconfdir}/apcupsd
43 install distributions/redhat/apccontrol.sh $RPM_BUILD_ROOT%{_sysconfdir}/apcupsd/apccontrol
44 install distributions/redhat/apcupsd $RPM_BUILD_ROOT/etc/rc.d/init.d/apcupsd
45 install doc/apcupsd.man $RPM_BUILD_ROOT%{_mandir}/man8
46 tar czf doc.tar.gz doc
48 touch ${RPM_BUILD_ROOT}/var/log/apcupsd.log
49 touch ${RPM_BUILD_ROOT}%{_sysconfdir}/apcupsd.status
52 rm -rf ${RPM_BUILD_ROOT}
56 /sbin/chkconfig --add apcupsd
58 #if !(grep /sbin/powersc /etc/rc.d/init.d/halt > /dev/null); then
59 cp -f /etc/rc.d/init.d/halt /etc/rc.d/init.d/halt.rpmorig
60 #sed -e '/# Now halt or reboot./i\' \
62 # See if this is a powerfail situation.\
65 if [ -f /etc/apcupsd/powerfail ]; then\
66 echo "APCUPSD to the Rescue!"\
68 /etc/apcupsd/apccontrol killpower \
73 ' > /etc/rc.d/init.d/halt
74 #' /etc/rc.d/init.d/halt.rpmorig > /etc/rc.d/init.d/halt
79 chkconfig --del apcupsd
82 %defattr(644,root,root,755)
85 %{_mandir}/man8/apcupsd.*
86 %attr(755,root,root) %{_sbindir}/*
87 %attr(755,root,root) %{_bindir}/*
88 #%attr(755,root,root) %config /sbin/powersc
89 %attr(640,root,root) %config(noreplace) %{_sysconfdir}/apcupsd/apcupsd.conf
90 %attr(754,root,root) /etc/rc.d/init.d/apcupsd
91 %ghost /var/log/apcupsd.log
92 %ghost %{_sysconfdir}/apcupsd.status