]>
Commit | Line | Data |
---|---|---|
1a2f2291 | 1 | Summary: Power management software for APC UPS hardware |
82761b0b | 2 | Name: apcupsd |
e6609c22 | 3 | Version: 3.8.1 |
82761b0b | 4 | Release: 2 |
5 | License: GPL v2 | |
6a96dc52 | 6 | Group: Networking/Daemons |
1a2f2291 | 7 | Group(de): Netzwerkwesen/Server |
6a96dc52 | 8 | Group(pl): Sieciowe/Serwery |
1a2f2291 | 9 | Source0: http://www.sibbald.com/apcupsd/download/%{name}-%{version}.tar.gz |
10 | Patch0: %{name}-paths.patch | |
11 | #Patch1: apcups-makefile.patch | |
12 | #Patch2: %{name}-Makefile-fix.patch | |
e6609c22 | 13 | URL: http://www.sibbald.com/apcupsd/ |
9860ec16 | 14 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
82761b0b | 15 | #Icon: apcupsd-logo.xpm |
03dfd68e | 16 | |
1a2f2291 | 17 | %define _sysconfdir /etc/apcupsd |
2534c785 | 18 | |
03dfd68e | 19 | %description |
82761b0b | 20 | UPS power management under Linux for APCC Products. It allows your |
6a96dc52 | 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. | |
03dfd68e | 25 | |
03dfd68e | 26 | %prep |
e6609c22 | 27 | %setup -q |
1a2f2291 | 28 | %patch0 -p1 |
e6609c22 | 29 | #%patch1 -p1 |
30 | #%patch2 -p0 | |
03dfd68e | 31 | |
32 | %build | |
1a2f2291 | 33 | %configure |
e6609c22 | 34 | %{__make} |
35 | ||
03dfd68e | 36 | %install |
6a96dc52 | 37 | rm -rf $RPM_BUILD_ROOT |
1a2f2291 | 38 | install -d $RPM_BUILD_ROOT{%{_sbindir},%{_bindir},%{_mandir}/man8,%{_sysconfdir}/,/etc/rc.d/init.d,/var/log} |
bb2476bb | 39 | |
e6609c22 | 40 | install apcupsd apcnetd $RPM_BUILD_ROOT%{_sbindir} |
41 | install apcaccess $RPM_BUILD_ROOT%{_bindir} | |
1a2f2291 | 42 | install etc/* $RPM_BUILD_ROOT%{_sysconfdir}/apcupsd |
43 | install distributions/redhat/apccontrol.sh $RPM_BUILD_ROOT%{_sysconfdir}/apcupsd/apccontrol | |
e6609c22 | 44 | install distributions/redhat/apcupsd $RPM_BUILD_ROOT/etc/rc.d/init.d/apcupsd |
45 | install doc/apcupsd.man $RPM_BUILD_ROOT%{_mandir}/man8 | |
46 | tar czf doc.tar.gz doc | |
2534c785 | 47 | |
03dfd68e | 48 | touch ${RPM_BUILD_ROOT}/var/log/apcupsd.log |
6a96dc52 | 49 | touch ${RPM_BUILD_ROOT}%{_sysconfdir}/apcupsd.status |
03dfd68e | 50 | |
03dfd68e | 51 | %clean |
52 | rm -rf ${RPM_BUILD_ROOT} | |
53 | ||
54 | %post | |
bb2476bb | 55 | /sbin/ldconfig |
e6609c22 | 56 | /sbin/chkconfig --add apcupsd |
57 | ||
58 | #if !(grep /sbin/powersc /etc/rc.d/init.d/halt > /dev/null); then | |
bb2476bb | 59 | cp -f /etc/rc.d/init.d/halt /etc/rc.d/init.d/halt.rpmorig |
e6609c22 | 60 | #sed -e '/# Now halt or reboot./i\' \ |
61 | # -e '\ | |
bb2476bb | 62 | # See if this is a powerfail situation.\ |
e6609c22 | 63 | |
64 | echo ' | |
65 | if [ -f /etc/apcupsd/powerfail ]; then\ | |
bb2476bb | 66 | echo "APCUPSD to the Rescue!"\ |
67 | echo\ | |
e6609c22 | 68 | /etc/apcupsd/apccontrol killpower \ |
bb2476bb | 69 | echo\ |
70 | sleep 120\ | |
71 | exit 1\ | |
72 | fi\ | |
e6609c22 | 73 | ' > /etc/rc.d/init.d/halt |
74 | #' /etc/rc.d/init.d/halt.rpmorig > /etc/rc.d/init.d/halt | |
75 | #fi | |
bb2476bb | 76 | |
03dfd68e | 77 | |
78 | %preun | |
e6609c22 | 79 | chkconfig --del apcupsd |
03dfd68e | 80 | |
81 | %files | |
82761b0b | 82 | %defattr(644,root,root,755) |
e6609c22 | 83 | %doc doc.tar.gz |
84 | %doc ChangeLog | |
85 | %{_mandir}/man8/apcupsd.* | |
86 | %attr(755,root,root) %{_sbindir}/* | |
87 | %attr(755,root,root) %{_bindir}/* | |
88 | #%attr(755,root,root) %config /sbin/powersc | |
89 | %attr(640,root,root) %config(noreplace) %{_sysconfdir}/apcupsd/apcupsd.conf | |
90 | %attr(754,root,root) /etc/rc.d/init.d/apcupsd | |
03dfd68e | 91 | %ghost /var/log/apcupsd.log |
6a96dc52 | 92 | %ghost %{_sysconfdir}/apcupsd.status |