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