]> git.pld-linux.org Git - packages/apcupsd.git/blame_incremental - apcupsd.spec
- BR: gettext-devel for NLS support
[packages/apcupsd.git] / apcupsd.spec
... / ...
CommitLineData
1#
2# Conditional build:
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
9#
10Summary: Power management software for APC UPS hardware
11Summary(pl.UTF-8): Oprogramowanie do zarządzania energią dla UPS-ów APC
12Name: apcupsd
13Version: 3.14.3
14Release: 1
15License: GPL v2
16Group: Networking/Daemons
17Source0: http://dl.sourceforge.net/apcupsd/%{name}-%{version}.tar.gz
18# Source0-md5: a212351d21828e9344264614c7ad8ba1
19Source1: %{name}.init
20Source2: %{name}.logrotate
21Source3: %{name}.sysconfig
22Patch0: %{name}-configure.patch
23URL: http://www.apcupsd.com/
24BuildRequires: autoconf
25%{?with_gapcmon: BuildRequires: gconfmm-devel}
26BuildRequires: gettext-devel
27BuildRequires: ncurses-ext-devel
28%{?with_snmp: BuildRequires: net-snmp-devel}
29BuildRequires: rpmbuild(macros) >= 1.268
30Requires(post): fileutils
31Requires(post,preun): /sbin/chkconfig
32Requires: rc-scripts
33BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34
35%define _sysconfdir /etc/apcupsd
36%define _cgidir /home/services/httpd/cgi-bin
37
38%description
39UPS power management under Linux for APCC Products. It allows your
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.
44
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
50zasilania.
51
52%package cgi
53Summary: upsstats - Web-based UPS status viewer
54Summary(pl.UTF-8): upsstats - oparta na WWW przeglądarka stanu UPS-a
55Group: Applications/Networking
56Requires: webserver
57
58%description cgi
59upsstats.cgi builds a lightweight web page containing basic UPS status
60information.
61
62%description cgi -l pl.UTF-8
63upsstats.cgi tworzy lekką stronę WWW zawierającą podstawowe informacje
64o stanie UPS-a.
65
66%package gapcmon
67Summary: Apcupsd GUI monitoring application
68Summary(pl.UTF-8): Aplikacja GUI monitorowania Apcupsd
69Group: X11/Applications
70
71%description gapcmon
72Gnome/GTK based application which integrates into most desktop panels (not
73just Gnome). It monitors one or more Apcupsd instances using Apcupsd's NIS
74networking server. The status of each UPS is shown with a icon.
75
76%description gapcmon -l pl.UTF-8
77Oparta na Gnome/GTK aplikacja, która integruje się z panelami (nie tylko
78Gnome). Monitoruje jedną bądź kilka instancji Apcupsd za pomocą serwera
79NIS. Status każdego UPS-a przedstawia ikona.
80
81%prep
82%setup -q
83%patch0 -p1
84for i in configure.in aclocal.m4 config.h.in; do install autoconf/$i .;done
85cp -f %{_datadir}/automake/config.sub autoconf
86
87%build
88%{__autoconf}
89%configure \
90 --with-log-dir=%{_var}/log \
91 --with-stat-dir=%{_var}/lib/apcupsd \
92%if %{with cgi}
93 --enable-cgi \
94 --with-cgi-bin=/home/services/httpd/cgi-bin \
95%endif
96 %{?with_test:--enable-test} \
97%if %{with net}
98 --enable-net \
99%endif
100 --enable-nls \
101 --enable-powerflute \
102 %{?with_gapcmon:--enable-gapcmon} \
103 %{?with_snmp:--enable-snmp} \
104 %{?with_usb:--enable-usb}
105
106%{__make}
107
108%install
109rm -rf $RPM_BUILD_ROOT
110install -d $RPM_BUILD_ROOT/etc/{apcupsd,logrotate.d,rc.d/init.d,sysconfig} \
111 $RPM_BUILD_ROOT/var/{log,lib/apcupsd}
112
113%{__make} install \
114 DESTDIR=$RPM_BUILD_ROOT
115
116install src/powerflute $RPM_BUILD_ROOT%{_sbindir}
117install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/apcupsd
118install %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/apcupsd
119install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/apcupsd
120
121touch $RPM_BUILD_ROOT/var/log/apcupsd.events
122touch $RPM_BUILD_ROOT/var/lib/apcupsd/apcupsd.status
123
124cat > $RPM_BUILD_ROOT/etc/rc.d/init.d/halt << EOF
125#!/bin/sh
126/etc/rc.d/init.d/apcupsd powerdown
127EOF
128
129%clean
130rm -rf $RPM_BUILD_ROOT
131
132%post
133/sbin/chkconfig --add apcupsd
134%service apcupsd restart "apcupsd daemon"
135
136%preun
137if [ "$1" = "0" ]; then
138 %service apcupsd stop
139 /sbin/chkconfig --del apcupsd
140fi
141
142%files
143%defattr(644,root,root,755)
144%doc ChangeLog Developers
145%attr(755,root,root) %{_sbindir}/*
146%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apcupsd.conf
147%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/apcupsd
148%attr(754,root,root) %{_sysconfdir}/apccontrol
149%attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/changeme
150%attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/commfailure
151%attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/commok
152#%attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mainsback
153%attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/onbattery
154%attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/offbattery
155%if %{with cgi}
156%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/hosts.conf
157%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/multimon.conf
158%{_sysconfdir}/apcupsd.css
159%endif
160%attr(754,root,root) /etc/rc.d/init.d/apcupsd
161%attr(754,root,root) /etc/rc.d/init.d/halt
162%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/apcupsd
163%dir %{_sysconfdir}
164%dir /var/lib/apcupsd
165%attr(640,root,root) %ghost /var/log/apcupsd.events
166%attr(640,root,root) %ghost /var/lib/apcupsd/apcupsd.status
167%{_mandir}/man8/apcupsd.*
168
169%if %{with cgi}
170%files cgi
171%defattr(644,root,root,755)
172%attr(755,root,root) %{_cgidir}/*.cgi
173%endif
174
175%if %{with gapcmon}
176%files gapcmon
177%defattr(644,root,root,755)
178%attr(755,root,root) %{_bindir}/*
179%{_desktopdir}/gapcmon.desktop
180%{_pixmapsdir}/*
181%endif
This page took 0.031467 seconds and 4 git commands to generate.