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