]> git.pld-linux.org Git - packages/apcupsd.git/blame - apcupsd.spec
- spec adapterized.
[packages/apcupsd.git] / apcupsd.spec
CommitLineData
82761b0b 1Name: apcupsd
2Version: 3.5.8
3Release: 2
4License: GPL v2
6a96dc52 5Group: Networking/Daemons
6Group(pl): Sieciowe/Serwery
7Source0: http://www.brisse.dk/site/apcupsd/download/%{name}-%{version}.src.tar.gz
82761b0b 8Patch0: apcups-initscript.patch
9Patch1: apcups-makefile.patch
f3fe0a16 10Patch2: apcupsd-Makefile-fix.patch
82761b0b 11Summary: power management software for APC UPS hardware
12URL: http://www.brisse.dk/site/apcupsd/
9860ec16 13BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
82761b0b 14#Icon: apcupsd-logo.xpm
03dfd68e 15
6a96dc52 16%define _prefix /
17%define _mandir /usr/share/man
2534c785 18
03dfd68e 19%description
82761b0b 20UPS power management under Linux for APCC Products. It allows your
6a96dc52 21computer/server to run during power problems for a specified length of
22time or the life of the batteries in your BackUPS, BackUPS Pro,
23SmartUPS v/s, or SmartUPS, and then properly executes a controlled
24shutdown during an extended power failure.
03dfd68e 25
03dfd68e 26%prep
82761b0b 27%setup -q -n %{name}-%{version}.src
03dfd68e 28%patch0 -p1
bb2476bb 29%patch1 -p1
f3fe0a16 30%patch2 -p0
03dfd68e 31
32%build
bb2476bb 33mv Makefile Makefile.orig
34cat Makefile.orig \
35 | sed "s,^PREFIX =,PREFIX = ${RPM_BUILD_ROOT}," \
36 | sed "s,^MANPREFIX = /usr,MANPREFIX = ${RPM_BUILD_ROOT}/usr," \
37 > Makefile
38make linux
03dfd68e 39
40%install
6a96dc52 41rm -rf $RPM_BUILD_ROOT
82761b0b 42
bb2476bb 43# Some issues :
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)
46
2534c785 47#install -d ${RPM_BUILD_ROOT}/{sbin,bin,etc/rc.d/init.d,usr/man/man8,var/log}
48install -d ${RPM_BUILD_ROOT}/{bin,sbin,usr/share/man/man8}
49install -d ${RPM_BUILD_ROOT}/{etc/rc.d/init.d,var/log}
50
6a96dc52 51NAME="-linux" make MANPREFIX="${RPM_BUILD_ROOT}%{_datadir}/" install
bb2476bb 52# hany: why this? we're just building. not installing
53#[ -x /sbin/powersc ] && /sbin/powersc RESTARTME
6a96dc52 54gzip -9nf ${RPM_BUILD_ROOT}%{_mandir}/man8/*
55install installs/apcupsd.conf ${RPM_BUILD_ROOT}%{_sysconfdir}
2534c785 56install installs/apcups.rhs ${RPM_BUILD_ROOT}/etc/rc.d/init.d/apcups
03dfd68e 57touch ${RPM_BUILD_ROOT}/var/log/apcupsd.log
6a96dc52 58touch ${RPM_BUILD_ROOT}%{_sysconfdir}/apcupsd.status
03dfd68e 59
03dfd68e 60%clean
61rm -rf ${RPM_BUILD_ROOT}
62
63%post
bb2476bb 64/sbin/ldconfig
65/sbin/chkconfig --add apcups
66if !(grep /sbin/powersc /etc/rc.d/init.d/halt > /dev/null); then
67cp -f /etc/rc.d/init.d/halt /etc/rc.d/init.d/halt.rpmorig
68sed -e '/# Now halt or reboot./i\' \
69 -e '\
70# See if this is a powerfail situation.\
71if [ -f /etc/powerfail ]; then\
72 echo "APCUPSD to the Rescue!"\
73 echo\
74 /sbin/powersc KILL\
75 echo\
76 sleep 120\
77 exit 1\
78fi\
79' /etc/rc.d/init.d/halt.rpmorig > /etc/rc.d/init.d/halt
80
81fi
82echo Check the documentation to see whether /etc/rc.d/init.d/halt has a
83echo correct invocation of /sbin/powersc .
03dfd68e 84
85%preun
bb2476bb 86chkconfig --del apcups
03dfd68e 87
88%files
82761b0b 89%defattr(644,root,root,755)
2534c785 90%doc README.NEW Changelog port.gif Statement.APCC
91%doc %{name}-%{version}.src.lsm
6a96dc52 92%doc readmes/* docs/apcupsd.docs
2534c785 93%doc installs/halt.rhs installs/apcups.rhs installs/powersc
6a96dc52 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
03dfd68e 100%ghost /var/log/apcupsd.log
6a96dc52 101%ghost %{_sysconfdir}/apcupsd.status
This page took 0.08725 seconds and 4 git commands to generate.