]> git.pld-linux.org Git - packages/apcupsd.git/blame - apcupsd.spec
- fix format string error
[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
4ed79b55 14Release: 3
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
4ed79b55 24Patch2: format-security.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}
4ed79b55 31BuildRequires: man-db
2cfbae37
JB
32%{?with_snmp:BuildRequires: net-snmp-devel}
33BuildRequires: pkgconfig
502a8f9c 34BuildRequires: rpmbuild(macros) >= 1.268
2caf2249 35BuildRequires: util-linux
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
b0cabf4c 76URL: http://gapcmon.sourceforge.net/
270d92b6
TP
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
4ed79b55 93%patch2 -p1
23d673ff 94for i in configure.in aclocal.m4 config.h.in; do install autoconf/$i .;done
2fab7262 95cp -f %{_datadir}/automake/config.sub autoconf
03dfd68e 96
97%build
23d673ff 98%{__autoconf}
79f87cb5 99%configure \
364fab20 100 APCUPSD_MAIL="/bin/mail" \
101 SHUTDOWN="/sbin/shutdown" \
102 WALL="%{_bindir}/wall" \
9ed364ac
AA
103 --with-log-dir=%{_var}/log \
104 --with-stat-dir=%{_var}/lib/apcupsd \
80be390e
MW
105%if %{with cgi}
106 --enable-cgi \
107 --with-cgi-bin=/home/services/httpd/cgi-bin \
80be390e 108%endif
9c3ad2b9 109 %{?with_test:--enable-test} \
61e20730 110%if %{with net}
240a4dad 111 --enable-net \
0e1241bd 112%endif
2fab7262 113 %{?with_gapcmon:--enable-gapcmon} \
d8ccf3e8 114 %{?with_snmp:--enable-snmp} \
44319652 115 %{?with_usb:--enable-usb}
79f87cb5 116
e6609c22 117%{__make}
118
03dfd68e 119%install
6a96dc52 120rm -rf $RPM_BUILD_ROOT
f3858603 121install -d $RPM_BUILD_ROOT/etc/{apcupsd,logrotate.d,rc.d/init.d,sysconfig} \
79f87cb5 122 $RPM_BUILD_ROOT/var/{log,lib/apcupsd}
bb2476bb 123
d5bc45da
JB
124%{__make} install \
125 DESTDIR=$RPM_BUILD_ROOT
270d92b6 126
b0cabf4c
ER
127install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/apcupsd
128cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/apcupsd
129cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/apcupsd
d5bc45da 130
79f87cb5 131touch $RPM_BUILD_ROOT/var/log/apcupsd.events
d5bc45da 132touch $RPM_BUILD_ROOT/var/lib/apcupsd/apcupsd.status
03dfd68e 133
9ed364ac
AA
134cat > $RPM_BUILD_ROOT/etc/rc.d/init.d/halt << EOF
135#!/bin/sh
b0cabf4c 136exec /etc/rc.d/init.d/apcupsd powerdown
9ed364ac
AA
137EOF
138
b0cabf4c
ER
139# no hal
140%{__rm} $RPM_BUILD_ROOT%{_datadir}/hal/fdi/policy/20thirdparty/80-apcupsd-ups-policy.fdi
141
03dfd68e 142%clean
7ff8ac4b 143rm -rf $RPM_BUILD_ROOT
03dfd68e 144
145%post
4a9afcae 146/sbin/chkconfig --add apcupsd
502a8f9c 147%service apcupsd restart "apcupsd daemon"
bb2476bb 148
03dfd68e 149%preun
7ff8ac4b 150if [ "$1" = "0" ]; then
502a8f9c 151 %service apcupsd stop
61e20730 152 /sbin/chkconfig --del apcupsd
7ff8ac4b 153fi
03dfd68e 154
155%files
82761b0b 156%defattr(644,root,root,755)
91aa732c 157%doc ChangeLog Developers
364fab20 158%attr(755,root,root) %{_sbindir}/apcaccess
159%attr(755,root,root) %{_sbindir}/apctest
160%attr(755,root,root) %{_sbindir}/apcupsd
161%attr(755,root,root) %{_sbindir}/smtp
b9be4436
SP
162%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apcupsd.conf
163%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/apcupsd
79f87cb5 164%attr(754,root,root) %{_sysconfdir}/apccontrol
9cbeab38
MWP
165%attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/changeme
166%attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/commfailure
167%attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/commok
168#%attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mainsback
9cbeab38
MWP
169%attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/onbattery
170%attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/offbattery
80be390e 171%if %{with cgi}
36dc352e
JB
172%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/hosts.conf
173%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/multimon.conf
174%{_sysconfdir}/apcupsd.css
80be390e 175%endif
e6609c22 176%attr(754,root,root) /etc/rc.d/init.d/apcupsd
9ed364ac 177%attr(754,root,root) /etc/rc.d/init.d/halt
b9be4436
SP
178%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/apcupsd
179%dir %{_sysconfdir}
79f87cb5
AA
180%dir /var/lib/apcupsd
181%attr(640,root,root) %ghost /var/log/apcupsd.events
182%attr(640,root,root) %ghost /var/lib/apcupsd/apcupsd.status
2caf2249 183%{_mandir}/man8/apcupsd.8*
c2ec4af9 184%{_mandir}/man8/apctest.8*
185%{_mandir}/man8/apcaccess.8*
186%{_mandir}/man8/apccontrol.8*
187%{_mandir}/man5/apcupsd.conf.5*
80be390e 188
2fab7262 189%if %{with cgi}
80be390e
MW
190%files cgi
191%defattr(644,root,root,755)
192%attr(755,root,root) %{_cgidir}/*.cgi
2fab7262 193%endif
270d92b6 194
2fab7262 195%if %{with gapcmon}
270d92b6
TP
196%files gapcmon
197%defattr(644,root,root,755)
2cfbae37 198%attr(755,root,root) %{_bindir}/gapcmon
270d92b6 199%{_desktopdir}/gapcmon.desktop
2cfbae37 200%{_pixmapsdir}/*.png
2fab7262 201%endif
This page took 0.090457 seconds and 4 git commands to generate.