]> git.pld-linux.org Git - packages/apcupsd.git/blame - apcupsd.spec
- upgraded to 3.14.3; master-slave mode has been removed,
[packages/apcupsd.git] / apcupsd.spec
CommitLineData
79f87cb5
AA
1#
2# Conditional build:
b82939ee 3%bcond_without test # without TEST support
d8ccf3e8 4%bcond_without usb # without USB support
5%bcond_without net # without network support
3648038a 6%bcond_without cgi # with CGI program support
d8ccf3e8 7%bcond_with snmp # with SNMP support
79f87cb5 8#
1a2f2291 9Summary: Power management software for APC UPS hardware
f755a48e 10Summary(pl.UTF-8): Oprogramowanie do zarządzania energią dla UPS-ów APC
82761b0b 11Name: apcupsd
270d92b6 12Version: 3.14.3
9cbeab38 13Release: 1
82761b0b 14License: GPL v2
6a96dc52 15Group: Networking/Daemons
d5bc45da 16Source0: http://dl.sourceforge.net/apcupsd/%{name}-%{version}.tar.gz
270d92b6 17# Source0-md5: a212351d21828e9344264614c7ad8ba1
79f87cb5
AA
18Source1: %{name}.init
19Source2: %{name}.logrotate
9a2c1151 20Source3: %{name}.sysconfig
79f87cb5 21Patch0: %{name}-configure.patch
d5bc45da 22URL: http://www.apcupsd.com/
23d673ff 23BuildRequires: autoconf
270d92b6
TP
24BuildRequires: gconfmm-devel
25BuildRequires: ncurses-ext-devel
61e20730 26%{?with_snmp:BuildRequires: net-snmp-devel}
502a8f9c 27BuildRequires: rpmbuild(macros) >= 1.268
5bb78d9f 28Requires(post): fileutils
232188ee 29Requires(post,preun): /sbin/chkconfig
3e8f890a 30Requires: rc-scripts
9860ec16 31BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
03dfd68e 32
1d49e6a6 33%define _sysconfdir /etc/apcupsd
502a8f9c 34%define _cgidir /home/services/httpd/cgi-bin
2534c785 35
03dfd68e 36%description
82761b0b 37UPS power management under Linux for APCC Products. It allows your
6a96dc52 38computer/server to run during power problems for a specified length of
39time or the life of the batteries in your BackUPS, BackUPS Pro,
40SmartUPS v/s, or SmartUPS, and then properly executes a controlled
41shutdown during an extended power failure.
03dfd68e 42
c69e54dd
JR
43%description -l pl.UTF-8
44Oprogramowanie do zarządzania energią dla UPS-ów APC. Pozwala
45komputerowi działać po awarii zasilania przez określony czas lub czas
46życia akumulatorów w BackUPS, BackUPS Pro, SmartUPS v/s, SmartUPS oraz
47odpowiednio uruchamia kontrolowany shutdown przy dłuższej awarii
7ff8ac4b
JB
48zasilania.
49
80be390e 50%package cgi
86fcc136 51Summary: upsstats - Web-based UPS status viewer
f755a48e 52Summary(pl.UTF-8): upsstats - oparta na WWW przeglądarka stanu UPS-a
86fcc136 53Group: Applications/Networking
54Requires: webserver
80be390e
MW
55
56%description cgi
36dc352e
JB
57upsstats.cgi builds a lightweight web page containing basic UPS status
58information.
59
c69e54dd
JR
60%description cgi -l pl.UTF-8
61upsstats.cgi tworzy lekką stronę WWW zawierającą podstawowe informacje
36dc352e 62o stanie UPS-a.
80be390e 63
270d92b6
TP
64%package gapcmon
65Summary: Apcupsd GUI monitoring application
66Summary(pl.UTF-8): Aplikacja GUI monitorowania Apcupsd
67Group: X11/Applications
68
69%description gapcmon
70Gnome/GTK based application which integrates into most desktop panels (not
71just Gnome). It monitors one or more Apcupsd instances using Apcupsd's NIS
72networking server. The status of each UPS is shown with a icon.
73
74%description gapcmon -l pl.UTF-8
75Oparta na Gnome/GTK aplikacja, która integruje się z panelami (nie tylko
76Gnome). Monitoruje jedną bądź kilka instancji Apcupsd za pomocą serwera
77NIS. Status każdego UPS-a przedstawia ikona.
78
03dfd68e 79%prep
e6609c22 80%setup -q
5d58544c 81%patch0 -p1
23d673ff 82for i in configure.in aclocal.m4 config.h.in; do install autoconf/$i .;done
03dfd68e 83
84%build
23d673ff 85%{__autoconf}
79f87cb5 86%configure \
9ed364ac
AA
87 --with-log-dir=%{_var}/log \
88 --with-stat-dir=%{_var}/lib/apcupsd \
80be390e
MW
89%if %{with cgi}
90 --enable-cgi \
91 --with-cgi-bin=/home/services/httpd/cgi-bin \
80be390e 92%endif
9c3ad2b9 93 %{?with_test:--enable-test} \
61e20730 94%if %{with net}
240a4dad 95 --enable-net \
0e1241bd 96%endif
270d92b6
TP
97 --enable-nls \
98 --enable-powerflute \
99 --enable-gapcmon \
d8ccf3e8 100 %{?with_snmp:--enable-snmp} \
44319652 101 %{?with_usb:--enable-usb}
79f87cb5 102
e6609c22 103%{__make}
104
03dfd68e 105%install
6a96dc52 106rm -rf $RPM_BUILD_ROOT
f3858603 107install -d $RPM_BUILD_ROOT/etc/{apcupsd,logrotate.d,rc.d/init.d,sysconfig} \
79f87cb5 108 $RPM_BUILD_ROOT/var/{log,lib/apcupsd}
bb2476bb 109
d5bc45da
JB
110%{__make} install \
111 DESTDIR=$RPM_BUILD_ROOT
270d92b6
TP
112
113install src/powerflute $RPM_BUILD_ROOT%{_sbindir}
79f87cb5
AA
114install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/apcupsd
115install %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/apcupsd
9a2c1151 116install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/apcupsd
d5bc45da 117
79f87cb5 118touch $RPM_BUILD_ROOT/var/log/apcupsd.events
d5bc45da 119touch $RPM_BUILD_ROOT/var/lib/apcupsd/apcupsd.status
03dfd68e 120
9ed364ac
AA
121cat > $RPM_BUILD_ROOT/etc/rc.d/init.d/halt << EOF
122#!/bin/sh
123/etc/rc.d/init.d/apcupsd powerdown
124EOF
125
03dfd68e 126%clean
7ff8ac4b 127rm -rf $RPM_BUILD_ROOT
03dfd68e 128
129%post
4a9afcae 130/sbin/chkconfig --add apcupsd
502a8f9c 131%service apcupsd restart "apcupsd daemon"
bb2476bb 132
03dfd68e 133%preun
7ff8ac4b 134if [ "$1" = "0" ]; then
502a8f9c 135 %service apcupsd stop
61e20730 136 /sbin/chkconfig --del apcupsd
7ff8ac4b 137fi
03dfd68e 138
139%files
82761b0b 140%defattr(644,root,root,755)
91aa732c 141%doc ChangeLog Developers
e6609c22 142%attr(755,root,root) %{_sbindir}/*
b9be4436
SP
143%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apcupsd.conf
144%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/apcupsd
79f87cb5 145%attr(754,root,root) %{_sysconfdir}/apccontrol
9cbeab38
MWP
146%attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/changeme
147%attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/commfailure
148%attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/commok
149#%attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mainsback
9cbeab38
MWP
150%attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/onbattery
151%attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/offbattery
80be390e 152%if %{with cgi}
36dc352e
JB
153%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/hosts.conf
154%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/multimon.conf
155%{_sysconfdir}/apcupsd.css
80be390e 156%endif
e6609c22 157%attr(754,root,root) /etc/rc.d/init.d/apcupsd
9ed364ac 158%attr(754,root,root) /etc/rc.d/init.d/halt
b9be4436
SP
159%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/apcupsd
160%dir %{_sysconfdir}
79f87cb5
AA
161%dir /var/lib/apcupsd
162%attr(640,root,root) %ghost /var/log/apcupsd.events
163%attr(640,root,root) %ghost /var/lib/apcupsd/apcupsd.status
61e20730 164%{_mandir}/man8/apcupsd.*
80be390e
MW
165
166%files cgi
167%defattr(644,root,root,755)
168%attr(755,root,root) %{_cgidir}/*.cgi
270d92b6
TP
169
170%files gapcmon
171%defattr(644,root,root,755)
172%attr(755,root,root) %{_bindir}/*
173%{_desktopdir}/gapcmon.desktop
174%{_pixmapsdir}/*
This page took 0.137482 seconds and 4 git commands to generate.