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/testing/%{name}-%{version}-pre4.tar.gz
13 # Source0-md5: 399f79406e07aa2a689bc6a119b0fcad
14 # Source0-size: 563526
16 Source2: %{name}.sysconfig
17 Source3: %{name}-upsmon.init
18 Source4: %{name}.sysconfig.upsmon
19 Patch0: %{name}-client.patch
20 Patch1: %{name}-datadir.patch
21 Patch2: %{name}-config.patch
22 URL: http://www.networkupstools.org/
23 BuildRequires: autoconf
24 BuildRequires: automake
25 BuildRequires: gd-devel >= 2.0.15
26 BuildRequires: libpng-devel
27 BuildRequires: openssl-devel >= 0.9.7d
28 BuildRequires: rpmbuild(macros) >= 1.159
30 Requires(pre): /bin/id
31 Requires(pre): /usr/bin/getgid
32 Requires(pre): /usr/sbin/groupadd
33 Requires(pre): /usr/sbin/groupmod
34 Requires(pre): /usr/sbin/useradd
35 Requires(post,preun): /sbin/chkconfig
36 Requires(postun): /usr/sbin/groupdel
37 Requires(postun): /usr/sbin/userdel
38 Requires: %{name}-common = %{version}-%{release}
41 Obsoletes: smartupstools
42 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44 %define _sysconfdir /etc/ups
47 These programs are part of a developing project to monitor the
48 assortment of UPSes that are found out there in the field. Many models
49 have serial serial ports of some kind that allow some form of state
50 checking. This capability has been harnessed where possible to allow
51 for safe shutdowns, live status tracking on web pages, and more.
53 This nut ships with modified everups.c - support for Ever UPS models
54 (by Mikolaj Tutak <mtutak@eranet.pl>)
57 Te programy s± czê¶ci± projektu do monitorowania wielu UPS-ów w jakim¶
58 otoczeniu. Wiele modeli ma porty szeregowe i pozwala na jak±¶ formê
59 sprawdzania stanu. Ta funkcjonalno¶æ pozwala na bezpieczne
60 zatrzymywanie systemów, sprawdzanie stanu zasilania przez WWW i inne.
62 Ta wersja posiada zmieniony sterownik everups.c - obs³uguje zasilacze
63 firmy Ever UPS models (autorstwa Miko³aja Tutaka <mtutak@eranet.pl>)
66 üÔÉ ÐÒÏÇÒÁÍÍÙ - ÞÁÓÔØ ÐÒÏÅËÔÁ ÐÏ ÍÏÎÉÔÏÒÉÎÇÕ ÒÁÚÌÉÞÎÙÈ UPS. õ ÍÎÏÇÉÈ
67 ÍÏÄÅÌÅÊ ÅÓÔØ ÓÅÒÉÁÌØÎÙÅ ÐÏÒÔÙ, ÐÏÚ×ÏÌÑÀÝÉÅ ÐÒÏ×ÅÒÑÔØ ÓÏÓÔÏÑÎÉÅ ÜÔÉÈ
68 UPS. üÔÁ ×ÏÚÍÏÖÎÏÓÔØ ÂÙÌÁ ÉÓÐÏÌØÚÏ×ÁÎÁ, ÇÄÅ ÜÔÏ ×ÏÚÍÏÖÎÏ, ÄÌÑ
69 ×ÙÐÏÌÎÅÎÉÑ ÂÅÚÏÐÁÓÎÙÈ ÏÓÔÁÎÏ×Ï× ËÏÍÐØÀÔÅÒÏ×, ÏÔÓÌÅÖÉ×ÁÎÉÑ ÓÔÁÔÕÓÁ
73 㦠ÐÒÏÇÒÁÍÉ ¤ ÞÁÓÔÉÎÏÀ ÐÒÏÅËÔÕ ÐÏ ÍÏΦÔÏÒÉÎÇÕ Ò¦ÚÎÏÍÁΦÔÎÉÈ UPS.
74 âÁÇÁÔÏ ÍÏÄÅÌÅÊ ÍÁÀÔØ ÓÅÒ¦ÁÌØΦ ÐÏÒÔÉ, ÝÏ ÄÏÚ×ÏÌÑÔØ ÐÅÒÅצÒÑÔÉ ÓÔÁÎ ÃÉÈ
75 UPS. ãÑ ÍÏÖÌÉצÓÔØ ÂÕÌÁ ×ÉËÏÒÉÓÔÁÎÁ, ÄÅ ÃÅ ÍÏÖÌÉ×Ï, ÄÌÑ ×ÉËÏÎÁÎÎÑ
76 ÂÅÚÐÅÞÎÉÈ ÚÕÐÉÎÏË ËÏÍÐ'ÀÔÅÒ¦×, צÄÓ̦ÄËÏ×Õ×ÁÎÎÑ ÓÔÁÔÕÓÕ ÞÅÒÅÚ ×ÅÂ,
80 Summary: Package with common files for nut daemon and its clients
81 Summary(pl): Pakiet z plikami wspólnymi dla demona nut i jego klientów
82 Group: Applications/System
85 Package with common files for nut daemon and its clients.
87 %description common -l pl
88 Pakiet z plikami wspólnymi dla demona nut i jego klientów.
91 Summary: Multi-vendor UPS Monitoring Project Client Utilities
92 Summary(pl): Narzêdzia klienckie do monitorowania UPS-ów
93 Summary(uk): Network UPS Tools - Ë̦¤ÎÔÓØ˦ ÕÔÉ̦ÔÉ ÍÏΦÔÏÒÉÎÇÕ
94 Summary(ru): Network UPS Tools - ËÌÉÅÎÔÓËÉÅ ÕÔÉÌÉÔÙ ÍÏÎÉÔÏÒÉÎÇÁ
95 Group: Applications/System
97 Requires(post,preun): /sbin/chkconfig
98 Requires: %{name}-common = %{version}-%{release}
101 This package includes the client utilities that are required to
102 monitor a UPS that the client host is plugged into but monitored via
103 serial cable by another host on the network....
105 %description client -l pl
106 Ten pakiet zawiera narzêdzia kliencie potrzebne do monitorowania UPS-a
107 do którego pod³±czony jest komputer kliencki, kiedy kabel szeregowy
108 UPS-a jest pod³±czony do innego komputera w sieci.
110 %description client -l ru
111 üÔÏÔ ÐÁËÅÔ ×ËÌÀÞÁÅÔ ËÌÉÅÎÔÓËÉÅ ÕÔÉÌÉÔÙ, ÎÅÏÂÈÏÄÉÍÙÅ ÄÌÑ ÍÏÎÉÔÏÒÉÎÇÁ
112 UPS, Ë ËÏÔÏÒÏÍÕ ËÌÉÅÎÔÓËÉÊ ÈÏÓÔ ÉÍÅÅÔ ÄÏÓÔÕÐ, ÎÏ UPS ÆÉÚÉÞÅÓËÉ
113 ÐÏÄËÌÀÞÅÎ Ë ÄÒÕÇÏÍÕ ËÏÍÐØÀÔÅÒÕ × ÓÅÔÉ.
115 %description client -l uk
116 ãÅÊ ÐÁËÅÔ ×ËÌÀÞÁ¤ Ë̦¤ÎÔÓØ˦ ÕÔÉ̦ÔÉ, ÐÏÔÒ¦ÂΦ ÄÌÑ ÍÏΦÔÏÒÉÎÇÕ UPS, ÄÏ
117 ÑËÏÇÏ Ë̦¤ÎÔÓØËÉÊ ÈÏÓÔ ÍÁ¤ ÄÏÓÔÕÐ, ÁÌÅ UPS ƦÚÉÞÎÏ Ð¦ÄËÌÀÞÅÎÉÊ ÄÏ
118 ¦ÎÛÏÇÏ ËÏÍÐ'ÀÔÅÒÕ × ÍÅÒÅÖ¦.
121 Summary: Multi-vendor UPS Monitoring Project Server - CGI utils
122 Summary(pl): Narzêdzia CGI do monitorowania UPS-ów
123 Summary(ru): Network UPS Tools - CGI ÕÔÉÌÉÔÙ
124 Summary(uk): Network UPS Tools - CGI ÕÔÉ̦ÔÉ
125 Group: Applications/System
126 Requires: %{name}-common = %{version}-%{release}
129 These programs are part of a developing project to monitor the
130 assortment of UPSes that are found out there in the field. Many models
131 have serial serial ports of some kind that allow some form of state
132 checking. This capability has been harnessed where possible to allow
133 for safe shutdowns, live status tracking on web pages, and more. This
134 package contains CGI utils.
136 %description cgi -l pl
137 Te programy s± czê¶ci± projektu do monitorowania wielu UPS-ów w jakim¶
138 otoczeniu. Wiele modeli ma porty szeregowe i pozwala na jak±¶ formê
139 sprawdzania stanu. Ta funkcjonalno¶æ pozwala na bezpieczne
140 zatrzymywanie systemów, sprawdzanie stanu zasilania przez WWW i inne.
141 Ten pakiet zawiera narzêdzia CGI.
143 %description cgi -l ru
144 üÔÏÔ ÐÁËÅÔ ×ËÌÀÞÁÅÔ CGI ÐÒÏÇÒÁÍÍÙ ÄÌÑ ÄÏÓÔÕÐÁ Ë ÉÎÆÏÒÍÁÃÉÉ Ï ÓÔÁÔÕÓÅ
145 UPS ÞÅÒÅÚ ×ÅÂ-ÉÎÔÅÒÆÅÊÓ.
147 %description cgi -l uk
148 ãÅÊ ÐÁËÅÔ ×ËÌÀÞÁ¤ CGI ÐÒÏÇÒÁÍÉ ÄÌÑ ÄÏÓÔÕÐÕ ÄÏ ¦ÎÆÏÒÍÁæ§ ÐÒÏ ÓÔÁÔÕÓ
149 UPS ÞÅÒÅÚ ×ÅÂ-¦ÎÔÅÒÆÅÊÓ.
152 Summary: Files for NUT clients development
153 Summary(pl): Pliki do tworzenia klientów NUT-a
154 Group: Development/Libraries
155 Requires: openssl-devel >= 0.9.7c
156 # it does NOT require nut
159 Object file and header for developing NUT clients.
161 %description devel -l pl
162 Plik wynikowy oraz nag³ówek s³u¿±ce do tworzenia klientów NUT-a.
171 cp -f /usr/share/automake/config.sub .
174 LDFLAGS="-L%{_prefix}/X11R6/%{_lib}"; export LDFLAGS
176 %{?with_hidups:--with-linux-hiddev} \
179 --with-linux-hiddev=%{_includedir}/linux/hiddev.h \
180 --with-statepath=%{_var}/lib/ups \
181 --with-drvpath=/lib/nut \
182 --with-cgipath=/home/services/httpd/cgi-bin \
186 %{?with_hidups:%{__make} build-usb}
189 rm -rf $RPM_BUILD_ROOT
190 install -d $RPM_BUILD_ROOT{/sbin,/etc/{sysconfig,rc.d/init.d},/var/lib/ups} \
191 $RPM_BUILD_ROOT{/lib/nut,%{_libdir},%{_includedir}/nut}
193 %{__make} install install-cgi \
194 DESTDIR=$RPM_BUILD_ROOT
196 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ups
197 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ups
198 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/upsmon
199 install %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/upsmon
201 rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/*
202 install conf/*.users conf/*.conf conf/*.html $RPM_BUILD_ROOT%{_sysconfdir}
204 install clients/upsclient.o common/parseconf.o $RPM_BUILD_ROOT%{_libdir}
205 install clients/upsclient.h include/parseconf.h $RPM_BUILD_ROOT%{_includedir}/nut
207 %{?with_hidups:install drivers/hidups $RPM_BUILD_ROOT/lib/nut}
209 cat > $RPM_BUILD_ROOT/sbin/poweroff-ups << EOF
211 /etc/rc.d/init.d/ups powerdown
215 rm -rf $RPM_BUILD_ROOT
218 if [ -n "`/usr/bin/getgid ups`" ]; then
219 if [ "`/usr/bin/getgid ups`" != 76 ]; then
220 if [ "`/usr/bin/getgid ups`" = 121 ]; then
221 /usr/sbin/groupmod -g 76 ups
222 chgrp ups %{_sysconfdir}/{upsd.conf,ups.conf,upsd.users}
223 /usr/sbin/usermod -g 76 ups
225 echo "Error: group ups doesn't have gid=76. Correct this before installing %{name}." 1>&2
230 /usr/sbin/groupadd -g 76 ups
232 if [ -n "`/bin/id -u ups 2>/dev/null`" ]; then
233 if [ "`/bin/id -u ups`" != 70 ]; then
234 echo "Error: user ups doesn't have uid=70. Correct this before installing %{name}." 1>&2
238 echo "Adding user ups UID=70."
239 /usr/sbin/useradd -u 70 -d /usr/share/empty -s /bin/false \
240 -c "UPS Manager User" -g ups ups 1>&2
245 /sbin/chkconfig --add ups
246 if [ -f /var/lock/subsys/ups ]; then
247 /etc/rc.d/init.d/ups restart >&2
249 echo "Run \"/etc/rc.d/init.d/ups start\" to start NUT ups daemon."
253 /sbin/chkconfig --add upsmon
254 if [ -f /var/lock/subsys/upsmon ]; then
255 /etc/rc.d/init.d/upsmon restart >&2
257 echo "Run \"/etc/rc.d/init.d/upsmon start\" to start NUT upsmon daemon."
261 if [ "$1" = "0" ]; then
262 if [ -f /var/lock/subsys/ups ]; then
263 /etc/rc.d/init.d/ups stop >&2
265 /sbin/chkconfig --del ups
269 if [ "$1" = "0" ]; then
270 if [ -f /var/lock/subsys/upsmon ]; then
271 /etc/rc.d/init.d/upsmon stop >&2
273 /sbin/chkconfig --del upsmon
277 if [ "$1" = "0" ]; then
283 %defattr(644,root,root,755)
284 %attr(755,root,root) %{_bindir}/upscmd
285 %attr(755,root,root) %{_bindir}/upslog
286 %attr(755,root,root) %{_bindir}/upsrw
287 %attr(755,root,root) %{_sbindir}/upsd
288 %attr(755,root,root) /sbin/poweroff-ups
289 %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/ups
290 %attr(754,root,root) /etc/rc.d/init.d/ups
291 %attr(640,root,ups) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/upsd.conf
292 %attr(640,root,ups) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/ups.conf
293 %attr(640,root,ups) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/upsd.users
294 %{_mandir}/man5/ups.conf.5*
295 %{_mandir}/man5/upsd.conf.5*
296 %{_mandir}/man5/upsd.users.5*
297 %{_mandir}/man8/[!u]*.8*
298 %{_mandir}/man8/upscmd.8*
299 %{_mandir}/man8/upsd.8*
300 %{_mandir}/man8/upsdrvctl.8*
301 %{_mandir}/man8/upslog.8*
302 %{_mandir}/man8/upsrw.8*
303 %dir %attr(770,root,ups) /var/lib/ups
305 %attr(755,root,root) /lib/nut/*
309 %defattr(644,root,root,755)
310 %doc NEWS README CHANGES CREDITS docs
314 %defattr(644,root,root,755)
315 %attr(755,root,root) %{_bindir}/upsc
316 %attr(755,root,root) %{_sbindir}/upsmon
317 %attr(755,root,root) %{_sbindir}/upssched
318 %attr(755,root,root) %{_sbindir}/upssched-cmd
319 %attr(754,root,root) /etc/rc.d/init.d/upsmon
320 %attr(600,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/upsmon.conf
321 %attr(600,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/upssched.conf
322 %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/upsmon
323 %{_mandir}/man5/upsmon.conf.5*
324 %{_mandir}/man5/upssched.conf.5*
325 %{_mandir}/man8/upsc.8*
326 %{_mandir}/man8/upsmon.8*
327 %{_mandir}/man8/upssched.8*
330 %defattr(644,root,root,755)
331 %attr(755,root,root) /home/services/httpd/cgi-bin/*.cgi
332 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/hosts.conf
333 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/upsset.conf
334 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/*.html
335 %{_mandir}/man5/hosts.conf.5*
336 %{_mandir}/man5/upsset.conf.5*
337 %{_mandir}/man5/upsstats.html.5*
338 %{_mandir}/man8/upsimage.cgi.8*
339 %{_mandir}/man8/upsset.cgi.8*
340 %{_mandir}/man8/upsstats.cgi.8*
343 %defattr(644,root,root,755)
344 %{_libdir}/upsclient.o
345 %{_libdir}/parseconf.o