3 %bcond_without hidups # experimental hidups driver
5 Summary: Network UPS Tools
6 Summary(pl): Sieciowe narzêdzie do UPS-ów
11 Group: Applications/System
12 Source0: http://eu1.networkupstools.org/source/2.0/%{name}-%{version}.tar.gz
13 # Source0-md5: 6560df8d0a42f0f585d34ed1ae8c6f67
15 Source2: %{name}.sysconfig
16 Source3: %{name}-upsmon.init
17 Source4: %{name}.sysconfig.upsmon
18 Patch0: %{name}-client.patch
19 Patch1: %{name}-datadir.patch
20 Patch2: %{name}-config.patch
21 URL: http://www.networkupstools.org/
22 BuildRequires: autoconf
23 BuildRequires: automake
24 BuildRequires: gd-devel >= 2.0.15
25 BuildRequires: libpng-devel
26 BuildRequires: openssl-devel >= 0.9.7d
27 BuildRequires: rpmbuild(macros) >= 1.202
29 Requires(post,preun): /sbin/chkconfig
30 Requires: %{name}-common = %{version}-%{release}
31 Obsoletes: smartupstools
32 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34 %define _sysconfdir /etc/ups
37 These programs are part of a developing project to monitor the
38 assortment of UPSes that are found out there in the field. Many models
39 have serial serial ports of some kind that allow some form of state
40 checking. This capability has been harnessed where possible to allow
41 for safe shutdowns, live status tracking on web pages, and more.
44 Te programy s± czê¶ci± projektu do monitorowania wielu UPS-ów w jakim¶
45 otoczeniu. Wiele modeli ma porty szeregowe i pozwala na jak±¶ formê
46 sprawdzania stanu. Ta funkcjonalno¶æ pozwala na bezpieczne
47 zatrzymywanie systemów, sprawdzanie stanu zasilania przez WWW i inne.
50 üÔÉ ÐÒÏÇÒÁÍÍÙ - ÞÁÓÔØ ÐÒÏÅËÔÁ ÐÏ ÍÏÎÉÔÏÒÉÎÇÕ ÒÁÚÌÉÞÎÙÈ UPS. õ ÍÎÏÇÉÈ
51 ÍÏÄÅÌÅÊ ÅÓÔØ ÓÅÒÉÁÌØÎÙÅ ÐÏÒÔÙ, ÐÏÚ×ÏÌÑÀÝÉÅ ÐÒÏ×ÅÒÑÔØ ÓÏÓÔÏÑÎÉÅ ÜÔÉÈ
52 UPS. üÔÁ ×ÏÚÍÏÖÎÏÓÔØ ÂÙÌÁ ÉÓÐÏÌØÚÏ×ÁÎÁ, ÇÄÅ ÜÔÏ ×ÏÚÍÏÖÎÏ, ÄÌÑ
53 ×ÙÐÏÌÎÅÎÉÑ ÂÅÚÏÐÁÓÎÙÈ ÏÓÔÁÎÏ×Ï× ËÏÍÐØÀÔÅÒÏ×, ÏÔÓÌÅÖÉ×ÁÎÉÑ ÓÔÁÔÕÓÁ
57 㦠ÐÒÏÇÒÁÍÉ ¤ ÞÁÓÔÉÎÏÀ ÐÒÏÅËÔÕ ÐÏ ÍÏΦÔÏÒÉÎÇÕ Ò¦ÚÎÏÍÁΦÔÎÉÈ UPS.
58 âÁÇÁÔÏ ÍÏÄÅÌÅÊ ÍÁÀÔØ ÓÅÒ¦ÁÌØΦ ÐÏÒÔÉ, ÝÏ ÄÏÚ×ÏÌÑÔØ ÐÅÒÅצÒÑÔÉ ÓÔÁÎ ÃÉÈ
59 UPS. ãÑ ÍÏÖÌÉצÓÔØ ÂÕÌÁ ×ÉËÏÒÉÓÔÁÎÁ, ÄÅ ÃÅ ÍÏÖÌÉ×Ï, ÄÌÑ ×ÉËÏÎÁÎÎÑ
60 ÂÅÚÐÅÞÎÉÈ ÚÕÐÉÎÏË ËÏÍÐ'ÀÔÅÒ¦×, צÄÓ̦ÄËÏ×Õ×ÁÎÎÑ ÓÔÁÔÕÓÕ ÞÅÒÅÚ ×ÅÂ,
64 Summary: Package with common files for nut daemon and its clients
65 Summary(pl): Pakiet z plikami wspólnymi dla demona nut i jego klientów
66 Group: Applications/System
67 Requires(pre): /bin/id
68 Requires(pre): /usr/bin/getgid
69 Requires(pre): /usr/sbin/groupadd
70 Requires(pre): /usr/sbin/groupmod
71 Requires(pre): /usr/sbin/useradd
72 Requires(postun): /usr/sbin/groupdel
73 Requires(postun): /usr/sbin/userdel
78 Package with common files for nut daemon and its clients.
80 %description common -l pl
81 Pakiet z plikami wspólnymi dla demona nut i jego klientów.
84 Summary: Multi-vendor UPS Monitoring Project Client Utilities
85 Summary(pl): Narzêdzia klienckie do monitorowania UPS-ów
86 Summary(uk): Network UPS Tools - Ë̦¤ÎÔÓØ˦ ÕÔÉ̦ÔÉ ÍÏΦÔÏÒÉÎÇÕ
87 Summary(ru): Network UPS Tools - ËÌÉÅÎÔÓËÉÅ ÕÔÉÌÉÔÙ ÍÏÎÉÔÏÒÉÎÇÁ
88 Group: Applications/System
90 Requires(post,preun): /sbin/chkconfig
91 Requires: %{name}-common = %{version}-%{release}
94 This package includes the client utilities that are required to
95 monitor a UPS that the client host is plugged into but monitored via
96 serial cable by another host on the network....
98 %description client -l pl
99 Ten pakiet zawiera narzêdzia kliencie potrzebne do monitorowania UPS-a
100 do którego pod³±czony jest komputer kliencki, kiedy kabel szeregowy
101 UPS-a jest pod³±czony do innego komputera w sieci.
103 %description client -l ru
104 üÔÏÔ ÐÁËÅÔ ×ËÌÀÞÁÅÔ ËÌÉÅÎÔÓËÉÅ ÕÔÉÌÉÔÙ, ÎÅÏÂÈÏÄÉÍÙÅ ÄÌÑ ÍÏÎÉÔÏÒÉÎÇÁ
105 UPS, Ë ËÏÔÏÒÏÍÕ ËÌÉÅÎÔÓËÉÊ ÈÏÓÔ ÉÍÅÅÔ ÄÏÓÔÕÐ, ÎÏ UPS ÆÉÚÉÞÅÓËÉ
106 ÐÏÄËÌÀÞÅÎ Ë ÄÒÕÇÏÍÕ ËÏÍÐØÀÔÅÒÕ × ÓÅÔÉ.
108 %description client -l uk
109 ãÅÊ ÐÁËÅÔ ×ËÌÀÞÁ¤ Ë̦¤ÎÔÓØ˦ ÕÔÉ̦ÔÉ, ÐÏÔÒ¦ÂΦ ÄÌÑ ÍÏΦÔÏÒÉÎÇÕ UPS, ÄÏ
110 ÑËÏÇÏ Ë̦¤ÎÔÓØËÉÊ ÈÏÓÔ ÍÁ¤ ÄÏÓÔÕÐ, ÁÌÅ UPS ƦÚÉÞÎÏ Ð¦ÄËÌÀÞÅÎÉÊ ÄÏ
111 ¦ÎÛÏÇÏ ËÏÍÐ'ÀÔÅÒÕ × ÍÅÒÅÖ¦.
114 Summary: Multi-vendor UPS Monitoring Project Server - CGI utils
115 Summary(pl): Narzêdzia CGI do monitorowania UPS-ów
116 Summary(ru): Network UPS Tools - CGI ÕÔÉÌÉÔÙ
117 Summary(uk): Network UPS Tools - CGI ÕÔÉ̦ÔÉ
118 Group: Applications/System
119 Requires: %{name}-common = %{version}-%{release}
122 These programs are part of a developing project to monitor the
123 assortment of UPSes that are found out there in the field. Many models
124 have serial serial ports of some kind that allow some form of state
125 checking. This capability has been harnessed where possible to allow
126 for safe shutdowns, live status tracking on web pages, and more. This
127 package contains CGI utils.
129 %description cgi -l pl
130 Te programy s± czê¶ci± projektu do monitorowania wielu UPS-ów w jakim¶
131 otoczeniu. Wiele modeli ma porty szeregowe i pozwala na jak±¶ formê
132 sprawdzania stanu. Ta funkcjonalno¶æ pozwala na bezpieczne
133 zatrzymywanie systemów, sprawdzanie stanu zasilania przez WWW i inne.
134 Ten pakiet zawiera narzêdzia CGI.
136 %description cgi -l ru
137 üÔÏÔ ÐÁËÅÔ ×ËÌÀÞÁÅÔ CGI ÐÒÏÇÒÁÍÍÙ ÄÌÑ ÄÏÓÔÕÐÁ Ë ÉÎÆÏÒÍÁÃÉÉ Ï ÓÔÁÔÕÓÅ
138 UPS ÞÅÒÅÚ ×ÅÂ-ÉÎÔÅÒÆÅÊÓ.
140 %description cgi -l uk
141 ãÅÊ ÐÁËÅÔ ×ËÌÀÞÁ¤ CGI ÐÒÏÇÒÁÍÉ ÄÌÑ ÄÏÓÔÕÐÕ ÄÏ ¦ÎÆÏÒÍÁæ§ ÐÒÏ ÓÔÁÔÕÓ
142 UPS ÞÅÒÅÚ ×ÅÂ-¦ÎÔÅÒÆÅÊÓ.
145 Summary: Files for NUT clients development
146 Summary(pl): Pliki do tworzenia klientów NUT-a
147 Group: Development/Libraries
148 Requires: openssl-devel >= 0.9.7c
149 # it does NOT require nut
152 Object file and header for developing NUT clients.
154 %description devel -l pl
155 Plik wynikowy oraz nag³ówek s³u¿±ce do tworzenia klientów NUT-a.
164 cp -f /usr/share/automake/config.sub .
167 LDFLAGS="-L%{_prefix}/X11R6/%{_lib}"; export LDFLAGS
169 %{?with_hidups:--with-linux-hiddev} \
172 --with-linux-hiddev=%{_includedir}/linux/hiddev.h \
173 --with-statepath=%{_var}/lib/ups \
174 --with-drvpath=/lib/nut \
175 --with-cgipath=/home/services/httpd/cgi-bin \
179 %{?with_hidups:%{__make} build-usb}
182 rm -rf $RPM_BUILD_ROOT
183 install -d $RPM_BUILD_ROOT{/sbin,/etc/{sysconfig,rc.d/init.d},/var/lib/ups} \
184 $RPM_BUILD_ROOT{/lib/nut,%{_libdir},%{_includedir}/nut}
186 %{__make} install install-cgi \
187 DESTDIR=$RPM_BUILD_ROOT
189 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ups
190 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ups
191 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/upsmon
192 install %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/upsmon
194 rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/*
195 install conf/*.users conf/*.conf conf/*.html $RPM_BUILD_ROOT%{_sysconfdir}
197 install clients/upsclient.o common/parseconf.o $RPM_BUILD_ROOT%{_libdir}
198 install clients/upsclient.h include/parseconf.h $RPM_BUILD_ROOT%{_includedir}/nut
200 %{?with_hidups:install drivers/hidups $RPM_BUILD_ROOT/lib/nut}
202 cat > $RPM_BUILD_ROOT/sbin/poweroff-ups << EOF
204 /etc/rc.d/init.d/ups powerdown
208 rm -rf $RPM_BUILD_ROOT
211 /sbin/chkconfig --add ups
212 if [ -f /var/lock/subsys/ups ]; then
213 /etc/rc.d/init.d/ups restart >&2
215 echo "Run \"/etc/rc.d/init.d/ups start\" to start NUT ups daemon."
219 if [ "$1" = "0" ]; then
220 if [ -f /var/lock/subsys/ups ]; then
221 /etc/rc.d/init.d/ups stop >&2
223 /sbin/chkconfig --del ups
228 if [ -n "`/usr/bin/getgid ups`" ] && [ "`/usr/bin/getgid ups`" = 121 ]; then
229 /usr/sbin/groupmod -g 76 ups
230 chgrp ups %{_sysconfdir}/{upsd.conf,ups.conf,upsd.users}
231 /usr/sbin/usermod -g 76 ups
234 %useradd -u 70 -d /usr/share/empty -s /bin/false -c "UPS Manager User" -g ups ups
237 /sbin/chkconfig --add upsmon
238 if [ -f /var/lock/subsys/upsmon ]; then
239 /etc/rc.d/init.d/upsmon restart >&2
241 echo "Run \"/etc/rc.d/init.d/upsmon start\" to start NUT upsmon daemon."
245 if [ "$1" = "0" ]; then
246 if [ -f /var/lock/subsys/upsmon ]; then
247 /etc/rc.d/init.d/upsmon stop >&2
249 /sbin/chkconfig --del upsmon
253 if [ "$1" = "0" ]; then
259 %defattr(644,root,root,755)
260 %attr(755,root,root) %{_bindir}/upscmd
261 %attr(755,root,root) %{_bindir}/upslog
262 %attr(755,root,root) %{_bindir}/upsrw
263 %attr(755,root,root) %{_sbindir}/upsd
264 %attr(755,root,root) /sbin/poweroff-ups
265 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ups
266 %attr(754,root,root) /etc/rc.d/init.d/ups
267 %attr(640,root,ups) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/upsd.conf
268 %attr(640,root,ups) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ups.conf
269 %attr(640,root,ups) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/upsd.users
270 %{_mandir}/man5/ups.conf.5*
271 %{_mandir}/man5/upsd.conf.5*
272 %{_mandir}/man5/upsd.users.5*
273 %{_mandir}/man8/[!u]*.8*
274 %{_mandir}/man8/upscmd.8*
275 %{_mandir}/man8/upscode2.8*
276 %{_mandir}/man8/upsd.8*
277 %{_mandir}/man8/upsdrvctl.8*
278 %{_mandir}/man8/upslog.8*
279 %{_mandir}/man8/upsrw.8*
280 %dir %attr(770,root,ups) /var/lib/ups
282 %attr(755,root,root) /lib/nut/*
286 %defattr(644,root,root,755)
287 %doc NEWS README CHANGES CREDITS docs
291 %defattr(644,root,root,755)
292 %attr(755,root,root) %{_bindir}/upsc
293 %attr(755,root,root) %{_sbindir}/upsmon
294 %attr(755,root,root) %{_sbindir}/upssched
295 %attr(755,root,root) %{_sbindir}/upssched-cmd
296 %attr(754,root,root) /etc/rc.d/init.d/upsmon
297 %attr(640,root,ups) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/upsmon.conf
298 %attr(640,root,ups) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/upssched.conf
299 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/upsmon
300 %{_mandir}/man5/upsmon.conf.5*
301 %{_mandir}/man5/upssched.conf.5*
302 %{_mandir}/man8/upsc.8*
303 %{_mandir}/man8/upsmon.8*
304 %{_mandir}/man8/upssched.8*
307 %defattr(644,root,root,755)
308 %attr(755,root,root) /home/services/httpd/cgi-bin/*.cgi
309 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/hosts.conf
310 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/upsset.conf
311 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.html
312 %{_mandir}/man5/hosts.conf.5*
313 %{_mandir}/man5/upsset.conf.5*
314 %{_mandir}/man5/upsstats.html.5*
315 %{_mandir}/man8/upsimage.cgi.8*
316 %{_mandir}/man8/upsset.cgi.8*
317 %{_mandir}/man8/upsstats.cgi.8*
320 %defattr(644,root,root,755)
321 %{_libdir}/upsclient.o
322 %{_libdir}/parseconf.o