5 Group: System Environment/Daemons
6 Url: http://www.brisse.dk/site/apcupsd/
7 Packager: Bert de Bruijn <bob@ccl.kuleuven.ac.be>
8 Source: http://www.brisse.dk/site/apcupsd/download/%{name}-%{version}.src.tar.gz
9 Patch0: apcups-initscript.patch
10 Patch1: apcups-makefile.patch
11 Summary: power management software for APC UPS hardware
12 BuildRoot: /var/tmp/%{name}-root
18 #Icon: apcupsd-logo.xpm
21 UPS power management under Linux for APCC Products.
22 It allows your computer/server to run during power problems
23 for a specified length of time or the life of the batteries
24 in your BackUPS, BackUPS Pro, SmartUPS v/s, or SmartUPS, and
25 then properly executes a controlled shutdown during an
26 extended power failure.
29 %setup -n %{name}-%{version}.src
34 mv Makefile Makefile.orig
36 | sed "s,^PREFIX =,PREFIX = ${RPM_BUILD_ROOT}," \
37 | sed "s,^MANPREFIX = /usr,MANPREFIX = ${RPM_BUILD_ROOT}/usr," \
43 # - why doesn't the Makefile know that it should install *-linux ??
44 # - make install tries to stop apcupsd. That's not necessary (buildroot) (hany: not issue anymore)
46 mkdir -p ${RPM_BUILD_ROOT}/{sbin,bin,etc/rc.d/init.d,usr/man/man8,var/log}
47 NAME="-linux" make install
48 # hany: why this? we're just building. not installing
49 #[ -x /sbin/powersc ] && /sbin/powersc RESTARTME
50 gzip -9 -f ${RPM_BUILD_ROOT}/usr/man/*/*.?
51 cp -f installs/apcupsd.conf ${RPM_BUILD_ROOT}/etc
52 cp -f installs/apcups.rhs ${RPM_BUILD_ROOT}/etc/rc.d/init.d/apcups
53 touch ${RPM_BUILD_ROOT}/var/log/apcupsd.log
54 touch ${RPM_BUILD_ROOT}/etc/apcupsd.status
57 rm -rf ${RPM_BUILD_ROOT}
61 /sbin/chkconfig --add apcups
62 if !(grep /sbin/powersc /etc/rc.d/init.d/halt > /dev/null); then
63 cp -f /etc/rc.d/init.d/halt /etc/rc.d/init.d/halt.rpmorig
64 sed -e '/# Now halt or reboot./i\' \
66 # See if this is a powerfail situation.\
67 if [ -f /etc/powerfail ]; then\
68 echo "APCUPSD to the Rescue!"\
75 ' /etc/rc.d/init.d/halt.rpmorig > /etc/rc.d/init.d/halt
78 echo Check the documentation to see whether /etc/rc.d/init.d/halt has a
79 echo correct invocation of /sbin/powersc .
82 chkconfig --del apcups
85 %defattr(-, root, root)
86 %attr(-, root, root) %doc README.NEW Changelog port.gif Statement.APCC
87 %attr(-, root, root) %doc %{name}-%{version}.src.lsm
88 %attr(-, root, root) %doc readmes/*
89 %attr(-, root, root) %doc docs/apcupsd.docs
90 %attr(-, root, root) %doc installs/halt.rhs installs/apcups.rhs installs/powersc
91 %attr(644, root, man) /usr/man/man8/apcupsd.8.gz
92 %attr(755, root, bin) /sbin/apcupsd
93 %attr(755, root, root) /bin/apcaccess
94 %attr(755, root, bin) %config /sbin/powersc
95 %attr(640, root, root) %config(noreplace) /etc/apcupsd.conf
96 %attr(755, root, root) %config /etc/rc.d/init.d/apcups
97 %ghost /var/log/apcupsd.log
98 %ghost /etc/apcupsd.status
101 * Fri Aug 6 1999 Peter Hanecak <hanecak@megaloman.sk>
102 - build process cleaned (so non-root users can do that smoothly)
106 * Sun Jun 6 1999 Bert de Bruijn <bob@ccl.kuleuven.ac.be>
107 - new spec file, first rpm release since source release under GPL ?
108 - use sed in %build to force buildroot.