5 Group: Networking/Daemons
6 Group(pl): Sieciowe/Serwery
7 Source0: http://www.sibbald.com/apcupsd/download/apcupsd-3.8.1.tar.gz
8 #Patch0: apcups-initscript.patch
9 #Patch1: apcups-makefile.patch
10 #Patch2: apcupsd-Makefile-fix.patch
11 Summary: power management software for APC UPS hardware
12 URL: http://www.sibbald.com/apcupsd/
13 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
14 #Icon: apcupsd-logo.xpm
18 UPS power management under Linux for APCC Products. It allows your
19 computer/server to run during power problems for a specified length of
20 time or the life of the batteries in your BackUPS, BackUPS Pro,
21 SmartUPS v/s, or SmartUPS, and then properly executes a controlled
22 shutdown during an extended power failure.
32 %configure # --prefix=/usr --sbindir=/sbin --with-cgi-bin=/etc/apcupsd/cgi --enable-cgi
35 #mv Makefile Makefile.orig
37 # | sed "s,^PREFIX =,PREFIX = ${RPM_BUILD_ROOT}," \
38 # | sed "s,^MANPREFIX = /usr,MANPREFIX = ${RPM_BUILD_ROOT}/usr," \
43 rm -rf $RPM_BUILD_ROOT
45 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_bindir},%{_mandir}/man8,/etc/apcupsd/,/etc/rc.d/init.d,/var/log}
47 install apcupsd apcnetd $RPM_BUILD_ROOT%{_sbindir}
48 install apcaccess $RPM_BUILD_ROOT%{_bindir}
49 install etc/* $RPM_BUILD_ROOT/etc/apcupsd
50 install distributions/redhat/apccontrol.sh $RPM_BUILD_ROOT/etc/apcupsd/apccontrol
51 install distributions/redhat/apcupsd $RPM_BUILD_ROOT/etc/rc.d/init.d/apcupsd
52 install doc/apcupsd.man $RPM_BUILD_ROOT%{_mandir}/man8
53 tar czf doc.tar.gz doc
55 #[ -x /sbin/powersc ] && /sbin/powersc RESTARTME
56 touch ${RPM_BUILD_ROOT}/var/log/apcupsd.log
57 touch ${RPM_BUILD_ROOT}%{_sysconfdir}/apcupsd.status
60 rm -rf ${RPM_BUILD_ROOT}
64 /sbin/chkconfig --add apcupsd
66 #if !(grep /sbin/powersc /etc/rc.d/init.d/halt > /dev/null); then
67 cp -f /etc/rc.d/init.d/halt /etc/rc.d/init.d/halt.rpmorig
68 #sed -e '/# Now halt or reboot./i\' \
70 # See if this is a powerfail situation.\
73 if [ -f /etc/apcupsd/powerfail ]; then\
74 echo "APCUPSD to the Rescue!"\
76 /etc/apcupsd/apccontrol killpower \
81 ' > /etc/rc.d/init.d/halt
82 #' /etc/rc.d/init.d/halt.rpmorig > /etc/rc.d/init.d/halt
87 chkconfig --del apcupsd
90 %defattr(644,root,root,755)
93 %{_mandir}/man8/apcupsd.*
94 %attr(755,root,root) %{_sbindir}/*
95 %attr(755,root,root) %{_bindir}/*
96 #%attr(755,root,root) %config /sbin/powersc
97 %attr(640,root,root) %config(noreplace) %{_sysconfdir}/apcupsd/apcupsd.conf
98 %attr(754,root,root) /etc/rc.d/init.d/apcupsd
99 %ghost /var/log/apcupsd.log
100 %ghost %{_sysconfdir}/apcupsd.status