5 Group: Networking/Daemons
6 Group(pl): Sieciowe/Serwery
7 Source0: http://www.brisse.dk/site/apcupsd/download/%{name}-%{version}.src.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.brisse.dk/site/apcupsd/
13 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
14 #Icon: apcupsd-logo.xpm
17 %define _mandir /usr/share/man
20 UPS power management under Linux for APCC Products. It allows your
21 computer/server to run during power problems for a specified length of
22 time or the life of the batteries in your BackUPS, BackUPS Pro,
23 SmartUPS v/s, or SmartUPS, and then properly executes a controlled
24 shutdown during an extended power failure.
27 %setup -q -n %{name}-%{version}.src
33 mv Makefile Makefile.orig
35 | sed "s,^PREFIX =,PREFIX = ${RPM_BUILD_ROOT}," \
36 | sed "s,^MANPREFIX = /usr,MANPREFIX = ${RPM_BUILD_ROOT}/usr," \
41 rm -rf $RPM_BUILD_ROOT
44 # - why doesn't the Makefile know that it should install *-linux ??
45 # - make install tries to stop apcupsd. That's not necessary (buildroot) (hany: not issue anymore)
47 #install -d ${RPM_BUILD_ROOT}/{sbin,bin,etc/rc.d/init.d,usr/man/man8,var/log}
48 install -d ${RPM_BUILD_ROOT}/{bin,sbin,usr/share/man/man8}
49 install -d ${RPM_BUILD_ROOT}/{etc/rc.d/init.d,var/log}
51 NAME="-linux" make MANPREFIX="${RPM_BUILD_ROOT}%{_datadir}/" install
52 # hany: why this? we're just building. not installing
53 #[ -x /sbin/powersc ] && /sbin/powersc RESTARTME
54 gzip -9nf ${RPM_BUILD_ROOT}%{_mandir}/man8/*
55 install installs/apcupsd.conf ${RPM_BUILD_ROOT}%{_sysconfdir}
56 install installs/apcups.rhs ${RPM_BUILD_ROOT}/etc/rc.d/init.d/apcups
57 touch ${RPM_BUILD_ROOT}/var/log/apcupsd.log
58 touch ${RPM_BUILD_ROOT}%{_sysconfdir}/apcupsd.status
61 rm -rf ${RPM_BUILD_ROOT}
65 /sbin/chkconfig --add apcups
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.\
71 if [ -f /etc/powerfail ]; then\
72 echo "APCUPSD to the Rescue!"\
79 ' /etc/rc.d/init.d/halt.rpmorig > /etc/rc.d/init.d/halt
82 echo Check the documentation to see whether /etc/rc.d/init.d/halt has a
83 echo correct invocation of /sbin/powersc .
86 chkconfig --del apcups
89 %defattr(644,root,root,755)
90 %doc README.NEW Changelog port.gif Statement.APCC
91 %doc %{name}-%{version}.src.lsm
92 %doc readmes/* docs/apcupsd.docs
93 %doc installs/halt.rhs installs/apcups.rhs installs/powersc
94 %{_mandir}/man8/apcupsd.8*
95 %attr(755,root,root) /sbin/apcupsd
96 %attr(755,root,root) /bin/apcaccess
97 %attr(755,root,root) %config /sbin/powersc
98 %attr(640,root,root) %config(noreplace) %{_sysconfdir}/apcupsd.conf
99 %attr(754,root,root) /etc/rc.d/init.d/apcups
100 %ghost /var/log/apcupsd.log
101 %ghost %{_sysconfdir}/apcupsd.status