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