5 Group: System Environment/Daemons
6 Source: http://www.brisse.dk/site/apcupsd/download/%{name}-%{version}.src.tar.gz
7 Patch0: apcups-initscript.patch
8 Patch1: apcups-makefile.patch
9 Patch2: apcupsd-Makefile-fix.patch
10 Summary: power management software for APC UPS hardware
11 URL: http://www.brisse.dk/site/apcupsd/
12 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
13 #Icon: apcupsd-logo.xpm
16 UPS power management under Linux for APCC Products. It allows your
17 computer/server to run during power problems for a specified length of time
18 or the life of the batteries in your BackUPS, BackUPS Pro, SmartUPS v/s, or
19 SmartUPS, and then properly executes a controlled shutdown during an
20 extended power failure.
23 %setup -q -n %{name}-%{version}.src
29 mv Makefile Makefile.orig
31 | sed "s,^PREFIX =,PREFIX = ${RPM_BUILD_ROOT}," \
32 | sed "s,^MANPREFIX = /usr,MANPREFIX = ${RPM_BUILD_ROOT}/usr," \
37 rm -rf ${RPM_BUILD_ROOT}
40 # - why doesn't the Makefile know that it should install *-linux ??
41 # - make install tries to stop apcupsd. That's not necessary (buildroot) (hany: not issue anymore)
43 install -d ${RPM_BUILD_ROOT}/{sbin,bin,etc/rc.d/init.d,usr/man/man8,var/log}
44 NAME="-linux" make install
45 # hany: why this? we're just building. not installing
46 #[ -x /sbin/powersc ] && /sbin/powersc RESTARTME
47 gzip -9nf
\b ${RPM_BUILD_ROOT}/usr/man/*/*.?
48 cp -f installs/apcupsd.conf ${RPM_BUILD_ROOT}/etc
49 cp -f installs/apcups.rhs ${RPM_BUILD_ROOT}/etc/rc.d/init.d/apcups
50 touch ${RPM_BUILD_ROOT}/var/log/apcupsd.log
51 touch ${RPM_BUILD_ROOT}/etc/apcupsd.status
54 rm -rf ${RPM_BUILD_ROOT}
58 /sbin/chkconfig --add apcups
59 if !(grep /sbin/powersc /etc/rc.d/init.d/halt > /dev/null); then
60 cp -f /etc/rc.d/init.d/halt /etc/rc.d/init.d/halt.rpmorig
61 sed -e '/# Now halt or reboot./i\' \
63 # See if this is a powerfail situation.\
64 if [ -f /etc/powerfail ]; then\
65 echo "APCUPSD to the Rescue!"\
72 ' /etc/rc.d/init.d/halt.rpmorig > /etc/rc.d/init.d/halt
75 echo Check the documentation to see whether /etc/rc.d/init.d/halt has a
76 echo correct invocation of /sbin/powersc .
79 chkconfig --del apcups
82 %defattr(644,root,root,755)
83 %attr(-, root, root) %doc README.NEW Changelog port.gif Statement.APCC
84 %attr(-, root, root) %doc %{name}-%{version}.src.lsm
85 %attr(-, root, root) %doc readmes/*
86 %attr(-, root, root) %doc docs/apcupsd.docs
87 %attr(-, root, root) %doc installs/halt.rhs installs/apcups.rhs installs/powersc
88 /usr/man/man8/apcupsd.8.gz
89 %attr(755, root, bin) /sbin/apcupsd
90 %attr(755, root, root) /bin/apcaccess
91 %attr(755, root, bin) %config /sbin/powersc
92 %attr(640, root, root) %config(noreplace) /etc/apcupsd.conf
93 %attr(754, root, root) /etc/rc.d/init.d/apcups
94 %ghost /var/log/apcupsd.log
95 %ghost /etc/apcupsd.status