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