]>
Commit | Line | Data |
---|---|---|
1a2f2291 | 1 | Summary: Power management software for APC UPS hardware |
82761b0b | 2 | Name: apcupsd |
e6609c22 | 3 | Version: 3.8.1 |
1d49e6a6 | 4 | Release: 3 |
82761b0b | 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 | |
1d49e6a6 | 11 | Patch1: %{name}-pld.patch |
1a2f2291 | 12 | #Patch1: apcups-makefile.patch |
13 | #Patch2: %{name}-Makefile-fix.patch | |
e6609c22 | 14 | URL: http://www.sibbald.com/apcupsd/ |
9860ec16 | 15 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
82761b0b | 16 | #Icon: apcupsd-logo.xpm |
03dfd68e | 17 | |
1d49e6a6 | 18 | %define _sysconfdir /etc/apcupsd |
2534c785 | 19 | |
03dfd68e | 20 | %description |
82761b0b | 21 | UPS power management under Linux for APCC Products. It allows your |
6a96dc52 | 22 | computer/server to run during power problems for a specified length of |
23 | time or the life of the batteries in your BackUPS, BackUPS Pro, | |
24 | SmartUPS v/s, or SmartUPS, and then properly executes a controlled | |
25 | shutdown during an extended power failure. | |
03dfd68e | 26 | |
03dfd68e | 27 | %prep |
e6609c22 | 28 | %setup -q |
1a2f2291 | 29 | %patch0 -p1 |
1d49e6a6 | 30 | %patch1 -p1 |
e6609c22 | 31 | #%patch2 -p0 |
03dfd68e | 32 | |
33 | %build | |
1a2f2291 | 34 | %configure |
e6609c22 | 35 | %{__make} |
36 | ||
03dfd68e | 37 | %install |
6a96dc52 | 38 | rm -rf $RPM_BUILD_ROOT |
1d49e6a6 | 39 | install -d $RPM_BUILD_ROOT{%{_sbindir},%{_bindir},%{_mandir}/man8,%{_sysconfdir},/etc/rc.d/init.d,/var/log,/var/lib/apcupsd} |
bb2476bb | 40 | |
e6609c22 | 41 | install apcupsd apcnetd $RPM_BUILD_ROOT%{_sbindir} |
42 | install apcaccess $RPM_BUILD_ROOT%{_bindir} | |
1d49e6a6 | 43 | install etc/* $RPM_BUILD_ROOT%{_sysconfdir} |
ddf584d0 GS |
44 | install distributions/pld/apccontrol.sh $RPM_BUILD_ROOT%{_sysconfdir}/apccontrol |
45 | install distributions/pld/apcupsd $RPM_BUILD_ROOT/etc/rc.d/init.d/apcupsd | |
e6609c22 | 46 | install doc/apcupsd.man $RPM_BUILD_ROOT%{_mandir}/man8 |
47 | tar czf doc.tar.gz doc | |
2534c785 | 48 | |
03dfd68e | 49 | touch ${RPM_BUILD_ROOT}/var/log/apcupsd.log |
1d49e6a6 GS |
50 | touch ${RPM_BUILD_ROOT}/var/lib/apcupsd/apcupsd.status |
51 | touch ${RPM_BUILD_ROOT}/var/lib/apcupsd/apcupsd.events | |
03dfd68e | 52 | |
03dfd68e | 53 | %clean |
54 | rm -rf ${RPM_BUILD_ROOT} | |
55 | ||
56 | %post | |
bb2476bb | 57 | /sbin/ldconfig |
efe5f02f | 58 | %chkconfig_add |
e6609c22 | 59 | |
60 | #if !(grep /sbin/powersc /etc/rc.d/init.d/halt > /dev/null); then | |
bb2476bb | 61 | cp -f /etc/rc.d/init.d/halt /etc/rc.d/init.d/halt.rpmorig |
e6609c22 | 62 | #sed -e '/# Now halt or reboot./i\' \ |
63 | # -e '\ | |
bb2476bb | 64 | # See if this is a powerfail situation.\ |
e6609c22 | 65 | |
66 | echo ' | |
67 | if [ -f /etc/apcupsd/powerfail ]; then\ | |
bb2476bb | 68 | echo "APCUPSD to the Rescue!"\ |
69 | echo\ | |
e6609c22 | 70 | /etc/apcupsd/apccontrol killpower \ |
bb2476bb | 71 | echo\ |
72 | sleep 120\ | |
73 | exit 1\ | |
74 | fi\ | |
e6609c22 | 75 | ' > /etc/rc.d/init.d/halt |
76 | #' /etc/rc.d/init.d/halt.rpmorig > /etc/rc.d/init.d/halt | |
77 | #fi | |
bb2476bb | 78 | |
03dfd68e | 79 | |
80 | %preun | |
efe5f02f | 81 | %chkconfig_del |
03dfd68e | 82 | |
83 | %files | |
82761b0b | 84 | %defattr(644,root,root,755) |
e6609c22 | 85 | %doc doc.tar.gz |
86 | %doc ChangeLog | |
87 | %{_mandir}/man8/apcupsd.* | |
88 | %attr(755,root,root) %{_sbindir}/* | |
89 | %attr(755,root,root) %{_bindir}/* | |
90 | #%attr(755,root,root) %config /sbin/powersc | |
1d49e6a6 | 91 | %attr(640,root,root) %config(noreplace) %{_sysconfdir}/apcupsd.conf |
e6609c22 | 92 | %attr(754,root,root) /etc/rc.d/init.d/apcupsd |
03dfd68e | 93 | %ghost /var/log/apcupsd.log |
1d49e6a6 GS |
94 | %ghost /var/lib/apcupsd/apcupsd.status |
95 | %ghost /var/lib/apcupsd/apcupsd.events |