3 %bcond_without test # without TEST support
4 %bcond_without usb # without USB support
5 %bcond_without net # without network support
6 %bcond_without cgi # with CGI program support
7 %bcond_with snmp # with SNMP support
9 Summary: Power management software for APC UPS hardware
10 Summary(pl): Oprogramowanie do zarz±dzania energi± dla UPS-ów APC
15 Group: Networking/Daemons
16 Source0: http://dl.sourceforge.net/apcupsd/%{name}-%{version}.tar.gz
17 # Source0-md5: d2e710176430a28d624500e145d9ffe3
19 Source2: %{name}.logrotate
20 Source3: %{name}.sysconfig
21 Patch0: %{name}-configure.patch
22 URL: http://www.apcupsd.com/
23 BuildRequires: autoconf
24 BuildRequires: automake
25 %{?with_snmp:BuildRequires: net-snmp-devel}
26 Requires(post): fileutils
27 Requires(post,preun): /sbin/chkconfig
29 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31 %define _sysconfdir /etc/apcupsd
32 %define _cgidir /home/services/httpd/cgi-bin
35 UPS power management under Linux for APCC Products. It allows your
36 computer/server to run during power problems for a specified length of
37 time or the life of the batteries in your BackUPS, BackUPS Pro,
38 SmartUPS v/s, or SmartUPS, and then properly executes a controlled
39 shutdown during an extended power failure.
42 Oprogramowanie do zarz±dzania energi± dla UPS-ów APC. Pozwala
43 komputerowi dzia³aæ po awarii zasilania przez okre¶lony czas lub czas
44 ¿ycia akumulatorów w BackUPS, BackUPS Pro, SmartUPS v/s, SmartUPS oraz
45 odpowiednio uruchamia kontrolowany shutdown przy d³u¿szej awarii
49 Summary: upsstats - Web-based UPS status viewer
50 Summary(pl): upsstats - oparta na WWW przegl±darka stanu UPS-a
51 Group: Applications/Networking
55 upsstats.cgi builds a lightweight web page containing basic UPS status
58 %description cgi -l pl
59 upsstats.cgi tworzy lekk± stronê WWW zawieraj±c± podstawowe informacje
68 cp -f /usr/share/automake/config.sub .
74 --with-log-dir=%{_var}/log \
75 --with-stat-dir=%{_var}/lib/apcupsd \
78 --with-cgi-bin=/home/services/httpd/cgi-bin \
80 %{?with_test:--enable-test} \
83 --enable-master-slave \
85 %{?with_snmp:--enable-snmp} \
86 %{?with_usb:--enable-usb}
91 rm -rf $RPM_BUILD_ROOT
92 install -d $RPM_BUILD_ROOT/etc/{apcupsd,logrotate.d,rc.d/init.d,sysconfig} \
93 $RPM_BUILD_ROOT/var/{log,lib/apcupsd}
96 DESTDIR=$RPM_BUILD_ROOT
98 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/apcupsd
99 install %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/apcupsd
100 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/apcupsd
102 touch $RPM_BUILD_ROOT/var/log/apcupsd.events
103 touch $RPM_BUILD_ROOT/var/lib/apcupsd/apcupsd.status
105 cat > $RPM_BUILD_ROOT/etc/rc.d/init.d/halt << EOF
107 /etc/rc.d/init.d/apcupsd powerdown
111 rm -rf $RPM_BUILD_ROOT
114 /sbin/chkconfig --add apcupsd
115 if [ -f /var/lock/subsys/apcupsd ]; then
116 /etc/rc.d/init.d/apcupsd restart >&2
118 echo "Run \"/etc/rc.d/init.d/apcupsd start\" to start apcupsd daemon."
122 if [ "$1" = "0" ]; then
123 if [ -f /var/lock/subsys/apcupsd ]; then
124 /etc/rc.d/init.d/apcupsd stop >&2
126 /sbin/chkconfig --del apcupsd
130 %defattr(644,root,root,755)
131 %doc ChangeLog Developers
132 %attr(755,root,root) %{_sbindir}/*
133 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apcupsd.conf
134 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/apcupsd
135 %attr(754,root,root) %{_sysconfdir}/apccontrol
136 %attr(754,root,root) %{_sysconfdir}/changeme
137 %attr(754,root,root) %{_sysconfdir}/commfailure
138 %attr(754,root,root) %{_sysconfdir}/commok
139 #%attr(754,root,root) %{_sysconfdir}/mainsback
140 %attr(754,root,root) %{_sysconfdir}/masterconnect
141 %attr(754,root,root) %{_sysconfdir}/mastertimeout
142 %attr(754,root,root) %{_sysconfdir}/onbattery
143 %attr(754,root,root) %{_sysconfdir}/offbattery
145 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/hosts.conf
146 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/multimon.conf
147 %{_sysconfdir}/apcupsd.css
149 %attr(754,root,root) /etc/rc.d/init.d/apcupsd
150 %attr(754,root,root) /etc/rc.d/init.d/halt
151 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/apcupsd
153 %dir /var/lib/apcupsd
154 %attr(640,root,root) %ghost /var/log/apcupsd.events
155 %attr(640,root,root) %ghost /var/lib/apcupsd/apcupsd.status
156 %{_mandir}/man8/apcupsd.*
159 %defattr(644,root,root,755)
160 %attr(755,root,root) %{_cgidir}/*.cgi