3 %bcond_with hidups # experimental hidups driver
4 %bcond_with new_everups_driver # support for Ever UPS models (broken)
6 Summary: Network UPS Tools
7 Summary(pl): Sieciowe narzêdzie do UPS-ów
12 Group: Applications/System
13 Source0: http://eu1.networkupstools.org/source/2.0/%{name}-%{version}.tar.gz
14 # Source0-md5: 84649ad95809737b5ffc19efdd9e9952
16 Source2: %{name}.sysconfig
17 Source3: %{name}-upsmon.init
18 Source4: http://www.nixz.net/nut/everups.c
19 # NoSource4-md5: 526bd50f3f5cedf6d60b99998f866b0d
20 Patch0: %{name}-client.patch
21 Patch1: %{name}-datadir.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
29 Requires(pre): /bin/id
30 Requires(pre): /usr/bin/getgid
31 Requires(pre): /usr/sbin/useradd
32 Requires(pre): /usr/sbin/groupadd
33 Requires(post,preun): /sbin/chkconfig
34 Requires(postun): /usr/sbin/groupdel
35 Requires(postun): /usr/sbin/userdel
36 Requires: %{name}-common = %{version}-%{release}
37 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38 Obsoletes: smartupstools
40 %define _sysconfdir /etc/ups
43 These programs are part of a developing project to monitor the
44 assortment of UPSes that are found out there in the field. Many models
45 have serial serial ports of some kind that allow some form of state
46 checking. This capability has been harnessed where possible to allow
47 for safe shutdowns, live status tracking on web pages, and more.
49 This nut ships with modified everups.c - support for Ever UPS models
50 (by Mikolaj Tutak <mtutak@eranet.pl>)
53 Te programy s± czê¶ci± projektu do monitorowania wielu UPS-ów w jakim¶
54 otoczeniu. Wiele modeli ma porty szeregowe i pozwala na jak±¶ formê
55 sprawdzania stanu. Ta funkcjonalno¶æ pozwala na bezpieczne
56 zatrzymywanie systemów, sprawdzanie stanu zasilania przez WWW i inne.
58 Ta wersja posiada zmieniony sterownik everups.c - obs³uguje zasilacze
59 firmy Ever UPS models (autorstwa Miko³aja Tutaka <mtutak@eranet.pl>)
62 üÔÉ ÐÒÏÇÒÁÍÍÙ - ÞÁÓÔØ ÐÒÏÅËÔÁ ÐÏ ÍÏÎÉÔÏÒÉÎÇÕ ÒÁÚÌÉÞÎÙÈ UPS. õ ÍÎÏÇÉÈ
63 ÍÏÄÅÌÅÊ ÅÓÔØ ÓÅÒÉÁÌØÎÙÅ ÐÏÒÔÙ, ÐÏÚ×ÏÌÑÀÝÉÅ ÐÒÏ×ÅÒÑÔØ ÓÏÓÔÏÑÎÉÅ ÜÔÉÈ
64 UPS. üÔÁ ×ÏÚÍÏÖÎÏÓÔØ ÂÙÌÁ ÉÓÐÏÌØÚÏ×ÁÎÁ, ÇÄÅ ÜÔÏ ×ÏÚÍÏÖÎÏ, ÄÌÑ
65 ×ÙÐÏÌÎÅÎÉÑ ÂÅÚÏÐÁÓÎÙÈ ÏÓÔÁÎÏ×Ï× ËÏÍÐØÀÔÅÒÏ×, ÏÔÓÌÅÖÉ×ÁÎÉÑ ÓÔÁÔÕÓÁ
69 㦠ÐÒÏÇÒÁÍÉ ¤ ÞÁÓÔÉÎÏÀ ÐÒÏÅËÔÕ ÐÏ ÍÏΦÔÏÒÉÎÇÕ Ò¦ÚÎÏÍÁΦÔÎÉÈ UPS.
70 âÁÇÁÔÏ ÍÏÄÅÌÅÊ ÍÁÀÔØ ÓÅÒ¦ÁÌØΦ ÐÏÒÔÉ, ÝÏ ÄÏÚ×ÏÌÑÔØ ÐÅÒÅצÒÑÔÉ ÓÔÁÎ ÃÉÈ
71 UPS. ãÑ ÍÏÖÌÉצÓÔØ ÂÕÌÁ ×ÉËÏÒÉÓÔÁÎÁ, ÄÅ ÃÅ ÍÏÖÌÉ×Ï, ÄÌÑ ×ÉËÏÎÁÎÎÑ
72 ÂÅÚÐÅÞÎÉÈ ÚÕÐÉÎÏË ËÏÍÐ'ÀÔÅÒ¦×, צÄÓ̦ÄËÏ×Õ×ÁÎÎÑ ÓÔÁÔÕÓÕ ÞÅÒÅÚ ×ÅÂ,
76 Summary: Package with common files for nut daemon and its clients
77 Summary(pl): Pakiet z plikami wspólnymi dla demona nut i jego klientów
78 Group: Applications/System
81 Package with common files for nut daemon and its clients.
83 %description common -l pl
84 Pakiet z plikami wspólnymi dla demona nut i jego klientów.
87 Summary: Multi-vendor UPS Monitoring Project Client Utilities
88 Summary(pl): Narzêdzia klienckie do monitorowania UPS-ów
89 Summary(uk): Network UPS Tools - Ë̦¤ÎÔÓØ˦ ÕÔÉ̦ÔÉ ÍÏΦÔÏÒÉÎÇÕ
90 Summary(ru): Network UPS Tools - ËÌÉÅÎÔÓËÉÅ ÕÔÉÌÉÔÙ ÍÏÎÉÔÏÒÉÎÇÁ
91 Group: Applications/System
93 Requires(post,preun): /sbin/chkconfig
94 Requires: %{name}-common = %{version}-%{release}
97 This package includes the client utilities that are required to
98 monitor a UPS that the client host is plugged into but monitored via
99 serial cable by another host on the network....
101 %description client -l pl
102 Ten pakiet zawiera narzêdzia kliencie potrzebne do monitorowania UPS-a
103 do którego pod³±czony jest komputer kliencki, kiedy kabel szeregowy
104 UPS-a jest pod³±czony do innego komputera w sieci.
106 %description client -l ru
107 üÔÏÔ ÐÁËÅÔ ×ËÌÀÞÁÅÔ ËÌÉÅÎÔÓËÉÅ ÕÔÉÌÉÔÙ, ÎÅÏÂÈÏÄÉÍÙÅ ÄÌÑ ÍÏÎÉÔÏÒÉÎÇÁ
108 UPS, Ë ËÏÔÏÒÏÍÕ ËÌÉÅÎÔÓËÉÊ ÈÏÓÔ ÉÍÅÅÔ ÄÏÓÔÕÐ, ÎÏ UPS ÆÉÚÉÞÅÓËÉ
109 ÐÏÄËÌÀÞÅÎ Ë ÄÒÕÇÏÍÕ ËÏÍÐØÀÔÅÒÕ × ÓÅÔÉ.
111 %description client -l uk
112 ãÅÊ ÐÁËÅÔ ×ËÌÀÞÁ¤ Ë̦¤ÎÔÓØ˦ ÕÔÉ̦ÔÉ, ÐÏÔÒ¦ÂΦ ÄÌÑ ÍÏΦÔÏÒÉÎÇÕ UPS, ÄÏ
113 ÑËÏÇÏ Ë̦¤ÎÔÓØËÉÊ ÈÏÓÔ ÍÁ¤ ÄÏÓÔÕÐ, ÁÌÅ UPS ƦÚÉÞÎÏ Ð¦ÄËÌÀÞÅÎÉÊ ÄÏ
114 ¦ÎÛÏÇÏ ËÏÍÐ'ÀÔÅÒÕ × ÍÅÒÅÖ¦.
117 Summary: Multi-vendor UPS Monitoring Project Server - CGI utils
118 Summary(pl): Narzêdzia CGI do monitorowania UPS-ów
119 Summary(ru): Network UPS Tools - CGI ÕÔÉÌÉÔÙ
120 Summary(uk): Network UPS Tools - CGI ÕÔÉ̦ÔÉ
121 Group: Applications/System
122 Requires: %{name}-common = %{version}-%{release}
125 These programs are part of a developing project to monitor the
126 assortment of UPSes that are found out there in the field. Many models
127 have serial serial ports of some kind that allow some form of state
128 checking. This capability has been harnessed where possible to allow
129 for safe shutdowns, live status tracking on web pages, and more. This
130 package contains CGI utils.
132 %description cgi -l pl
133 Te programy s± czê¶ci± projektu do monitorowania wielu UPS-ów w jakim¶
134 otoczeniu. Wiele modeli ma porty szeregowe i pozwala na jak±¶ formê
135 sprawdzania stanu. Ta funkcjonalno¶æ pozwala na bezpieczne
136 zatrzymywanie systemów, sprawdzanie stanu zasilania przez WWW i inne.
137 Ten pakiet zawiera narzêdzia CGI.
139 %description cgi -l ru
140 üÔÏÔ ÐÁËÅÔ ×ËÌÀÞÁÅÔ CGI ÐÒÏÇÒÁÍÍÙ ÄÌÑ ÄÏÓÔÕÐÁ Ë ÉÎÆÏÒÍÁÃÉÉ Ï ÓÔÁÔÕÓÅ
141 UPS ÞÅÒÅÚ ×ÅÂ-ÉÎÔÅÒÆÅÊÓ.
143 %description cgi -l uk
144 ãÅÊ ÐÁËÅÔ ×ËÌÀÞÁ¤ CGI ÐÒÏÇÒÁÍÉ ÄÌÑ ÄÏÓÔÕÐÕ ÄÏ ¦ÎÆÏÒÍÁæ§ ÐÒÏ ÓÔÁÔÕÓ
145 UPS ÞÅÒÅÚ ×ÅÂ-¦ÎÔÅÒÆÅÊÓ.
148 Summary: Files for NUT clients development
149 Summary(pl): Pliki do tworzenia klientów NUT-a
150 Group: Development/Libraries
151 Requires: openssl-devel >= 0.9.7c
152 # it does NOT require nut
155 Object file and header for developing NUT clients.
157 %description devel -l pl
158 Plik wynikowy oraz nag³ówek s³u¿±ce do tworzenia klientów NUT-a.
164 %{?with_new_everups_driver:install %{SOURCE4} drivers/everups.c }
167 cp -f /usr/share/automake/config.sub .
170 LDFLAGS="-L%{_prefix}/X11R6/%{_lib}"; export LDFLAGS
172 %{?with_hidups:--with-linux-hiddev} \
175 --with-linux-hiddev=%{_includedir}/linux/hiddev.h \
176 --with-statepath=%{_var}/lib/ups \
177 --with-drvpath=/lib/nut \
178 --with-cgipath=/home/services/httpd/cgi-bin \
182 %{?with_hidups:%{__make} hidups}
185 rm -rf $RPM_BUILD_ROOT
186 install -d $RPM_BUILD_ROOT{/sbin,/etc/{sysconfig,rc.d/init.d},/var/lib/ups} \
187 $RPM_BUILD_ROOT{/lib/nut,%{_libdir},%{_includedir}/nut}
189 %{__make} install DESTDIR=$RPM_BUILD_ROOT
191 %{__make} install install-cgi \
192 DESTDIR=$RPM_BUILD_ROOT
194 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ups
195 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ups
196 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/upsmon
198 rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/*
199 install conf/*.users conf/*.conf conf/*.html $RPM_BUILD_ROOT%{_sysconfdir}
201 install clients/upsclient.o common/parseconf.o $RPM_BUILD_ROOT%{_libdir}
202 install clients/upsclient.h include/parseconf.h $RPM_BUILD_ROOT%{_includedir}/nut
204 %{?with_hidups:install drivers/hidups $RPM_BUILD_ROOT/lib/nut}
206 cat > $RPM_BUILD_ROOT/sbin/poweroff-ups << EOF
208 /etc/rc.d/init.d/ups powerdown
212 rm -rf $RPM_BUILD_ROOT
215 if [ -n "`/usr/bin/getgid ups`" ]; then
216 if [ "`getgid ups`" != "121" ]; then
217 echo "Error: group ups doesn't have gid=121. Correct this before installing %{name}." 1>&2
221 /usr/sbin/groupadd -g 121 -r -f ups
223 if [ -n "`id -u ups 2>/dev/null`" ]; then
224 if [ "`id -u ups`" != "70" ]; then
225 echo "Error: user ups doesn't have uid=70. Correct this before installing %{name}." 1>&2
229 echo "Adding user ups UID=70."
230 /usr/sbin/useradd -u 70 -r -d /no/home -s /bin/false -c "UPS Manager User" -g ups ups 1>&2
235 /sbin/chkconfig --add ups
236 if [ -f /var/lock/subsys/ups ]; then
237 /etc/rc.d/init.d/ups restart >&2
239 echo "Run \"/etc/rc.d/init.d/ups start\" to start NUT ups daemon."
243 /sbin/chkconfig --add upsmon
244 if [ -f /var/lock/subsys/upsmon ]; then
245 /etc/rc.d/init.d/upsmon restart >&2
247 echo "Run \"/etc/rc.d/init.d/upsmon start\" to start NUT upsmon daemon."
251 if [ "$1" = "0" ]; then
252 if [ -f /var/lock/subsys/ups ]; then
253 /etc/rc.d/init.d/ups stop >&2
255 /sbin/chkconfig --del ups
259 if [ "$1" = "0" ]; then
260 if [ -f /var/lock/subsys/upsmon ]; then
261 /etc/rc.d/init.d/upsmon stop >&2
263 /sbin/chkconfig --del upsmon
267 if [ "$1" = "0" ]; then
268 echo "Removing user ups."
269 /usr/sbin/userdel ups
270 echo "Removing group ups."
271 /usr/sbin/groupdel ups
275 %defattr(644,root,root,755)
276 %attr(755,root,root) %{_bindir}/upscmd
277 %attr(755,root,root) %{_bindir}/upslog
278 %attr(755,root,root) %{_bindir}/upsrw
279 %attr(755,root,root) %{_sbindir}/upsd
280 %attr(755,root,root) /sbin/poweroff-ups
281 %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/ups
282 %attr(754,root,root) /etc/rc.d/init.d/ups
283 %attr(640,root,ups) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/upsd.conf
284 %attr(640,root,ups) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/ups.conf
285 %attr(640,root,ups) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/upsd.users
286 %{_mandir}/man5/ups.conf.5*
287 %{_mandir}/man5/upsd.conf.5*
288 %{_mandir}/man5/upsd.users.5*
289 %{_mandir}/man8/[!u]*.8*
290 %{_mandir}/man8/upscmd.8*
291 %{_mandir}/man8/upsd.8*
292 %{_mandir}/man8/upsdrvctl.8*
293 %{_mandir}/man8/upslog.8*
294 %{_mandir}/man8/upsrw.8*
295 %dir %attr(770,root,ups) /var/lib/ups
297 %attr(755,root,root) /lib/nut/*
301 %defattr(644,root,root,755)
302 %doc NEWS README CHANGES CREDITS docs
306 %defattr(644,root,root,755)
307 %attr(755,root,root) %{_bindir}/upsc
308 %attr(755,root,root) %{_sbindir}/upsmon
309 %attr(755,root,root) %{_sbindir}/upssched
310 %attr(755,root,root) %{_sbindir}/upssched-cmd
311 %attr(754,root,root) /etc/rc.d/init.d/upsmon
312 %attr(600,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/upsmon.conf
313 %attr(600,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/upssched.conf
314 %{_mandir}/man5/upsmon.conf.5*
315 %{_mandir}/man5/upssched.conf.5*
316 %{_mandir}/man8/upsc.8*
317 %{_mandir}/man8/upsmon.8*
318 %{_mandir}/man8/upssched.8*
321 %defattr(644,root,root,755)
322 %attr(755,root,root) /home/services/httpd/cgi-bin/*.cgi
323 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/hosts.conf
324 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/upsset.conf
325 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/*.html
326 %{_mandir}/man5/hosts.conf.5*
327 %{_mandir}/man5/upsset.conf.5*
328 %{_mandir}/man5/upsstats.html.5*
329 %{_mandir}/man8/upsimage.cgi.8*
330 %{_mandir}/man8/upsset.cgi.8*
331 %{_mandir}/man8/upsstats.cgi.8*
334 %defattr(644,root,root,755)
335 %{_libdir}/upsclient.o
336 %{_libdir}/parseconf.o