]> git.pld-linux.org Git - packages/apcupsd.git/blob - apcupsd.spec
- 3.8.1 is no longer available and vulnerable to remote root exploit,
[packages/apcupsd.git] / apcupsd.spec
1 # TODO:
2 # - update paths and pld patches
3 # - avoid messing in halt script in %post
4 Summary:        Power management software for APC UPS hardware
5 Summary(pl):    Oprogramowanie do zarz±dzania energi± dla UPS-ów APC
6 Name:           apcupsd
7 Version:        3.10.5
8 Release:        0.1
9 License:        GPL v2
10 Group:          Networking/Daemons
11 Source0:        http://dl.sourceforge.net/apcupsd/%{name}-%{version}.tar.gz
12 Patch0:         %{name}-paths.patch
13 Patch1:         %{name}-pld.patch
14 #Patch1:        apcups-makefile.patch
15 #Patch2:        %{name}-Makefile-fix.patch
16 URL:            http://www.apcupsd.com/
17 Requires(post,preun):   /sbin/chkconfig
18 Requires(post): fileutils
19 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
20
21 %define         _sysconfdir     /etc/apcupsd
22
23 %description
24 UPS power management under Linux for APCC Products. It allows your
25 computer/server to run during power problems for a specified length of
26 time or the life of the batteries in your BackUPS, BackUPS Pro,
27 SmartUPS v/s, or SmartUPS, and then properly executes a controlled
28 shutdown during an extended power failure.
29
30 %description -l pl
31 Oprogramowanie do zarz±dzania energi± dla UPS-ów APC. Pozwala
32 komputerowi dzia³aæ po awarii zasilania przez okre¶lony czas lub czas
33 ¿ycia akumulatorów w BackUPS, BackUPS Pro, SmartUPS v/s, SmartUPS oraz
34 odpowiednio uruchamia kontrolowany shutdown przy d³u¿szej awarii
35 zasilania.
36
37 %prep
38 %setup -q
39 #%patch0 -p1    -- configure should be patched to move files from /var/log to /var/lib
40 #%patch1 -p1    -- probably should be updated
41 #%patch2 -p0
42
43 %build
44 %configure2_13
45 %{__make}
46
47 %install
48 rm -rf $RPM_BUILD_ROOT
49 #install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,/var/log,/var/lib/apcupsd}
50
51 %{__make} install \
52         DESTDIR=$RPM_BUILD_ROOT
53
54 install platforms/redhat/apcupsd $RPM_BUILD_ROOT/etc/rc.d/init.d/apcupsd
55 #install platforms/pld/apcupsd  $RPM_BUILD_ROOT/etc/rc.d/init.d/apcupsd
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 ChangeLog Developers doc/{README.apcaccess,developers_manual,home-page,logo,manual}
95 %{_mandir}/man8/apcupsd.*
96 %attr(755,root,root) %{_sbindir}/*
97 #%attr(755,root,root) %config /sbin/powersc
98 %attr(640,root,root) %config(noreplace) %{_sysconfdir}/apcupsd.conf
99 %attr(754,root,root) /etc/rc.d/init.d/apcupsd
100 %ghost /var/log/apcupsd.log
101 %ghost /var/lib/apcupsd/apcupsd.status
102 %ghost /var/lib/apcupsd/apcupsd.events
This page took 0.09892 seconds and 3 git commands to generate.