]> git.pld-linux.org Git - packages/apcupsd.git/blob - apcupsd.spec
- może wrescie ktoś wykasuje to konto ?
[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 # Source0-md5:  f182db64c8acdae18f896ecdc064a239
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
55 install platforms/redhat/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 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/chkconfig --add apcupsd
67
68 #if !(grep /sbin/powersc /etc/rc.d/init.d/halt > /dev/null); then
69 cp -f /etc/rc.d/init.d/halt /etc/rc.d/init.d/halt.rpmorig
70 #sed -e '/# Now halt or reboot./i\' \
71 #     -e '\
72 # See if this is a powerfail situation.\
73
74 echo '
75 if [ -f /etc/apcupsd/powerfail ]; then\
76   echo "APCUPSD to the Rescue!"\
77   echo\
78   /etc/apcupsd/apccontrol killpower \
79   echo\
80   sleep 120\
81   exit 1\
82 fi\
83 ' >  /etc/rc.d/init.d/halt
84 #' /etc/rc.d/init.d/halt.rpmorig > /etc/rc.d/init.d/halt
85 #fi
86 chmod 754 /etc/rc.d/init.d/halt
87
88 %preun
89 if [ "$1" = "0" ]; then
90         /sbin/chkconfig --del apcupsd
91 fi
92
93 %files
94 %defattr(644,root,root,755)
95 %doc ChangeLog Developers doc/{README.apcaccess,developers_manual,home-page,logo,manual}
96 %{_mandir}/man8/apcupsd.*
97 %attr(755,root,root) %{_sbindir}/*
98 #%attr(755,root,root) %config /sbin/powersc
99 %attr(640,root,root) %config(noreplace) %{_sysconfdir}/apcupsd.conf
100 %attr(754,root,root) /etc/rc.d/init.d/apcupsd
101 %ghost /var/log/apcupsd.log
102 %ghost /var/lib/apcupsd/apcupsd.status
103 %ghost /var/lib/apcupsd/apcupsd.events
This page took 0.056179 seconds and 3 git commands to generate.