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