1 Summary: Power management software for APC UPS hardware
2 Summary(pl): Oprogramowanie do zarz±dzania energi± dla UPS-ów APC
7 Group: Networking/Daemons
8 Source0: http://www.sibbald.com/apcupsd/download/%{name}-%{version}.tar.gz
9 Patch0: %{name}-paths.patch
10 Patch1: %{name}-pld.patch
11 #Patch1: apcups-makefile.patch
12 #Patch2: %{name}-Makefile-fix.patch
13 URL: http://www.sibbald.com/apcupsd/
15 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
16 #Icon: apcupsd-logo.xpm
18 %define _sysconfdir /etc/apcupsd
21 UPS power management under Linux for APCC Products. It allows your
22 computer/server to run during power problems for a specified length of
23 time or the life of the batteries in your BackUPS, BackUPS Pro,
24 SmartUPS v/s, or SmartUPS, and then properly executes a controlled
25 shutdown during an extended power failure.
28 Oprogramowanie do zarz±dzania energi± dla UPS-ów APC. Pozwala
29 komputerowi dzia³aæ po awarii zasilania przez okre¶lony czas lub czas
30 ¿ycia akumulatorów w BackUPS, BackUPS Pro, SmartUPS v/s, SmartUPS oraz
31 odpowiednio uruchamia kontrolowany shutdown przy d³u¿szej awarii
45 rm -rf $RPM_BUILD_ROOT
46 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_bindir},%{_mandir}/man8,%{_sysconfdir},/etc/rc.d/init.d,/var/log,/var/lib/apcupsd}
48 install apcupsd apcnetd $RPM_BUILD_ROOT%{_sbindir}
49 install apcaccess $RPM_BUILD_ROOT%{_bindir}
50 install etc/* $RPM_BUILD_ROOT%{_sysconfdir}
51 install distributions/pld/apccontrol.sh $RPM_BUILD_ROOT%{_sysconfdir}/apccontrol
52 install distributions/pld/apcupsd $RPM_BUILD_ROOT/etc/rc.d/init.d/apcupsd
53 install doc/apcupsd.man $RPM_BUILD_ROOT%{_mandir}/man8
54 tar czf doc.tar.gz doc
56 touch ${RPM_BUILD_ROOT}/var/log/apcupsd.log
57 touch ${RPM_BUILD_ROOT}/var/lib/apcupsd/apcupsd.status
58 touch ${RPM_BUILD_ROOT}/var/lib/apcupsd/apcupsd.events
61 rm -rf $RPM_BUILD_ROOT
65 /sbin/chkconfig --add apcupsd
67 #if !(grep /sbin/powersc /etc/rc.d/init.d/halt > /dev/null); then
68 cp -f /etc/rc.d/init.d/halt /etc/rc.d/init.d/halt.rpmorig
69 #sed -e '/# Now halt or reboot./i\' \
71 # See if this is a powerfail situation.\
74 if [ -f /etc/apcupsd/powerfail ]; then\
75 echo "APCUPSD to the Rescue!"\
77 /etc/apcupsd/apccontrol killpower \
82 ' > /etc/rc.d/init.d/halt
83 #' /etc/rc.d/init.d/halt.rpmorig > /etc/rc.d/init.d/halt
87 if [ "$1" = "0" ]; then
88 chkconfig --del apcupsd
92 %defattr(644,root,root,755)
95 %{_mandir}/man8/apcupsd.*
96 %attr(755,root,root) %{_sbindir}/*
97 %attr(755,root,root) %{_bindir}/*
98 #%attr(755,root,root) %config /sbin/powersc
99 %attr(640,root,root) %config(noreplace) %{_sysconfdir}/apcupsd.conf
100 %attr(754,root,root) /etc/rc.d/init.d/apcupsd
101 %ghost /var/log/apcupsd.log
102 %ghost /var/lib/apcupsd/apcupsd.status
103 %ghost /var/lib/apcupsd/apcupsd.events