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