]>
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 |
46f17c88 | 14 | Release: 1 |
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 |
d5bc45da | 24 | URL: http://www.apcupsd.com/ |
2cfbae37 | 25 | %{?with_gapcmon:BuildRequires: GConf2-devel >= 2.0} |
23d673ff | 26 | BuildRequires: autoconf |
364fab20 | 27 | BuildRequires: automake |
28 | BuildRequires: gd-devel | |
2cfbae37 | 29 | %{?with_gapcmon:BuildRequires: gtk+2-devel >= 2:2.4.0} |
364fab20 | 30 | BuildRequires: man |
2cfbae37 JB |
31 | %{?with_snmp:BuildRequires: net-snmp-devel} |
32 | BuildRequires: pkgconfig | |
502a8f9c | 33 | BuildRequires: rpmbuild(macros) >= 1.268 |
2caf2249 | 34 | BuildRequires: util-linux |
5bb78d9f | 35 | Requires(post): fileutils |
232188ee | 36 | Requires(post,preun): /sbin/chkconfig |
3e8f890a | 37 | Requires: rc-scripts |
9860ec16 | 38 | BuildRoot: %{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 | 44 | UPS power management under Linux for APCC Products. It allows your |
6a96dc52 | 45 | computer/server to run during power problems for a specified length of |
46 | time or the life of the batteries in your BackUPS, BackUPS Pro, | |
47 | SmartUPS v/s, or SmartUPS, and then properly executes a controlled | |
48 | shutdown during an extended power failure. | |
03dfd68e | 49 | |
c69e54dd JR |
50 | %description -l pl.UTF-8 |
51 | Oprogramowanie do zarządzania energią dla UPS-ów APC. Pozwala | |
52 | komputerowi działać po awarii zasilania przez określony czas lub czas | |
53 | życia akumulatorów w BackUPS, BackUPS Pro, SmartUPS v/s, SmartUPS oraz | |
54 | odpowiednio uruchamia kontrolowany shutdown przy dłuższej awarii | |
7ff8ac4b JB |
55 | zasilania. |
56 | ||
364fab20 | 57 | %package cgi |
86fcc136 | 58 | Summary: upsstats - Web-based UPS status viewer |
f755a48e | 59 | Summary(pl.UTF-8): upsstats - oparta na WWW przeglądarka stanu UPS-a |
86fcc136 | 60 | Group: Applications/Networking |
61 | Requires: webserver | |
80be390e MW |
62 | |
63 | %description cgi | |
36dc352e JB |
64 | upsstats.cgi builds a lightweight web page containing basic UPS status |
65 | information. | |
66 | ||
c69e54dd JR |
67 | %description cgi -l pl.UTF-8 |
68 | upsstats.cgi tworzy lekką stronę WWW zawierającą podstawowe informacje | |
36dc352e | 69 | o stanie UPS-a. |
80be390e | 70 | |
270d92b6 TP |
71 | %package gapcmon |
72 | Summary: Apcupsd GUI monitoring application | |
73 | Summary(pl.UTF-8): Aplikacja GUI monitorowania Apcupsd | |
74 | Group: X11/Applications | |
b0cabf4c | 75 | URL: http://gapcmon.sourceforge.net/ |
270d92b6 TP |
76 | |
77 | %description gapcmon | |
0a602502 JB |
78 | GNOME/GTK+ based application which integrates into most desktop panels |
79 | (not just GNOME). It monitors one or more Apcupsd instances using | |
80 | Apcupsd's NIS networking server. The status of each UPS is shown with | |
81 | a icon. | |
270d92b6 TP |
82 | |
83 | %description gapcmon -l pl.UTF-8 | |
0a602502 JB |
84 | Oparta na GNOME/GTK+ aplikacja, która integruje się z panelami (nie |
85 | tylko Gnome). Monitoruje jedną bądź kilka instancji Apcupsd za pomocą | |
86 | serwera 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 | 92 | for i in configure.in aclocal.m4 config.h.in; do install autoconf/$i .;done |
2fab7262 | 93 | cp -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 | 118 | rm -rf $RPM_BUILD_ROOT |
f3858603 | 119 | install -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 |
125 | install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/apcupsd |
126 | cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/apcupsd | |
127 | cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/apcupsd | |
d5bc45da | 128 | |
79f87cb5 | 129 | touch $RPM_BUILD_ROOT/var/log/apcupsd.events |
d5bc45da | 130 | touch $RPM_BUILD_ROOT/var/lib/apcupsd/apcupsd.status |
03dfd68e | 131 | |
9ed364ac AA |
132 | cat > $RPM_BUILD_ROOT/etc/rc.d/init.d/halt << EOF |
133 | #!/bin/sh | |
b0cabf4c | 134 | exec /etc/rc.d/init.d/apcupsd powerdown |
9ed364ac AA |
135 | EOF |
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 | 141 | rm -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 | 148 | if [ "$1" = "0" ]; then |
502a8f9c | 149 | %service apcupsd stop |
61e20730 | 150 | /sbin/chkconfig --del apcupsd |
7ff8ac4b | 151 | fi |
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 |