2 # - upsdrvctl (used by ups.init) doesn't recognize status and reload commands
5 %bcond_without usb # build without usb drivers
6 %bcond_without snmp # build without snmp driver
7 %bcond_without cgi # build without cgi support
8 %bcond_without neon # build with neon based XML/HTTP driver
10 Summary: Network UPS Tools
11 Summary(pl.UTF-8): Sieciowe narzędzie do UPS-ów
16 Group: Applications/System
17 Source0: http://www.networkupstools.org/source/2.7/%{name}-%{version}.tar.gz
18 # Source0-md5: c3568b42e058cfc385b46d25140dced4
20 Source2: %{name}.sysconfig
21 Source3: %{name}-upsmon.init
22 Source4: %{name}.sysconfig.upsmon
23 Patch0: %{name}-client.patch
24 Patch1: %{name}-config.patch
25 Patch2: %{name}-smartdp-load.patch
26 Patch3: %{name}-upssched-cmd-sysconf.patch
27 Patch4: %{name}-matrix.patch
28 Patch5: systemd-sysconfig.patch
29 Patch6: bcmxcp-off-by-one.patch
30 URL: http://www.networkupstools.org/
31 BuildRequires: autoconf
32 BuildRequires: automake
33 BuildRequires: avahi-devel
34 BuildRequires: freeipmi-devel
35 %{?with_cgi:BuildRequires: gd-devel >= 2.0.15}
36 BuildRequires: libltdl-devel
37 BuildRequires: libtool
38 %{?with_usb:BuildRequires: libusb-compat-devel}
39 BuildRequires: libwrap-devel
40 %{?with_neon:BuildRequires: neon-devel}
41 %{?with_snmp:BuildRequires: net-snmp-devel}
42 BuildRequires: openssl-devel >= 0.9.7d
43 BuildRequires: pkgconfig
44 BuildRequires: rpmbuild(macros) >= 1.647
45 Requires: systemd-units >= 38
46 Requires(post,preun): /sbin/chkconfig
47 Requires: %{name}-common = %{version}-%{release}
50 Obsoletes: smartupstools
51 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
53 %define _sysconfdir /etc/ups
54 %define _udevrulesdir /etc/udev/rules.d
57 These programs are part of a developing project to monitor the
58 assortment of UPSes that are found out there in the field. Many models
59 have serial serial ports of some kind that allow some form of state
60 checking. This capability has been harnessed where possible to allow
61 for safe shutdowns, live status tracking on web pages, and more.
63 %description -l pl.UTF-8
64 Te programy są częścią projektu do monitorowania wielu UPS-ów w jakimś
65 otoczeniu. Wiele modeli ma porty szeregowe i pozwala na jakąś formę
66 sprawdzania stanu. Ta funkcjonalność pozwala na bezpieczne
67 zatrzymywanie systemów, sprawdzanie stanu zasilania przez WWW i inne.
69 %description -l ru.UTF-8
70 Эти программы - часть проекта по мониторингу различных UPS. У многих
71 моделей есть сериальные порты, позволяющие проверять состояние этих
72 UPS. Эта возможность была использована, где это возможно, для
73 выполнения безопасных остановов компьютеров, отслеживания статуса
76 %description -l uk.UTF-8
77 Ці програми є частиною проекту по моніторингу різноманітних UPS.
78 Багато моделей мають серіальні порти, що дозволять перевіряти стан цих
79 UPS. Ця можливість була використана, де це можливо, для виконання
80 безпечних зупинок комп'ютерів, відслідковування статусу через веб,
84 Summary: Package with common files for nut daemon and its clients
85 Summary(pl.UTF-8): Pakiet z plikami wspólnymi dla demona nut i jego klientów
86 Group: Applications/System
87 Requires(postun): /usr/sbin/groupdel
88 Requires(postun): /usr/sbin/userdel
89 Requires(pre): /bin/id
90 Requires(pre): /usr/bin/getgid
91 Requires(pre): /usr/sbin/groupadd
92 Requires(pre): /usr/sbin/groupmod
93 Requires(pre): /usr/sbin/useradd
98 Package with common files for nut daemon and its clients.
100 %description common -l pl.UTF-8
101 Pakiet z plikami wspólnymi dla demona nut i jego klientów.
104 Summary: Multi-vendor UPS Monitoring Project Client Utilities
105 Summary(pl.UTF-8): Narzędzia klienckie do monitorowania UPS-ów
106 Summary(ru.UTF-8): Network UPS Tools - клиентские утилиты мониторинга
107 Summary(uk.UTF-8): Network UPS Tools - клієнтські утиліти моніторингу
108 Group: Applications/System
109 Requires(post,preun): /sbin/chkconfig
110 Requires: %{name}-common = %{version}-%{release}
112 Requires: systemd-units >= 38
115 This package includes the client utilities that are required to
116 monitor a UPS that the client host is plugged into but monitored via
117 serial cable by another host on the network....
119 %description client -l pl.UTF-8
120 Ten pakiet zawiera narzędzia kliencie potrzebne do monitorowania UPS-a
121 do którego podłączony jest komputer kliencki, kiedy kabel szeregowy
122 UPS-a jest podłączony do innego komputera w sieci.
124 %description client -l ru.UTF-8
125 Этот пакет включает клиентские утилиты, необходимые для мониторинга
126 UPS, к которому клиентский хост имеет доступ, но UPS физически
127 подключен к другому компьютеру в сети.
129 %description client -l uk.UTF-8
130 Цей пакет включає клієнтські утиліти, потрібні для моніторингу UPS, до
131 якого клієнтський хост має доступ, але UPS фізично підключений до
132 іншого комп'ютеру в мережі.
135 Summary: Multi-vendor UPS Monitoring Project Server - CGI utils
136 Summary(pl.UTF-8): Narzędzia CGI do monitorowania UPS-ów
137 Summary(ru.UTF-8): Network UPS Tools - CGI утилиты
138 Summary(uk.UTF-8): Network UPS Tools - CGI утиліти
139 Group: Applications/System
140 Requires: %{name}-common = %{version}-%{release}
143 These programs are part of a developing project to monitor the
144 assortment of UPSes that are found out there in the field. Many models
145 have serial serial ports of some kind that allow some form of state
146 checking. This capability has been harnessed where possible to allow
147 for safe shutdowns, live status tracking on web pages, and more. This
148 package contains CGI utils.
150 %description cgi -l pl.UTF-8
151 Te programy są częścią projektu do monitorowania wielu UPS-ów w jakimś
152 otoczeniu. Wiele modeli ma porty szeregowe i pozwala na jakąś formę
153 sprawdzania stanu. Ta funkcjonalność pozwala na bezpieczne
154 zatrzymywanie systemów, sprawdzanie stanu zasilania przez WWW i inne.
155 Ten pakiet zawiera narzędzia CGI.
157 %description cgi -l ru.UTF-8
158 Этот пакет включает CGI программы для доступа к информации о статусе
159 UPS через веб-интерфейс.
161 %description cgi -l uk.UTF-8
162 Цей пакет включає CGI програми для доступу до інформації про статус
163 UPS через веб-інтерфейс.
166 Summary: Files for NUT clients development
167 Summary(pl.UTF-8): Pliki do tworzenia klientów NUT-a
168 Group: Development/Libraries
169 Requires: %{name}-common = %{version}-%{release}
170 Requires: openssl-devel >= 0.9.7c
173 Object file and header for developing NUT clients.
175 %description devel -l pl.UTF-8
176 Plik wynikowy oraz nagłówek służące do tworzenia klientów NUT-a.
189 cp -f /usr/share/automake/config.sub .
195 --datadir=%{_datadir}/%{name} \
196 --with-htmlpath=%{_datadir}/%{name}/html \
198 --with%{!?with_usb:out}-usb \
199 --with%{!?with_snmp:out}-snmp \
200 --with%{!?with_cgi:out}-cgi \
204 --with%{!?with_neon:out}-neon \
207 %{?with_usb:--with-udev-dir=/etc/udev} \
208 --with-statepath=%{_var}/lib/ups \
209 --with-drvpath=/lib/nut \
210 --with-cgipath=/home/services/httpd/cgi-bin \
211 --with-systemdsystemunitdir=%{systemdunitdir} \
218 rm -rf $RPM_BUILD_ROOT
219 install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},/var/lib/ups,/lib/nut,/sbin}
222 DESTDIR=$RPM_BUILD_ROOT
224 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ups
225 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ups
226 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/upsmon
227 install %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/upsmon
229 ln -s /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/ups.service
230 ln -s /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/upsmon.service
232 for i in $RPM_BUILD_ROOT%{_sysconfdir}/*.sample; do
233 mv -f $i ${i%.sample}
236 %{!?with_usb:rm -f $RPM_BUILD_ROOT%{_udevrulesdir}/52-nut-usbups.rules}
238 cat > $RPM_BUILD_ROOT/sbin/poweroff-ups << EOF
240 echo "Switching the power off"
241 /lib/nut/upsdrvctl shutdown
245 %{__rm} $RPM_BUILD_ROOT%{_libdir}/*.la
248 rm -rf $RPM_BUILD_ROOT
252 /sbin/chkconfig --add ups
253 %service ups restart "NUT ups daemon"
254 %systemd_post nut-driver.service nut-server.service
257 if [ "$1" = "0" ]; then
259 /sbin/chkconfig --del ups
261 %systemd_preun nut-driver.service nut-server.service
267 %triggerpostun -- nut < 2.6.4-2
268 [ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
269 [ ${RPM_ENABLE_SYSTEMD_SERVICE:-yes} = no ] && exit 0
270 [ "$(echo /etc/rc.d/rc[0-6].d/S[0-9][0-9]ups)" != "/etc/rc.d/rc[0-6].d/S[0-9][0-9]ups" ] || exit 0
271 %systemd_service_enable nut-driver.service nut-server.service
275 if [ -n "`/usr/bin/getgid ups 2> /dev/null`" ] && [ "`/usr/bin/getgid ups 2> /dev/null`" = 121 ]; then
276 /usr/sbin/groupmod -g 76 ups
277 chgrp ups %{_sysconfdir}/{upsd.conf,ups.conf,upsd.users}
278 /usr/sbin/usermod -g 76 ups
281 %useradd -u 70 -d /usr/share/empty -s /bin/false -c "UPS Manager User" -g ups ups
283 %post common -p /sbin/ldconfig
287 if [ "$1" = "0" ]; then
293 /sbin/chkconfig --add upsmon
294 %service upsmon restart "NUT upsmon daemon"
295 %systemd_post nut-monitor.service
298 if [ "$1" = "0" ]; then
300 /sbin/chkconfig --del upsmon
302 %systemd_preun nut-monitor.service
307 %triggerpostun client -- nut-client < 2.6.4-2
308 [ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
309 [ ${RPM_ENABLE_SYSTEMD_SERVICE:-yes} = no ] && exit 0
310 /sbin/chkconfig --list upsmon 2>/dev/null | grep -qsv "[0-6]:on" && exit 0
311 [ "$(echo /etc/rc.d/rc[0-6].d/S[0-9][0-9]upsmon)" != "/etc/rc.d/rc[0-6].d/S[0-9][0-9]upsmon" ] || exit 0
312 %systemd_service_enable nut-monitor.service
315 %defattr(644,root,root,755)
316 %attr(755,root,root) %{_bindir}/nut-scanner
317 %attr(755,root,root) %{_bindir}/upscmd
318 %attr(755,root,root) %{_bindir}/upslog
319 %attr(755,root,root) %{_bindir}/upsrw
320 %attr(755,root,root) %{_sbindir}/upsd
321 %attr(755,root,root) %{_sbindir}/upsdrvctl
322 %attr(755,root,root) /sbin/poweroff-ups
323 %attr(755,root,root) %ghost %{_libdir}/libnutscan.so.1
324 %attr(755,root,root) %{_libdir}/libnutscan.so.*.*.*
325 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ups
326 %attr(754,root,root) /etc/rc.d/init.d/ups
327 %attr(640,root,ups) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nut.conf
328 %attr(640,root,ups) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/upsd.conf
329 %attr(640,root,ups) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ups.conf
330 %attr(640,root,ups) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/upsd.users
331 %{systemdunitdir}/nut-driver.service
332 %{systemdunitdir}/nut-server.service
333 %{systemdunitdir}/ups.service
334 %{_mandir}/man5/ups.conf.5*
335 %{_mandir}/man5/upsd.conf.5*
336 %{_mandir}/man5/upsd.users.5*
337 %{_mandir}/man8/nut-recorder.8*
338 %{_mandir}/man8/nut-scanner.8*
339 %{_mandir}/man8/upscmd.8*
340 %{_mandir}/man8/upscode2.8*
341 %{_mandir}/man8/upsd.8*
342 %{_mandir}/man8/upsdrvctl.8*
343 %{_mandir}/man8/upslog.8*
344 %{_mandir}/man8/upsrw.8*
345 %dir %attr(770,root,ups) /var/lib/ups
347 %attr(755,root,root) /lib/nut/al175
348 %attr(755,root,root) /lib/nut/apcsmart
349 %attr(755,root,root) /lib/nut/apcsmart-old
350 %attr(755,root,root) /lib/nut/apcupsd-ups
351 %attr(755,root,root) /lib/nut/bcmxcp
352 %{?with_usb:%attr(755,root,root) /lib/nut/bcmxcp_usb}
353 %attr(755,root,root) /lib/nut/belkin
354 %attr(755,root,root) /lib/nut/belkinunv
355 %attr(755,root,root) /lib/nut/bestfcom
356 %attr(755,root,root) /lib/nut/bestfortress
357 %attr(755,root,root) /lib/nut/bestuferrups
358 %attr(755,root,root) /lib/nut/bestups
359 %attr(755,root,root) /lib/nut/blazer_ser
360 %{?with_usb:%attr(755,root,root) /lib/nut/blazer_usb}
361 %attr(755,root,root) /lib/nut/clone
362 %attr(755,root,root) /lib/nut/clone-outlet
363 %attr(755,root,root) /lib/nut/dummy-ups
364 %attr(755,root,root) /lib/nut/etapro
365 %attr(755,root,root) /lib/nut/everups
366 %attr(755,root,root) /lib/nut/gamatronic
367 %attr(755,root,root) /lib/nut/genericups
368 %attr(755,root,root) /lib/nut/isbmex
369 %attr(755,root,root) /lib/nut/ivtscd
370 %attr(755,root,root) /lib/nut/liebert
371 %attr(755,root,root) /lib/nut/liebert-esp2
372 %attr(755,root,root) /lib/nut/masterguard
373 %attr(755,root,root) /lib/nut/metasys
374 %attr(755,root,root) /lib/nut/mge-shut
375 %attr(755,root,root) /lib/nut/mge-utalk
376 %attr(755,root,root) /lib/nut/microdowell
377 %{?with_neon:%attr(755,root,root) /lib/nut/netxml-ups}
378 %{?with_usb:%attr(755,root,root) /lib/nut/nutdrv_atcl_usb}
379 %attr(755,root,root) /lib/nut/nutdrv_qx
380 %attr(755,root,root) /lib/nut/nut-ipmipsu
381 %attr(755,root,root) /lib/nut/oldmge-shut
382 %attr(755,root,root) /lib/nut/oneac
383 %attr(755,root,root) /lib/nut/optiups
384 %attr(755,root,root) /lib/nut/powercom
385 %attr(755,root,root) /lib/nut/powerpanel
386 %attr(755,root,root) /lib/nut/rhino
387 %{?with_usb:%attr(755,root,root) /lib/nut/richcomm_usb}
388 %attr(755,root,root) /lib/nut/riello_ser
389 %{?with_usb:%attr(755,root,root) /lib/nut/riello_usb}
390 %attr(755,root,root) /lib/nut/safenet
391 %attr(755,root,root) /lib/nut/skel
392 %{?with_snmp:%attr(755,root,root) /lib/nut/snmp-ups}
393 %attr(755,root,root) /lib/nut/solis
394 %attr(755,root,root) /lib/nut/tripplite
395 %attr(755,root,root) /lib/nut/tripplitesu
396 %{?with_usb:%attr(755,root,root) /lib/nut/tripplite_usb}
397 %attr(755,root,root) /lib/nut/upscode2
398 %{?with_usb:%attr(755,root,root) /lib/nut/usbhid-ups}
399 %attr(755,root,root) /lib/nut/victronups
401 %{_datadir}/nut/cmdvartab
402 %{_datadir}/nut/driver.list
403 %{_mandir}/man5/nut.conf.5*
404 %{_mandir}/man8/al175.8*
405 %{_mandir}/man8/apcsmart.8*
406 %{_mandir}/man8/apcsmart-old.8*
407 %{_mandir}/man8/apcupsd-ups.8*
408 %{_mandir}/man8/bcmxcp.8*
409 %{?with_usb:%{_mandir}/man8/bcmxcp_usb.8*}
410 %{_mandir}/man8/belkin.8*
411 %{_mandir}/man8/belkinunv.8*
412 %{_mandir}/man8/bestfcom.8*
413 %{_mandir}/man8/bestfortress.8*
414 %{_mandir}/man8/bestuferrups.8*
415 %{_mandir}/man8/bestups.8*
416 %{_mandir}/man8/blazer_ser.8*
417 %{?with_usb:%{_mandir}/man8/blazer_usb.8*}
418 %{_mandir}/man8/clone.8*
419 %{_mandir}/man8/dummy-ups.8*
420 %{_mandir}/man8/etapro.8*
421 %{_mandir}/man8/everups.8*
422 %{_mandir}/man8/gamatronic.8*
423 %{_mandir}/man8/genericups.8*
424 %{_mandir}/man8/isbmex.8*
425 %{_mandir}/man8/ivtscd.8*
426 %{_mandir}/man8/liebert.8*
427 %{_mandir}/man8/liebert-esp2.8*
428 %{_mandir}/man8/masterguard.8*
429 %{_mandir}/man8/metasys.8*
430 %{_mandir}/man8/mge-shut.8*
431 %{_mandir}/man8/mge-utalk.8*
432 %{_mandir}/man8/microdowell.8*
433 %{?with_neon:%{_mandir}/man8/netxml-ups.8*}
434 %{?with_usb:%{_mandir}/man8/nutdrv_atcl_usb.8*}
435 %{_mandir}/man8/nutdrv_qx.8*
436 %{_mandir}/man8/nut-ipmipsu.8*
437 %{_mandir}/man8/nutupsdrv.8*
438 %{_mandir}/man8/oneac.8*
439 %{_mandir}/man8/optiups.8*
440 %{_mandir}/man8/powercom.8*
441 %{_mandir}/man8/powerpanel.8*
442 %{_mandir}/man8/rhino.8*
443 %{?with_usb:%{_mandir}/man8/richcomm_usb.8*}
444 %{_mandir}/man8/riello_ser.8*
445 %{?with_usb:%{_mandir}/man8/riello_usb.8*}
446 %{_mandir}/man8/safenet.8*
447 %{?with_snmp:%{_mandir}/man8/snmp-ups.8*}
448 %{_mandir}/man8/solis.8*
449 %{_mandir}/man8/tripplite.8*
450 %{_mandir}/man8/tripplitesu.8*
451 %{?with_usb:%{_mandir}/man8/tripplite_usb.8*}
452 %{?with_usb:%{_mandir}/man8/usbhid-ups.8*}
453 %{_mandir}/man8/victronups.8*
454 %{?with_usb:%config(noreplace) %verify(not md5 mtime size) %{_udevrulesdir}/52-nut-usbups.rules}
455 %config(noreplace) %verify(not md5 mtime size) %{_udevrulesdir}/52-nut-ipmipsu.rules
458 %defattr(644,root,root,755)
459 %doc AUTHORS MAINTAINERS NEWS README UPGRADING ChangeLog docs
461 %attr(755,root,root) %ghost %{_libdir}/libnutclient.so.0
462 %attr(755,root,root) %{_libdir}/libnutclient.so.*.*.*
463 %attr(755,root,root) %ghost %{_libdir}/libupsclient.so.4
464 %attr(755,root,root) %{_libdir}/libupsclient.so.*.*.*
467 %defattr(644,root,root,755)
468 %attr(755,root,root) %{_bindir}/upsc
469 %attr(755,root,root) %{_sbindir}/upsmon
470 %attr(755,root,root) %{_sbindir}/upssched
471 %attr(754,root,root) /etc/rc.d/init.d/upsmon
472 %attr(640,root,ups) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/upsmon.conf
473 %attr(640,root,ups) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/upssched.conf
474 %attr(750,root,ups) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/upssched-cmd
475 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/upsmon
476 /lib/systemd/system-shutdown/nutshutdown
477 %{systemdunitdir}/nut-monitor.service
478 %{systemdunitdir}/upsmon.service
479 %{_mandir}/man5/upsmon.conf.5*
480 %{_mandir}/man5/upssched.conf.5*
481 %{_mandir}/man8/upsc.8*
482 %{_mandir}/man8/upsmon.8*
483 %{_mandir}/man8/upssched.8*
487 %defattr(644,root,root,755)
488 %{_datadir}/%{name}/html
489 %attr(755,root,root) /home/services/httpd/cgi-bin/*.cgi
490 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/hosts.conf
491 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/upsset.conf
492 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.html
493 %{_mandir}/man5/hosts.conf.5*
494 %{_mandir}/man5/upsset.conf.5*
495 %{_mandir}/man5/upsstats.html.5*
496 %{_mandir}/man8/upsimage.cgi.8*
497 %{_mandir}/man8/upsset.cgi.8*
498 %{_mandir}/man8/upsstats.cgi.8*
502 %defattr(644,root,root,755)
503 %attr(755,root,root) %{_libdir}/libnutclient.so
504 %attr(755,root,root) %{_libdir}/libupsclient.so
505 %attr(755,root,root) %{_libdir}/libnutscan.so
506 %{_pkgconfigdir}/libnutclient.pc
507 %{_pkgconfigdir}/libnutscan.pc
508 %{_pkgconfigdir}/libupsclient.pc