2 # - upsdrvctl (used by ups.init) doesn't recognize status and reload commands
5 %bcond_without usb # build without usb drivers
6 %bcond_with hal # build with hal support (DEPRECATED)
7 %bcond_without snmp # build without snmp driver
8 %bcond_without cgi # build without cgi support
9 %bcond_without neon # build with neon based XML/HTTP driver
11 Summary: Network UPS Tools
12 Summary(pl.UTF-8): Sieciowe narzędzie do UPS-ów
17 Group: Applications/System
18 Source0: http://www.networkupstools.org/source/2.6/%{name}-%{version}.tar.gz
19 # Source0-md5: 78d672fbbcd90683e49c667665a95f87
21 Source2: %{name}.sysconfig
22 Source3: %{name}-upsmon.init
23 Source4: %{name}.sysconfig.upsmon
24 Patch0: %{name}-client.patch
25 Patch1: %{name}-config.patch
26 Patch2: %{name}-smartdp-load.patch
27 Patch3: %{name}-upssched-cmd-sysconf.patch
28 Patch4: %{name}-matrix.patch
29 Patch5: systemd-sysconfig.patch
30 Patch6: bcmxcp-off-by-one.patch
31 URL: http://www.networkupstools.org/
32 BuildRequires: autoconf
33 BuildRequires: automake
34 %{?with_hal:BuildRequires: dbus-glib-devel}
35 %{?with_cgi:BuildRequires: gd-devel >= 2.0.15}
36 %{?with_hal:BuildRequires: hal-devel >= 0.5.8}
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}
49 Obsoletes: smartupstools
50 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
52 %define _sysconfdir /etc/ups
53 %define _udevrulesdir /etc/udev/rules.d
56 These programs are part of a developing project to monitor the
57 assortment of UPSes that are found out there in the field. Many models
58 have serial serial ports of some kind that allow some form of state
59 checking. This capability has been harnessed where possible to allow
60 for safe shutdowns, live status tracking on web pages, and more.
62 %description -l pl.UTF-8
63 Te programy są częścią projektu do monitorowania wielu UPS-ów w jakimś
64 otoczeniu. Wiele modeli ma porty szeregowe i pozwala na jakąś formę
65 sprawdzania stanu. Ta funkcjonalność pozwala na bezpieczne
66 zatrzymywanie systemów, sprawdzanie stanu zasilania przez WWW i inne.
68 %description -l ru.UTF-8
69 Эти программы - часть проекта по мониторингу различных UPS. У многих
70 моделей есть сериальные порты, позволяющие проверять состояние этих
71 UPS. Эта возможность была использована, где это возможно, для
72 выполнения безопасных остановов компьютеров, отслеживания статуса
75 %description -l uk.UTF-8
76 Ці програми є частиною проекту по моніторингу різноманітних UPS.
77 Багато моделей мають серіальні порти, що дозволять перевіряти стан цих
78 UPS. Ця можливість була використана, де це можливо, для виконання
79 безпечних зупинок комп'ютерів, відслідковування статусу через веб,
83 Summary: Package with common files for nut daemon and its clients
84 Summary(pl.UTF-8): Pakiet z plikami wspólnymi dla demona nut i jego klientów
85 Group: Applications/System
86 Requires(postun): /usr/sbin/groupdel
87 Requires(postun): /usr/sbin/userdel
88 Requires(pre): /bin/id
89 Requires(pre): /usr/bin/getgid
90 Requires(pre): /usr/sbin/groupadd
91 Requires(pre): /usr/sbin/groupmod
92 Requires(pre): /usr/sbin/useradd
97 Package with common files for nut daemon and its clients.
99 %description common -l pl.UTF-8
100 Pakiet z plikami wspólnymi dla demona nut i jego klientów.
103 Summary: Multi-vendor UPS Monitoring Project Client Utilities
104 Summary(pl.UTF-8): Narzędzia klienckie do monitorowania UPS-ów
105 Summary(ru.UTF-8): Network UPS Tools - клиентские утилиты мониторинга
106 Summary(uk.UTF-8): Network UPS Tools - клієнтські утиліти моніторингу
107 Group: Applications/System
108 Requires(post,preun): /sbin/chkconfig
109 Requires: %{name}-common = %{version}-%{release}
111 Requires: systemd-units >= 38
114 This package includes the client utilities that are required to
115 monitor a UPS that the client host is plugged into but monitored via
116 serial cable by another host on the network....
118 %description client -l pl.UTF-8
119 Ten pakiet zawiera narzędzia kliencie potrzebne do monitorowania UPS-a
120 do którego podłączony jest komputer kliencki, kiedy kabel szeregowy
121 UPS-a jest podłączony do innego komputera w sieci.
123 %description client -l ru.UTF-8
124 Этот пакет включает клиентские утилиты, необходимые для мониторинга
125 UPS, к которому клиентский хост имеет доступ, но UPS физически
126 подключен к другому компьютеру в сети.
128 %description client -l uk.UTF-8
129 Цей пакет включає клієнтські утиліти, потрібні для моніторингу UPS, до
130 якого клієнтський хост має доступ, але UPS фізично підключений до
131 іншого комп'ютеру в мережі.
134 Summary: Multi-vendor UPS Monitoring Project Server - CGI utils
135 Summary(pl.UTF-8): Narzędzia CGI do monitorowania UPS-ów
136 Summary(ru.UTF-8): Network UPS Tools - CGI утилиты
137 Summary(uk.UTF-8): Network UPS Tools - CGI утиліти
138 Group: Applications/System
139 Requires: %{name}-common = %{version}-%{release}
142 These programs are part of a developing project to monitor the
143 assortment of UPSes that are found out there in the field. Many models
144 have serial serial ports of some kind that allow some form of state
145 checking. This capability has been harnessed where possible to allow
146 for safe shutdowns, live status tracking on web pages, and more. This
147 package contains CGI utils.
149 %description cgi -l pl.UTF-8
150 Te programy są częścią projektu do monitorowania wielu UPS-ów w jakimś
151 otoczeniu. Wiele modeli ma porty szeregowe i pozwala na jakąś formę
152 sprawdzania stanu. Ta funkcjonalność pozwala na bezpieczne
153 zatrzymywanie systemów, sprawdzanie stanu zasilania przez WWW i inne.
154 Ten pakiet zawiera narzędzia CGI.
156 %description cgi -l ru.UTF-8
157 Этот пакет включает CGI программы для доступа к информации о статусе
158 UPS через веб-интерфейс.
160 %description cgi -l uk.UTF-8
161 Цей пакет включає CGI програми для доступу до інформації про статус
162 UPS через веб-інтерфейс.
165 Summary: Files for NUT clients development
166 Summary(pl.UTF-8): Pliki do tworzenia klientów NUT-a
167 Group: Development/Libraries
168 Requires: %{name}-common = %{version}-%{release}
169 Requires: openssl-devel >= 0.9.7c
172 Object file and header for developing NUT clients.
174 %description devel -l pl.UTF-8
175 Plik wynikowy oraz nagłówek służące do tworzenia klientów NUT-a.
178 Summary: NUT integration with FreeDesktop HAL
179 Summary(pl.UTF-8): Pliki do integracji NUT-a z HAL-em
180 Group: Development/Libraries
181 Requires: %{name} = %{version}-%{release}
184 NUT integration with FreeDesktop HAL.
186 %description hal -l pl.UTF-8
187 Pliki do integracji NUT-a z HAL-em.
200 cp -f /usr/share/automake/config.sub .
206 --datadir=%{_datadir}/%{name} \
207 --with-htmlpath=%{_datadir}/%{name}/html \
209 --with%{!?with_usb:out}-usb \
210 --with%{!?with_snmp:out}-snmp \
211 --with%{!?with_hal:out}-hal \
212 --with%{!?with_cgi:out}-cgi \
214 --with%{!?with_neon:out}-neon \
217 %{?with_usb:--with-udev-dir=/etc/udev} \
218 %{?with_hal:--with-hal-callouts-path=%{_libdir}/hal} \
219 %{?with_hal:--with-hal-fdi-path=%{_datadir}/hal/fdi/information/20thirdparty} \
220 --with-statepath=%{_var}/lib/ups \
221 --with-drvpath=/lib/nut \
222 --with-cgipath=/home/services/httpd/cgi-bin \
229 rm -rf $RPM_BUILD_ROOT
230 install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},/var/lib/ups,/lib/nut,/sbin}
233 DESTDIR=$RPM_BUILD_ROOT
235 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ups
236 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ups
237 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/upsmon
238 install %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/upsmon
240 for i in $RPM_BUILD_ROOT%{_sysconfdir}/*.sample; do
241 mv -f $i ${i%.sample}
244 %{!?with_usb:rm -f $RPM_BUILD_ROOT%{_udevrulesdir}/52-nut-usbups.rules}
246 cat > $RPM_BUILD_ROOT/sbin/poweroff-ups << EOF
248 /etc/rc.d/init.d/ups powerdown
251 %{__rm} $RPM_BUILD_ROOT%{_libdir}/*.la
254 rm -rf $RPM_BUILD_ROOT
258 /sbin/chkconfig --add ups
259 %service ups restart "NUT ups daemon"
260 %systemd_post nut-driver.service nut-server.service
263 if [ "$1" = "0" ]; then
265 /sbin/chkconfig --del ups
267 %systemd_preun nut-driver.service nut-server.service
273 %triggerpostun -- nut < 2.6.4-2
274 [ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
275 [ ${RPM_ENABLE_SYSTEMD_SERVICE:-yes} = no ] && exit 0
276 /sbin/chkconfig --list ups 2>/dev/null | grep -qsv "[0-6]:on" && exit 0
277 %systemd_service_enable nut-driver.service nut-server.service
278 %systemd_service mask ups.service
282 if [ -n "`/usr/bin/getgid ups 2> /dev/null`" ] && [ "`/usr/bin/getgid ups 2> /dev/null`" = 121 ]; then
283 /usr/sbin/groupmod -g 76 ups
284 chgrp ups %{_sysconfdir}/{upsd.conf,ups.conf,upsd.users}
285 /usr/sbin/usermod -g 76 ups
288 %useradd -u 70 -d /usr/share/empty -s /bin/false -c "UPS Manager User" -g ups ups
290 %post common -p /sbin/ldconfig
294 if [ "$1" = "0" ]; then
300 /sbin/chkconfig --add upsmon
301 %service upsmon restart "NUT upsmon daemon"
302 %systemd_post nut-monitor.service
305 if [ "$1" = "0" ]; then
307 /sbin/chkconfig --del upsmon
309 %systemd_preun nut-monitor.service
314 %triggerpostun client -- nut-client < 2.6.4-2
315 [ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
316 [ ${RPM_ENABLE_SYSTEMD_SERVICE:-yes} = no ] && exit 0
317 /sbin/chkconfig --list upsmon 2>/dev/null | grep -qsv "[0-6]:on" && exit 0
318 %systemd_service_enable nut-monitor.service
319 %systemd_service mask upsmon.service
322 %defattr(644,root,root,755)
323 %attr(755,root,root) %{_bindir}/nut-scanner
324 %attr(755,root,root) %{_bindir}/upscmd
325 %attr(755,root,root) %{_bindir}/upslog
326 %attr(755,root,root) %{_bindir}/upsrw
327 %attr(755,root,root) %{_sbindir}/upsd
328 %attr(755,root,root) /sbin/poweroff-ups
329 %attr(755,root,root) %ghost %{_libdir}/libnutscan.so.1
330 %attr(755,root,root) %{_libdir}/libnutscan.so.*.*.*
331 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ups
332 %attr(754,root,root) /etc/rc.d/init.d/ups
333 %attr(640,root,ups) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nut.conf
334 %attr(640,root,ups) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/upsd.conf
335 %attr(640,root,ups) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ups.conf
336 %attr(640,root,ups) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/upsd.users
337 %{systemdunitdir}/nut-driver.service
338 %{systemdunitdir}/nut-server.service
339 %{_mandir}/man5/ups.conf.5*
340 %{_mandir}/man5/upsd.conf.5*
341 %{_mandir}/man5/upsd.users.5*
342 %{_mandir}/man8/nut-recorder.8*
343 %{_mandir}/man8/nut-scanner.8*
344 %{_mandir}/man8/upscmd.8*
345 %{_mandir}/man8/upscode2.8*
346 %{_mandir}/man8/upsd.8*
347 %{_mandir}/man8/upsdrvctl.8*
348 %{_mandir}/man8/upslog.8*
349 %{_mandir}/man8/upsrw.8*
350 %dir %attr(770,root,ups) /var/lib/ups
352 %attr(755,root,root) /lib/nut/apcsmart
353 %attr(755,root,root) /lib/nut/apcsmart-old
354 %attr(755,root,root) /lib/nut/bcmxcp
355 %{?with_usb:%attr(755,root,root) /lib/nut/bcmxcp_usb}
356 %attr(755,root,root) /lib/nut/belkin
357 %attr(755,root,root) /lib/nut/belkinunv
358 %attr(755,root,root) /lib/nut/bestfcom
359 %attr(755,root,root) /lib/nut/bestfortress
360 %attr(755,root,root) /lib/nut/bestuferrups
361 %attr(755,root,root) /lib/nut/bestups
362 %attr(755,root,root) /lib/nut/blazer_ser
363 %{?with_usb:%attr(755,root,root) /lib/nut/blazer_usb}
364 %attr(755,root,root) /lib/nut/clone
365 %attr(755,root,root) /lib/nut/clone-outlet
366 %attr(755,root,root) /lib/nut/dummy-ups
367 %attr(755,root,root) /lib/nut/etapro
368 %attr(755,root,root) /lib/nut/everups
369 %attr(755,root,root) /lib/nut/gamatronic
370 %attr(755,root,root) /lib/nut/genericups
371 %attr(755,root,root) /lib/nut/isbmex
372 %attr(755,root,root) /lib/nut/ivtscd
373 %attr(755,root,root) /lib/nut/liebert
374 %attr(755,root,root) /lib/nut/liebert-esp2
375 %attr(755,root,root) /lib/nut/masterguard
376 %attr(755,root,root) /lib/nut/metasys
377 %attr(755,root,root) /lib/nut/mge-shut
378 %attr(755,root,root) /lib/nut/mge-utalk
379 %attr(755,root,root) /lib/nut/microdowell
380 %{?with_neon:%attr(755,root,root) /lib/nut/netxml-ups}
381 %attr(755,root,root) /lib/nut/newmge-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/safenet
389 %attr(755,root,root) /lib/nut/skel
390 %{?with_snmp:%attr(755,root,root) /lib/nut/snmp-ups}
391 %attr(755,root,root) /lib/nut/solis
392 %attr(755,root,root) /lib/nut/tripplite
393 %attr(755,root,root) /lib/nut/tripplitesu
394 %{?with_usb:%attr(755,root,root) /lib/nut/tripplite_usb}
395 %attr(755,root,root) /lib/nut/upscode2
396 %attr(755,root,root) /lib/nut/upsdrvctl
397 %{?with_usb:%attr(755,root,root) /lib/nut/usbhid-ups}
398 %attr(755,root,root) /lib/nut/victronups
400 %{_mandir}/man5/nut.conf.5*
401 %{_mandir}/man8/apcsmart.8*
402 %{_mandir}/man8/apcsmart-old.8*
403 %{_mandir}/man8/bcmxcp.8*
404 %{?with_usb:%{_mandir}/man8/bcmxcp_usb.8*}
405 %{_mandir}/man8/belkin.8*
406 %{_mandir}/man8/belkinunv.8*
407 %{_mandir}/man8/bestfcom.8*
408 %{_mandir}/man8/bestfortress.8*
409 %{_mandir}/man8/bestuferrups.8*
410 %{_mandir}/man8/bestups.8*
411 %{_mandir}/man8/blazer.8*
412 %{_mandir}/man8/clone.8*
413 %{_mandir}/man8/dummy-ups.8*
414 %{_mandir}/man8/etapro.8*
415 %{_mandir}/man8/everups.8*
416 %{_mandir}/man8/gamatronic.8*
417 %{_mandir}/man8/genericups.8*
418 %{_mandir}/man8/isbmex.8*
419 %{_mandir}/man8/ivtscd.8*
420 %{_mandir}/man8/liebert.8*
421 %{_mandir}/man8/liebert-esp2.8*
422 %{_mandir}/man8/masterguard.8*
423 %{_mandir}/man8/metasys.8*
424 %{_mandir}/man8/mge-shut.8*
425 %{_mandir}/man8/mge-utalk.8*
426 %{_mandir}/man8/microdowell.8*
427 %{?with_neon:%{_mandir}/man8/netxml-ups.8*}
428 %{_mandir}/man8/nutupsdrv.8*
429 %{_mandir}/man8/oneac.8*
430 %{_mandir}/man8/optiups.8*
431 %{_mandir}/man8/powercom.8*
432 %{_mandir}/man8/powerpanel.8*
433 %{_mandir}/man8/rhino.8*
434 %{?with_usb:%{_mandir}/man8/richcomm_usb.8*}
435 %{_mandir}/man8/safenet.8*
436 %{?with_snmp:%{_mandir}/man8/snmp-ups.8*}
437 %{_mandir}/man8/solis.8*
438 %{_mandir}/man8/tripplite.8*
439 %{_mandir}/man8/tripplitesu.8*
440 %{?with_usb:%{_mandir}/man8/tripplite_usb.8*}
441 %{?with_usb:%{_mandir}/man8/usbhid-ups.8*}
442 %{_mandir}/man8/victronups.8*
443 %{?with_usb:%config(noreplace) %verify(not md5 mtime size) %{_udevrulesdir}/52-nut-usbups.rules}
446 %defattr(644,root,root,755)
447 %doc AUTHORS MAINTAINERS NEWS README UPGRADING ChangeLog docs
449 %attr(755,root,root) %ghost %{_libdir}/libupsclient.so.1
450 %attr(755,root,root) %{_libdir}/libupsclient.so.*.*.*
453 %defattr(644,root,root,755)
454 %attr(755,root,root) %{_bindir}/upsc
455 %attr(755,root,root) %{_sbindir}/upsmon
456 %attr(755,root,root) %{_sbindir}/upssched
457 %attr(754,root,root) /etc/rc.d/init.d/upsmon
458 %attr(640,root,ups) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/upsmon.conf
459 %attr(640,root,ups) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/upssched.conf
460 %attr(750,root,ups) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/upssched-cmd
461 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/upsmon
462 /lib/systemd/system-shutdown/nutshutdown
463 %{systemdunitdir}/nut-monitor.service
464 %{_mandir}/man5/upsmon.conf.5*
465 %{_mandir}/man5/upssched.conf.5*
466 %{_mandir}/man8/upsc.8*
467 %{_mandir}/man8/upsmon.8*
468 %{_mandir}/man8/upssched.8*
472 %defattr(644,root,root,755)
473 %{_datadir}/%{name}/html
474 %attr(755,root,root) /home/services/httpd/cgi-bin/*.cgi
475 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/hosts.conf
476 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/upsset.conf
477 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.html
478 %{_mandir}/man5/hosts.conf.5*
479 %{_mandir}/man5/upsset.conf.5*
480 %{_mandir}/man5/upsstats.html.5*
481 %{_mandir}/man8/upsimage.cgi.8*
482 %{_mandir}/man8/upsset.cgi.8*
483 %{_mandir}/man8/upsstats.cgi.8*
488 %defattr(644,root,root,755)
489 %attr(755,root,root) %{_libdir}/hal/hald-addon-bcmxcp_usb
490 %attr(755,root,root) %{_libdir}/hal/hald-addon-blazer_usb
491 %attr(755,root,root) %{_libdir}/hal/hald-addon-tripplite_usb
492 %attr(755,root,root) %{_libdir}/hal/hald-addon-usbhid-ups
493 %{_datadir}/hal/fdi/information/20thirdparty/20-ups-nut-device.fdi
497 %defattr(644,root,root,755)
498 %attr(755,root,root) %{_libdir}/libupsclient.so
499 %attr(755,root,root) %{_libdir}/libnutscan.so
500 %{_pkgconfigdir}/libupsclient.pc
501 %{_pkgconfigdir}/libnutscan.pc