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