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