]> git.pld-linux.org Git - packages/apcupsd.git/blame - apcupsd.spec
- gapcmon specific url, hal cleanup
[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
b0cabf4c 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
c2ec4af9 13Version: 3.14.10
46f17c88 14Release: 1
82761b0b 15License: GPL v2
6a96dc52 16Group: Networking/Daemons
1cc974df 17Source0: http://downloads.sourceforge.net/apcupsd/%{name}-%{version}.tar.gz
c2ec4af9 18# Source0-md5: 5928822d855c5cf7ac29655e3e0b8c23
79f87cb5
AA
19Source1: %{name}.init
20Source2: %{name}.logrotate
9a2c1151 21Source3: %{name}.sysconfig
79f87cb5 22Patch0: %{name}-configure.patch
94d3fe97 23Patch1: %{name}-pcnet-seconds.patch
d5bc45da 24URL: http://www.apcupsd.com/
2cfbae37 25%{?with_gapcmon:BuildRequires: GConf2-devel >= 2.0}
23d673ff 26BuildRequires: autoconf
364fab20 27BuildRequires: automake
28BuildRequires: gd-devel
2cfbae37 29%{?with_gapcmon:BuildRequires: gtk+2-devel >= 2:2.4.0}
364fab20 30BuildRequires: man
2cfbae37
JB
31%{?with_snmp:BuildRequires: net-snmp-devel}
32BuildRequires: pkgconfig
502a8f9c 33BuildRequires: rpmbuild(macros) >= 1.268
2caf2249 34BuildRequires: util-linux
5bb78d9f 35Requires(post): fileutils
232188ee 36Requires(post,preun): /sbin/chkconfig
3e8f890a 37Requires: rc-scripts
9860ec16 38BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
03dfd68e 39
1d49e6a6 40%define _sysconfdir /etc/apcupsd
502a8f9c 41%define _cgidir /home/services/httpd/cgi-bin
2534c785 42
03dfd68e 43%description
82761b0b 44UPS power management under Linux for APCC Products. It allows your
6a96dc52 45computer/server to run during power problems for a specified length of
46time or the life of the batteries in your BackUPS, BackUPS Pro,
47SmartUPS v/s, or SmartUPS, and then properly executes a controlled
48shutdown during an extended power failure.
03dfd68e 49
c69e54dd
JR
50%description -l pl.UTF-8
51Oprogramowanie do zarządzania energią dla UPS-ów APC. Pozwala
52komputerowi działać po awarii zasilania przez określony czas lub czas
53życia akumulatorów w BackUPS, BackUPS Pro, SmartUPS v/s, SmartUPS oraz
54odpowiednio uruchamia kontrolowany shutdown przy dłuższej awarii
7ff8ac4b
JB
55zasilania.
56
364fab20 57%package cgi
86fcc136 58Summary: upsstats - Web-based UPS status viewer
f755a48e 59Summary(pl.UTF-8): upsstats - oparta na WWW przeglądarka stanu UPS-a
86fcc136 60Group: Applications/Networking
61Requires: webserver
80be390e
MW
62
63%description cgi
36dc352e
JB
64upsstats.cgi builds a lightweight web page containing basic UPS status
65information.
66
c69e54dd
JR
67%description cgi -l pl.UTF-8
68upsstats.cgi tworzy lekką stronę WWW zawierającą podstawowe informacje
36dc352e 69o stanie UPS-a.
80be390e 70
270d92b6
TP
71%package gapcmon
72Summary: Apcupsd GUI monitoring application
73Summary(pl.UTF-8): Aplikacja GUI monitorowania Apcupsd
74Group: X11/Applications
b0cabf4c 75URL: http://gapcmon.sourceforge.net/
270d92b6
TP
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
b0cabf4c
ER
125install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/apcupsd
126cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/apcupsd
127cp -p %{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
b0cabf4c 134exec /etc/rc.d/init.d/apcupsd powerdown
9ed364ac
AA
135EOF
136
b0cabf4c
ER
137# no hal
138%{__rm} $RPM_BUILD_ROOT%{_datadir}/hal/fdi/policy/20thirdparty/80-apcupsd-ups-policy.fdi
139
03dfd68e 140%clean
7ff8ac4b 141rm -rf $RPM_BUILD_ROOT
03dfd68e 142
143%post
4a9afcae 144/sbin/chkconfig --add apcupsd
502a8f9c 145%service apcupsd restart "apcupsd daemon"
bb2476bb 146
03dfd68e 147%preun
7ff8ac4b 148if [ "$1" = "0" ]; then
502a8f9c 149 %service apcupsd stop
61e20730 150 /sbin/chkconfig --del apcupsd
7ff8ac4b 151fi
03dfd68e 152
153%files
82761b0b 154%defattr(644,root,root,755)
91aa732c 155%doc ChangeLog Developers
364fab20 156%attr(755,root,root) %{_sbindir}/apcaccess
157%attr(755,root,root) %{_sbindir}/apctest
158%attr(755,root,root) %{_sbindir}/apcupsd
159%attr(755,root,root) %{_sbindir}/smtp
b9be4436
SP
160%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apcupsd.conf
161%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/apcupsd
79f87cb5 162%attr(754,root,root) %{_sysconfdir}/apccontrol
9cbeab38
MWP
163%attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/changeme
164%attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/commfailure
165%attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/commok
166#%attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mainsback
9cbeab38
MWP
167%attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/onbattery
168%attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/offbattery
80be390e 169%if %{with cgi}
36dc352e
JB
170%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/hosts.conf
171%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/multimon.conf
172%{_sysconfdir}/apcupsd.css
80be390e 173%endif
e6609c22 174%attr(754,root,root) /etc/rc.d/init.d/apcupsd
9ed364ac 175%attr(754,root,root) /etc/rc.d/init.d/halt
b9be4436
SP
176%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/apcupsd
177%dir %{_sysconfdir}
79f87cb5
AA
178%dir /var/lib/apcupsd
179%attr(640,root,root) %ghost /var/log/apcupsd.events
180%attr(640,root,root) %ghost /var/lib/apcupsd/apcupsd.status
2caf2249 181%{_mandir}/man8/apcupsd.8*
c2ec4af9 182%{_mandir}/man8/apctest.8*
183%{_mandir}/man8/apcaccess.8*
184%{_mandir}/man8/apccontrol.8*
185%{_mandir}/man5/apcupsd.conf.5*
80be390e 186
2fab7262 187%if %{with cgi}
80be390e
MW
188%files cgi
189%defattr(644,root,root,755)
190%attr(755,root,root) %{_cgidir}/*.cgi
2fab7262 191%endif
270d92b6 192
2fab7262 193%if %{with gapcmon}
270d92b6
TP
194%files gapcmon
195%defattr(644,root,root,755)
2cfbae37 196%attr(755,root,root) %{_bindir}/gapcmon
270d92b6 197%{_desktopdir}/gapcmon.desktop
2cfbae37 198%{_pixmapsdir}/*.png
2fab7262 199%endif
This page took 0.108321 seconds and 4 git commands to generate.