]> git.pld-linux.org Git - packages/apcupsd.git/blob - apcupsd.spec
setup EVENTSFILE to /var/lib/apcupsd/apcupsd.events and STATFILE to
[packages/apcupsd.git] / apcupsd.spec
1 Summary:        Power management software for APC UPS hardware
2 Name:           apcupsd
3 Version:        3.8.1
4 Release:        2
5 License:        GPL v2
6 Group:          Networking/Daemons
7 Group(de):      Netzwerkwesen/Server
8 Group(pl):      Sieciowe/Serwery
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
13 URL:            http://www.sibbald.com/apcupsd/
14 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
15 #Icon:          apcupsd-logo.xpm
16
17 %define         _sysconfdir     /etc/apcupsd
18
19 %description
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.
25
26 %prep
27 %setup -q
28 %patch0 -p1
29 #%patch1 -p1
30 #%patch2 -p0
31
32 %build
33 %configure
34 %{__make}
35
36 %install
37 rm -rf $RPM_BUILD_ROOT
38 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_bindir},%{_mandir}/man8,%{_sysconfdir}/,/etc/rc.d/init.d,/var/log}
39
40 install apcupsd apcnetd $RPM_BUILD_ROOT%{_sbindir}
41 install apcaccess $RPM_BUILD_ROOT%{_bindir}
42 install etc/* $RPM_BUILD_ROOT%{_sysconfdir}/apcupsd
43 install distributions/redhat/apccontrol.sh $RPM_BUILD_ROOT%{_sysconfdir}/apcupsd/apccontrol
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
47
48 touch ${RPM_BUILD_ROOT}/var/log/apcupsd.log
49 touch ${RPM_BUILD_ROOT}%{_sysconfdir}/apcupsd.status
50
51 %clean
52 rm -rf ${RPM_BUILD_ROOT}
53
54 %post
55 /sbin/ldconfig
56 /sbin/chkconfig --add apcupsd
57
58 #if !(grep /sbin/powersc /etc/rc.d/init.d/halt > /dev/null); then
59 cp -f /etc/rc.d/init.d/halt /etc/rc.d/init.d/halt.rpmorig
60 #sed -e '/# Now halt or reboot./i\' \
61 #     -e '\
62 # See if this is a powerfail situation.\
63
64 echo ' 
65 if [ -f /etc/apcupsd/powerfail ]; then\
66   echo "APCUPSD to the Rescue!"\
67   echo\
68   /etc/apcupsd/apccontrol killpower \
69   echo\
70   sleep 120\
71   exit 1\
72 fi\
73 ' >  /etc/rc.d/init.d/halt
74 #' /etc/rc.d/init.d/halt.rpmorig > /etc/rc.d/init.d/halt
75 #fi
76
77
78 %preun
79 chkconfig --del apcupsd
80
81 %files
82 %defattr(644,root,root,755)
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
91 %ghost /var/log/apcupsd.log
92 %ghost %{_sysconfdir}/apcupsd.status
This page took 0.053012 seconds and 3 git commands to generate.