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