]> git.pld-linux.org Git - packages/apcupsd.git/blob - apcupsd.spec
83a56cc7507eedb95b91faa3790645bc11cba304
[packages/apcupsd.git] / apcupsd.spec
1 Summary:        Power management software for APC UPS hardware
2 Summary(pl):    Oprogramowanie do zarz±dzania energi± dla UPS-ów APC
3 Name:           apcupsd
4 Version:        3.8.1
5 Release:        3
6 License:        GPL v2
7 Group:          Networking/Daemons
8 Group(de):      Netzwerkwesen/Server
9 Group(pl):      Sieciowe/Serwery
10 Source0:        http://www.sibbald.com/apcupsd/download/%{name}-%{version}.tar.gz
11 Patch0:         %{name}-paths.patch
12 Patch1:         %{name}-pld.patch
13 #Patch1:        apcups-makefile.patch
14 #Patch2:        %{name}-Makefile-fix.patch
15 URL:            http://www.sibbald.com/apcupsd/
16 Prereq:         chkconfig
17 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
18 #Icon:          apcupsd-logo.xpm
19
20 %define         _sysconfdir     /etc/apcupsd
21
22 %description
23 UPS power management under Linux for APCC Products. It allows your
24 computer/server to run during power problems for a specified length of
25 time or the life of the batteries in your BackUPS, BackUPS Pro,
26 SmartUPS v/s, or SmartUPS, and then properly executes a controlled
27 shutdown during an extended power failure.
28
29 %description -l pl
30 Oprogramowanie do zarz±dzania energi± dla UPS-ów APC. Pozwala
31 komputerowi dzia³aæ po awarii zasilania przez okre¶lony czas lub czas
32 ¿ycia akumulatorów w BackUPS, BackUPS Pro, SmartUPS v/s, SmartUPS oraz
33 odpowiednio uruchamia kontrolowany shutdown przy d³u¿szej awarii
34 zasilania.
35
36 %prep
37 %setup -q
38 %patch0 -p1
39 %patch1 -p1
40 #%patch2 -p0
41
42 %build
43 %configure2_13
44 %{__make}
45
46 %install
47 rm -rf $RPM_BUILD_ROOT
48 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_bindir},%{_mandir}/man8,%{_sysconfdir},/etc/rc.d/init.d,/var/log,/var/lib/apcupsd}
49
50 install apcupsd apcnetd $RPM_BUILD_ROOT%{_sbindir}
51 install apcaccess $RPM_BUILD_ROOT%{_bindir}
52 install etc/* $RPM_BUILD_ROOT%{_sysconfdir}
53 install distributions/pld/apccontrol.sh $RPM_BUILD_ROOT%{_sysconfdir}/apccontrol
54 install distributions/pld/apcupsd  $RPM_BUILD_ROOT/etc/rc.d/init.d/apcupsd
55 install doc/apcupsd.man $RPM_BUILD_ROOT%{_mandir}/man8
56 tar czf doc.tar.gz doc
57
58 touch ${RPM_BUILD_ROOT}/var/log/apcupsd.log
59 touch ${RPM_BUILD_ROOT}/var/lib/apcupsd/apcupsd.status
60 touch ${RPM_BUILD_ROOT}/var/lib/apcupsd/apcupsd.events
61
62 %clean
63 rm -rf $RPM_BUILD_ROOT
64
65 %post
66 /sbin/ldconfig
67 /sbin/chkconfig --add apcupsd
68
69 #if !(grep /sbin/powersc /etc/rc.d/init.d/halt > /dev/null); then
70 cp -f /etc/rc.d/init.d/halt /etc/rc.d/init.d/halt.rpmorig
71 #sed -e '/# Now halt or reboot./i\' \
72 #     -e '\
73 # See if this is a powerfail situation.\
74
75 echo ' 
76 if [ -f /etc/apcupsd/powerfail ]; then\
77   echo "APCUPSD to the Rescue!"\
78   echo\
79   /etc/apcupsd/apccontrol killpower \
80   echo\
81   sleep 120\
82   exit 1\
83 fi\
84 ' >  /etc/rc.d/init.d/halt
85 #' /etc/rc.d/init.d/halt.rpmorig > /etc/rc.d/init.d/halt
86 #fi
87
88 %preun
89 if [ "$1" = "0" ]; then
90         chkconfig --del apcupsd
91 fi
92
93 %files
94 %defattr(644,root,root,755)
95 %doc doc.tar.gz 
96 %doc ChangeLog 
97 %{_mandir}/man8/apcupsd.*
98 %attr(755,root,root) %{_sbindir}/*
99 %attr(755,root,root) %{_bindir}/*
100 #%attr(755,root,root) %config /sbin/powersc
101 %attr(640,root,root) %config(noreplace) %{_sysconfdir}/apcupsd.conf
102 %attr(754,root,root) /etc/rc.d/init.d/apcupsd
103 %ghost /var/log/apcupsd.log
104 %ghost /var/lib/apcupsd/apcupsd.status
105 %ghost /var/lib/apcupsd/apcupsd.events
This page took 0.026115 seconds and 2 git commands to generate.