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