3 %bcond_without cgi # without CGI program support
4 %bcond_without gapcmon # without gapcmon GUI
5 %bcond_without net # without network support
6 %bcond_with snmp # with SNMP support
7 %bcond_without test # without TEST support
8 %bcond_without usb # without USB support
10 Summary: Power management software for APC UPS hardware
11 Summary(pl.UTF-8): Oprogramowanie do zarządzania energią dla UPS-ów APC
16 Group: Networking/Daemons
17 Source0: http://downloads.sourceforge.net/apcupsd/%{name}-%{version}.tar.gz
18 # Source0-md5: c291d9d3923b4d9c0e600b755ad4f489
20 Source2: %{name}.logrotate
21 Source3: %{name}.sysconfig
22 Patch0: %{name}-configure.patch
23 Patch1: control-config.patch
24 Patch2: format-security.patch
25 Patch3: shutdown.patch
30 URL: http://www.apcupsd.com/
31 %{?with_gapcmon:BuildRequires: GConf2-devel >= 2.0}
32 BuildRequires: autoconf
33 BuildRequires: automake
34 BuildRequires: gd-devel
35 %{?with_gapcmon:BuildRequires: gtk+2-devel >= 2:2.4.0}
37 %{?with_snmp:BuildRequires: net-snmp-devel}
38 BuildRequires: pkgconfig
39 BuildRequires: rpmbuild(macros) >= 1.647
40 BuildRequires: util-linux
42 Requires: systemd-units >= 0.38
43 Requires(post): fileutils
44 Requires(post,preun): /sbin/chkconfig
45 Requires(post,preun,postun): systemd-units >= 38
46 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
48 %define _sysconfdir /etc/apcupsd
49 %define _cgidir /home/services/httpd/cgi-bin
52 UPS power management under Linux for APCC Products. It allows your
53 computer/server to run during power problems for a specified length of
54 time or the life of the batteries in your BackUPS, BackUPS Pro,
55 SmartUPS v/s, or SmartUPS, and then properly executes a controlled
56 shutdown during an extended power failure.
58 %description -l pl.UTF-8
59 Oprogramowanie do zarządzania energią dla UPS-ów APC. Pozwala
60 komputerowi działać po awarii zasilania przez określony czas lub czas
61 życia akumulatorów w BackUPS, BackUPS Pro, SmartUPS v/s, SmartUPS oraz
62 odpowiednio uruchamia kontrolowany shutdown przy dłuższej awarii
66 Summary: upsstats - Web-based UPS status viewer
67 Summary(pl.UTF-8): upsstats - oparta na WWW przeglądarka stanu UPS-a
68 Group: Applications/Networking
72 upsstats.cgi builds a lightweight web page containing basic UPS status
75 %description cgi -l pl.UTF-8
76 upsstats.cgi tworzy lekką stronę WWW zawierającą podstawowe informacje
80 Summary: Apcupsd GUI monitoring application
81 Summary(pl.UTF-8): Aplikacja GUI monitorowania Apcupsd
82 Group: X11/Applications
83 URL: http://gapcmon.sourceforge.net/
86 GNOME/GTK+ based application which integrates into most desktop panels
87 (not just GNOME). It monitors one or more Apcupsd instances using
88 Apcupsd's NIS networking server. The status of each UPS is shown with
91 %description gapcmon -l pl.UTF-8
92 Oparta na GNOME/GTK+ aplikacja, która integruje się z panelami (nie
93 tylko Gnome). Monitoruje jedną bądź kilka instancji Apcupsd za pomocą
94 serwera NIS. Status każdego UPS-a przedstawia ikona.
108 for i in configure.in aclocal.m4 config.h.in; do install autoconf/$i .;done
109 cp -f %{_datadir}/automake/config.sub autoconf
112 APCUPSD_MAIL="/bin/mail" \
113 SHUTDOWN="/sbin/shutdown" \
114 WALL="%{_bindir}/wall" \
115 --with-log-dir=%{_var}/log \
116 --with-stat-dir=%{_var}/lib/apcupsd \
122 --with-cgi-bin=/home/services/httpd/cgi-bin \
124 %{?with_test:--enable-test} \
125 %{?with_net:--enable-net} \
126 %{?with_gapcmon:--enable-gapcmon} \
127 %{?with_snmp:--enable-snmp} \
128 %{?with_usb:--enable-usb}
134 rm -rf $RPM_BUILD_ROOT
135 install -d $RPM_BUILD_ROOT/etc/{apcupsd,logrotate.d,rc.d/init.d,sysconfig} \
136 $RPM_BUILD_ROOT/var/{log,lib/apcupsd}
139 DESTDIR=$RPM_BUILD_ROOT
141 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/apcupsd
142 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/apcupsd
143 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/apcupsd
146 install -p -D apcupsd.service $RPM_BUILD_ROOT%{systemdunitdir}/apcupsd.service
147 install -p -D apcupsd_shutdown $RPM_BUILD_ROOT%{systemdunitdir}-shutdown/apcupsd_shutdown
149 touch $RPM_BUILD_ROOT/var/log/apcupsd.events
150 touch $RPM_BUILD_ROOT/var/lib/apcupsd/apcupsd.status
152 cat > $RPM_BUILD_ROOT/etc/rc.d/init.d/halt << EOF
154 exec /etc/rc.d/init.d/apcupsd powerdown
158 %{__rm} $RPM_BUILD_ROOT%{_datadir}/hal/fdi/policy/20thirdparty/80-apcupsd-ups-policy.fdi
161 rm -rf $RPM_BUILD_ROOT
164 /sbin/chkconfig --add apcupsd
165 %service apcupsd restart "apcupsd daemon"
166 %systemd_post %{name}.service
169 if [ "$1" = "0" ]; then
170 %service apcupsd stop
171 /sbin/chkconfig --del apcupsd
173 %systemd_preun %{name}.service
179 %defattr(644,root,root,755)
180 %doc ChangeLog Developers
181 %attr(755,root,root) %{_sbindir}/apcaccess
182 %attr(755,root,root) %{_sbindir}/apctest
183 %attr(755,root,root) %{_sbindir}/apcupsd
184 %attr(755,root,root) %{_sbindir}/smtp
185 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apcupsd.conf
186 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/apcupsd
187 %attr(754,root,root) %{_sysconfdir}/apccontrol
188 %attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/changeme
189 %attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/commfailure
190 %attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/commok
191 #%attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mainsback
192 %attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/onbattery
193 %attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/offbattery
194 %attr(754,root,root) /etc/rc.d/init.d/apcupsd
195 %attr(754,root,root) /etc/rc.d/init.d/halt
196 %{systemdunitdir}/%{name}.service
197 %attr(755,root,root) %{systemdunitdir}-shutdown/apcupsd_shutdown
198 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/apcupsd
200 %dir /var/lib/apcupsd
201 %attr(640,root,root) %ghost /var/log/apcupsd.events
202 %attr(640,root,root) %ghost /var/lib/apcupsd/apcupsd.status
203 %{_mandir}/man8/apcupsd.8*
204 %{_mandir}/man8/apctest.8*
205 %{_mandir}/man8/apcaccess.8*
206 %{_mandir}/man8/apccontrol.8*
207 %{_mandir}/man5/apcupsd.conf.5*
211 %defattr(644,root,root,755)
212 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/hosts.conf
213 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/multimon.conf
214 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apcupsd.css
215 %attr(755,root,root) %{_cgidir}/*.cgi
220 %defattr(644,root,root,755)
221 %attr(755,root,root) %{_bindir}/gapcmon
222 %{_desktopdir}/gapcmon.desktop