1 Summary: Network UPS Tools
2 Summary(pl): Sieciowe narzêdzie do UPS-ów
7 Group: Applications/System
8 Source0: http://penguin.harrison.k12.co.us/mirrors/nut/release/1.4/%{name}-%{version}.tar.gz
9 # Source0-md5: 1ddf547866db0f1eeb9c535ba0339906
11 Source2: %{name}.sysconfig
12 Source3: %{name}-upsmon.init
13 Source4: http://www.nixz.net/nut/everups.c
14 # NoSource4-md5: 526bd50f3f5cedf6d60b99998f866b0d
15 Patch0: %{name}-client.patch
16 Patch1: %{name}-datadir.patch
17 URL: http://www.exploits.org/nut/
18 BuildRequires: autoconf
19 BuildRequires: automake
20 BuildRequires: gd-devel >= 2.0.15
21 BuildRequires: libpng-devel
22 BuildRequires: openssl-devel >= 0.9.7c
24 Requires(pre): /bin/id
25 Requires(pre): /usr/bin/getgid
26 Requires(pre): /usr/sbin/useradd
27 Requires(pre): /usr/sbin/groupadd
28 Requires(post,preun): /sbin/chkconfig
29 Requires(postun): /usr/sbin/groupdel
30 Requires(postun): /usr/sbin/userdel
31 Requires: %{name}-common = %{version}
32 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33 Obsoletes: smartupstools
35 %define _sysconfdir /etc/ups
38 These programs are part of a developing project to monitor the
39 assortment of UPSes that are found out there in the field. Many models
40 have serial serial ports of some kind that allow some form of state
41 checking. This capability has been harnessed where possible to allow
42 for safe shutdowns, live status tracking on web pages, and more.
44 This nut ships with modified everups.c - support for Ever UPS models
45 (by Mikolaj Tutak <mtutak@eranet.pl>)
48 Te programy s± czê¶ci± projektu do monitorowania wielu UPS-ów w jakim¶
49 otoczeniu. Wiele modeli ma porty szeregowe i pozwala na jak±¶ formê
50 sprawdzania stanu. Ta funkcjonalno¶æ pozwala na bezpieczne
51 zatrzymywanie systemów, sprawdzanie stanu zasilania przez WWW i inne.
53 Ta wersja posiada zmieniony sterownik everups.c - obs³uguje zasilacze
54 firmy Ever UPS models (autorstwa Miko³aja Tutaka <mtutak@eranet.pl>)
57 üÔÉ ÐÒÏÇÒÁÍÍÙ - ÞÁÓÔØ ÐÒÏÅËÔÁ ÐÏ ÍÏÎÉÔÏÒÉÎÇÕ ÒÁÚÌÉÞÎÙÈ UPS. õ ÍÎÏÇÉÈ
58 ÍÏÄÅÌÅÊ ÅÓÔØ ÓÅÒÉÁÌØÎÙÅ ÐÏÒÔÙ, ÐÏÚ×ÏÌÑÀÝÉÅ ÐÒÏ×ÅÒÑÔØ ÓÏÓÔÏÑÎÉÅ ÜÔÉÈ
59 UPS. üÔÁ ×ÏÚÍÏÖÎÏÓÔØ ÂÙÌÁ ÉÓÐÏÌØÚÏ×ÁÎÁ, ÇÄÅ ÜÔÏ ×ÏÚÍÏÖÎÏ, ÄÌÑ
60 ×ÙÐÏÌÎÅÎÉÑ ÂÅÚÏÐÁÓÎÙÈ ÏÓÔÁÎÏ×Ï× ËÏÍÐØÀÔÅÒÏ×, ÏÔÓÌÅÖÉ×ÁÎÉÑ ÓÔÁÔÕÓÁ
64 㦠ÐÒÏÇÒÁÍÉ ¤ ÞÁÓÔÉÎÏÀ ÐÒÏÅËÔÕ ÐÏ ÍÏΦÔÏÒÉÎÇÕ Ò¦ÚÎÏÍÁΦÔÎÉÈ UPS.
65 âÁÇÁÔÏ ÍÏÄÅÌÅÊ ÍÁÀÔØ ÓÅÒ¦ÁÌØΦ ÐÏÒÔÉ, ÝÏ ÄÏÚ×ÏÌÑÔØ ÐÅÒÅצÒÑÔÉ ÓÔÁÎ ÃÉÈ
66 UPS. ãÑ ÍÏÖÌÉצÓÔØ ÂÕÌÁ ×ÉËÏÒÉÓÔÁÎÁ, ÄÅ ÃÅ ÍÏÖÌÉ×Ï, ÄÌÑ ×ÉËÏÎÁÎÎÑ
67 ÂÅÚÐÅÞÎÉÈ ÚÕÐÉÎÏË ËÏÍÐ'ÀÔÅÒ¦×, צÄÓ̦ÄËÏ×Õ×ÁÎÎÑ ÓÔÁÔÕÓÕ ÞÅÒÅÚ ×ÅÂ,
71 Summary: Package with common files for nut daemon and its clients
72 Summary(pl): Pakiet z plikami wspólnymi dla demona nut i jego klientów
73 Group: Applications/System
76 Package with common files for nut daemon and its clients.
78 %description common -l pl
79 Pakiet z plikami wspólnymi dla demona nut i jego klientów.
82 Summary: Multi-vendor UPS Monitoring Project Client Utilities
83 Summary(pl): Narzêdzia klienckie do monitorowania UPS-ów
84 Summary(uk): Network UPS Tools - Ë̦¤ÎÔÓØ˦ ÕÔÉ̦ÔÉ ÍÏΦÔÏÒÉÎÇÕ
85 Summary(ru): Network UPS Tools - ËÌÉÅÎÔÓËÉÅ ÕÔÉÌÉÔÙ ÍÏÎÉÔÏÒÉÎÇÁ
86 Group: Applications/System
88 Requires(post,preun): /sbin/chkconfig
89 Requires: %{name}-common = %{version}
92 This package includes the client utilities that are required to
93 monitor a UPS that the client host is plugged into but monitored via
94 serial cable by another host on the network....
96 %description client -l pl
97 Ten pakiet zawiera narzêdzia kliencie potrzebne do monitorowania UPS-a
98 do którego pod³±czony jest komputer kliencki, kiedy kabel szeregowy
99 UPS-a jest pod³±czony do innego komputera w sieci.
101 %description client -l ru
102 üÔÏÔ ÐÁËÅÔ ×ËÌÀÞÁÅÔ ËÌÉÅÎÔÓËÉÅ ÕÔÉÌÉÔÙ, ÎÅÏÂÈÏÄÉÍÙÅ ÄÌÑ ÍÏÎÉÔÏÒÉÎÇÁ
103 UPS, Ë ËÏÔÏÒÏÍÕ ËÌÉÅÎÔÓËÉÊ ÈÏÓÔ ÉÍÅÅÔ ÄÏÓÔÕÐ, ÎÏ UPS ÆÉÚÉÞÅÓËÉ
104 ÐÏÄËÌÀÞÅÎ Ë ÄÒÕÇÏÍÕ ËÏÍÐØÀÔÅÒÕ × ÓÅÔÉ.
106 %description client -l uk
107 ãÅÊ ÐÁËÅÔ ×ËÌÀÞÁ¤ Ë̦¤ÎÔÓØ˦ ÕÔÉ̦ÔÉ, ÐÏÔÒ¦ÂΦ ÄÌÑ ÍÏΦÔÏÒÉÎÇÕ UPS, ÄÏ
108 ÑËÏÇÏ Ë̦¤ÎÔÓØËÉÊ ÈÏÓÔ ÍÁ¤ ÄÏÓÔÕÐ, ÁÌÅ UPS ƦÚÉÞÎÏ Ð¦ÄËÌÀÞÅÎÉÊ ÄÏ
109 ¦ÎÛÏÇÏ ËÏÍÐ'ÀÔÅÒÕ × ÍÅÒÅÖ¦.
112 Summary: Multi-vendor UPS Monitoring Project Server - CGI utils
113 Summary(pl): Narzêdzia CGI do monitorowania UPS-ów
114 Summary(ru): Network UPS Tools - CGI ÕÔÉÌÉÔÙ
115 Summary(uk): Network UPS Tools - CGI ÕÔÉ̦ÔÉ
116 Group: Applications/System
117 Requires: %{name}-common = %{version}
120 These programs are part of a developing project to monitor the
121 assortment of UPSes that are found out there in the field. Many models
122 have serial serial ports of some kind that allow some form of state
123 checking. This capability has been harnessed where possible to allow
124 for safe shutdowns, live status tracking on web pages, and more. This
125 package contains CGI utils.
127 %description cgi -l pl
128 Te programy s± czê¶ci± projektu do monitorowania wielu UPS-ów w jakim¶
129 otoczeniu. Wiele modeli ma porty szeregowe i pozwala na jak±¶ formê
130 sprawdzania stanu. Ta funkcjonalno¶æ pozwala na bezpieczne
131 zatrzymywanie systemów, sprawdzanie stanu zasilania przez WWW i inne.
132 Ten pakiet zawiera narzêdzia CGI.
134 %description cgi -l ru
135 üÔÏÔ ÐÁËÅÔ ×ËÌÀÞÁÅÔ CGI ÐÒÏÇÒÁÍÍÙ ÄÌÑ ÄÏÓÔÕÐÁ Ë ÉÎÆÏÒÍÁÃÉÉ Ï ÓÔÁÔÕÓÅ
136 UPS ÞÅÒÅÚ ×ÅÂ-ÉÎÔÅÒÆÅÊÓ.
138 %description cgi -l uk
139 ãÅÊ ÐÁËÅÔ ×ËÌÀÞÁ¤ CGI ÐÒÏÇÒÁÍÉ ÄÌÑ ÄÏÓÔÕÐÕ ÄÏ ¦ÎÆÏÒÍÁæ§ ÐÒÏ ÓÔÁÔÕÓ
140 UPS ÞÅÒÅÚ ×ÅÂ-¦ÎÔÅÒÆÅÊÓ.
143 Summary: Files for NUT clients development
144 Summary(pl): Pliki do tworzenia klientów NUT-a
145 Group: Development/Libraries
146 Requires: openssl-devel >= 0.9.7c
147 # it does NOT require nut
150 Object file and header for developing NUT clients.
152 %description devel -l pl
153 Plik wynikowy oraz nag³ówek s³u¿±ce do tworzenia klientów NUT-a.
159 %{?_with_new_everups_driver:install %{SOURCE4} drivers/everups.c }
164 LDFLAGS="-L%{_prefix}/X11R6/lib"; export LDFLAGS
168 --with-linux-hiddev=%{_includedir}/linux/hiddev.h \
169 --with-statepath=%{_var}/lib/ups \
170 --with-drvpath=/lib/nut \
171 --with-cgipath=/home/services/httpd/cgi-bin \
177 rm -rf $RPM_BUILD_ROOT
178 install -d $RPM_BUILD_ROOT{/sbin,/etc/{sysconfig,rc.d/init.d},/var/lib/ups} \
179 $RPM_BUILD_ROOT{/lib/nut,%{_libdir},%{_includedir}/nut}
181 %{__make} install DESTDIR=$RPM_BUILD_ROOT
183 %{__make} install install-cgi \
184 DESTDIR=$RPM_BUILD_ROOT
186 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ups
187 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ups
188 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/upsmon
190 rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/*
191 install conf/*.users conf/*.conf conf/*.html $RPM_BUILD_ROOT%{_sysconfdir}
193 install clients/upsclient.o common/parseconf.o $RPM_BUILD_ROOT%{_libdir}
194 install clients/upsclient.h include/parseconf.h $RPM_BUILD_ROOT%{_includedir}/nut
196 cat > $RPM_BUILD_ROOT/sbin/poweroff-ups << EOF
198 /etc/rc.d/init.d/ups powerdown
202 rm -rf $RPM_BUILD_ROOT
205 if [ -n "`/usr/bin/getgid ups`" ]; then
206 if [ "`getgid ups`" != "121" ]; then
207 echo "Error: group ups doesn't have gid=121. Correct this before installing %{name}." 1>&2
211 /usr/sbin/groupadd -g 121 -r -f ups
213 if [ -n "`id -u ups 2>/dev/null`" ]; then
214 if [ "`id -u ups`" != "70" ]; then
215 echo "Error: user ups doesn't have uid=70. Correct this before installing %{name}." 1>&2
219 echo "Adding user ups UID=70."
220 /usr/sbin/useradd -u 70 -r -d /no/home -s /bin/false -c "UPS Manager User" -g ups ups 1>&2
225 /sbin/chkconfig --add ups
226 if [ -f /var/lock/subsys/ups ]; then
227 /etc/rc.d/init.d/ups restart >&2
229 echo "Run \"/etc/rc.d/init.d/ups start\" to start NUT ups daemon."
233 /sbin/chkconfig --add upsmon
234 if [ -f /var/lock/subsys/upsmon ]; then
235 /etc/rc.d/init.d/upsmon restart >&2
237 echo "Run \"/etc/rc.d/init.d/upsmon start\" to start NUT upsmon daemon."
241 if [ "$1" = "0" ]; then
242 if [ -f /var/lock/subsys/ups ]; then
243 /etc/rc.d/init.d/ups stop >&2
245 /sbin/chkconfig --del ups
249 if [ "$1" = "0" ]; then
250 if [ -f /var/lock/subsys/upsmon ]; then
251 /etc/rc.d/init.d/upsmon stop >&2
253 /sbin/chkconfig --del upsmon
257 if [ "$1" = "0" ]; then
258 echo "Removing user ups."
259 /usr/sbin/userdel ups
260 echo "Removing group ups."
261 /usr/sbin/groupdel ups
265 %defattr(644,root,root,755)
266 %attr(755,root,root) %{_bindir}/upscmd
267 %attr(755,root,root) %{_bindir}/upslog
268 %attr(755,root,root) %{_bindir}/upsrw
269 %attr(755,root,root) %{_sbindir}/upsd
270 %attr(755,root,root) /sbin/poweroff-ups
271 %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/ups
272 %attr(754,root,root) /etc/rc.d/init.d/ups
273 %attr(640,root,ups) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/upsd.conf
274 %attr(640,root,ups) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/ups.conf
275 %attr(640,root,ups) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/upsd.users
276 %{_mandir}/man5/ups.conf.5*
277 %{_mandir}/man5/upsd.conf.5*
278 %{_mandir}/man5/upsd.users.5*
279 %{_mandir}/man8/[!u]*.8*
280 %{_mandir}/man8/upscmd.8*
281 %{_mandir}/man8/upsd.8*
282 %{_mandir}/man8/upsdrvctl.8*
283 %{_mandir}/man8/upslog.8*
284 %{_mandir}/man8/upsrw.8*
285 %dir %attr(770,root,ups) /var/lib/ups
287 %attr(755,root,root) /lib/nut/*
291 %defattr(644,root,root,755)
292 %doc NEWS README CHANGES CREDITS docs
296 %defattr(644,root,root,755)
297 %attr(755,root,root) %{_bindir}/upsc
298 %attr(755,root,root) %{_sbindir}/upsmon
299 %attr(755,root,root) %{_sbindir}/upssched
300 %attr(755,root,root) %{_sbindir}/upssched-cmd
301 %attr(754,root,root) /etc/rc.d/init.d/upsmon
302 %attr(600,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/upsmon.conf
303 %attr(600,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/upssched.conf
304 %{_mandir}/man5/upsmon.conf.5*
305 %{_mandir}/man5/upssched.conf.5*
306 %{_mandir}/man8/upsc.8*
307 %{_mandir}/man8/upsmon.8*
308 %{_mandir}/man8/upssched.8*
311 %defattr(644,root,root,755)
312 %attr(755,root,root) /home/services/httpd/cgi-bin/*.cgi
313 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/hosts.conf
314 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/upsset.conf
315 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/*.html
316 %{_mandir}/man5/hosts.conf.5*
317 %{_mandir}/man5/upsset.conf.5*
318 %{_mandir}/man5/upsstats.html.5*
319 %{_mandir}/man8/upsimage.cgi.8*
320 %{_mandir}/man8/upsset.cgi.8*
321 %{_mandir}/man8/upsstats.cgi.8*
324 %defattr(644,root,root,755)
325 %{_libdir}/upsclient.o
326 %{_libdir}/parseconf.o