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