]> git.pld-linux.org Git - packages/nut.git/blame - nut.spec
- fixed example pipe and lock paths
[packages/nut.git] / nut.spec
CommitLineData
5b1b7012 1# TODO:
cb3bd3f3
SS
2# - unpackaged files:
3# /usr/html/{{bottom,header,index}.html,nut-banner.png}
4# /etc/udev/rules.d/52_nut-usbups.rules
339bd4b5 5# - upsdrvctl (used by ups.init) doesn't recognize status and reload commands
93d02520 6#
d42048d2
SS
7# Conditional build:
8%bcond_without usb # build without usb drivers
9%bcond_without hal # build without hal support
10%bcond_without snmp # build without snmp driver
7a608f5b 11%bcond_without cgi # build without cgi support
d42048d2 12#
b5b3df3f 13Summary: Network UPS Tools
c6724b41 14Summary(pl.UTF-8): Sieciowe narzędzie do UPS-ów
bdc056b1 15Name: nut
b48a3bd6 16Version: 2.2.0
c476bf32 17Release: 0.4
685b18fd
JB
18License: GPL
19Group: Applications/System
b48a3bd6
SS
20Source0: http://eu1.networkupstools.org/source/2.2/%{name}-%{version}.tar.gz
21# Source0-md5: a3570515d80804051d4e7631e8a3eb12
40676016
SZ
22Source1: %{name}.init
23Source2: %{name}.sysconfig
24Source3: %{name}-upsmon.init
c98eee00 25Source4: %{name}.sysconfig.upsmon
b89318ae 26Patch0: %{name}-client.patch
339bd4b5
SS
27Patch1: %{name}-config.patch
28Patch2: %{name}-smartdp-load.patch
d2013d2d 29URL: http://www.networkupstools.org/
8888735b 30BuildRequires: autoconf
bb94ceb4 31BuildRequires: automake
7a608f5b
SS
32%{?with_hal:BuildRequires: dbus-glib-devel}
33%{?with_cgi:BuildRequires: gd-devel >= 2.0.15}
34%{?with_hal:BuildRequires: hal-devel}
35%{?with_usb:BuildRequires: libusb-devel}
36%{?with_snmp:BuildRequires: net-snmp-devel}
64d0f8a3 37BuildRequires: openssl-devel >= 0.9.7d
bafdd0d8 38BuildRequires: rpmbuild(macros) >= 1.268
e3eed19f 39Requires(post,preun): /sbin/chkconfig
d2013d2d 40Requires: %{name}-common = %{version}-%{release}
bafdd0d8 41Requires: rc-scripts
4ad00b30 42Obsoletes: smartupstools
685b18fd 43BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
bdc056b1 44
b5b3df3f 45%define _sysconfdir /etc/ups
256539ca 46
47%description
12fd7daa 48These programs are part of a developing project to monitor the
49assortment of UPSes that are found out there in the field. Many models
50have serial serial ports of some kind that allow some form of state
51checking. This capability has been harnessed where possible to allow
52for safe shutdowns, live status tracking on web pages, and more.
a3e2bab2 53
9a270388
JR
54%description -l pl.UTF-8
55Te programy są częścią projektu do monitorowania wielu UPS-ów w jakimś
56otoczeniu. Wiele modeli ma porty szeregowe i pozwala na jakąś formę
57sprawdzania stanu. Ta funkcjonalność pozwala na bezpieczne
58zatrzymywanie systemów, sprawdzanie stanu zasilania przez WWW i inne.
59
60%description -l ru.UTF-8
61Эти программы - часть проекта по мониторингу различных UPS. У многих
62моделей есть сериальные порты, позволяющие проверять состояние этих
63UPS. Эта возможность была использована, где это возможно, для
64выполнения безопасных остановов компьютеров, отслеживания статуса
65через веб и т.п.
66
67%description -l uk.UTF-8
68Ці програми є частиною проекту по моніторингу різноманітних UPS.
69Багато моделей мають серіальні порти, що дозволять перевіряти стан цих
70UPS. Ця можливість була використана, де це можливо, для виконання
71безпечних зупинок комп'ютерів, відслідковування статусу через веб,
72тощо.
5ae18b3b 73
61cb8b6a
JB
74%package common
75Summary: Package with common files for nut daemon and its clients
c6724b41 76Summary(pl.UTF-8): Pakiet z plikami wspólnymi dla demona nut i jego klientów
61cb8b6a 77Group: Applications/System
bafdd0d8
ER
78Requires(postun): /usr/sbin/groupdel
79Requires(postun): /usr/sbin/userdel
f70aa0cd
AZ
80Requires(pre): /bin/id
81Requires(pre): /usr/bin/getgid
82Requires(pre): /usr/sbin/groupadd
83Requires(pre): /usr/sbin/groupmod
84Requires(pre): /usr/sbin/useradd
f70aa0cd
AZ
85Provides: group(ups)
86Provides: user(ups)
61cb8b6a
JB
87
88%description common
89Package with common files for nut daemon and its clients.
90
9a270388
JR
91%description common -l pl.UTF-8
92Pakiet z plikami wspólnymi dla demona nut i jego klientów.
61cb8b6a 93
256539ca 94%package client
b5b3df3f 95Summary: Multi-vendor UPS Monitoring Project Client Utilities
c6724b41
ER
96Summary(pl.UTF-8): Narzędzia klienckie do monitorowania UPS-ów
97Summary(ru.UTF-8): Network UPS Tools - клиентские утилиты мониторинга
98Summary(uk.UTF-8): Network UPS Tools - клієнтські утиліти моніторингу
12fd7daa 99Group: Applications/System
61cb8b6a 100Requires(post,preun): /sbin/chkconfig
d2013d2d 101Requires: %{name}-common = %{version}-%{release}
bafdd0d8 102Requires: rc-scripts
256539ca 103
104%description client
12fd7daa 105This package includes the client utilities that are required to
e3915765 106monitor a UPS that the client host is plugged into but monitored via
12fd7daa 107serial cable by another host on the network....
256539ca 108
9a270388
JR
109%description client -l pl.UTF-8
110Ten pakiet zawiera narzędzia kliencie potrzebne do monitorowania UPS-a
111do którego podłączony jest komputer kliencki, kiedy kabel szeregowy
112UPS-a jest podłączony do innego komputera w sieci.
e3915765 113
9a270388
JR
114%description client -l ru.UTF-8
115Этот пакет включает клиентские утилиты, необходимые для мониторинга
116UPS, к которому клиентский хост имеет доступ, но UPS физически
117подключен к другому компьютеру в сети.
5ae18b3b 118
9a270388
JR
119%description client -l uk.UTF-8
120Цей пакет включає клієнтські утиліти, потрібні для моніторингу UPS, до
121якого клієнтський хост має доступ, але UPS фізично підключений до
122іншого комп'ютеру в мережі.
5ae18b3b 123
b5b3df3f 124%package cgi
125Summary: Multi-vendor UPS Monitoring Project Server - CGI utils
c6724b41
ER
126Summary(pl.UTF-8): Narzędzia CGI do monitorowania UPS-ów
127Summary(ru.UTF-8): Network UPS Tools - CGI утилиты
128Summary(uk.UTF-8): Network UPS Tools - CGI утиліти
12fd7daa 129Group: Applications/System
d2013d2d 130Requires: %{name}-common = %{version}-%{release}
256539ca 131
b5b3df3f 132%description cgi
12fd7daa 133These programs are part of a developing project to monitor the
134assortment of UPSes that are found out there in the field. Many models
135have serial serial ports of some kind that allow some form of state
136checking. This capability has been harnessed where possible to allow
27c27cdd 137for safe shutdowns, live status tracking on web pages, and more. This
138package contains CGI utils.
bdc056b1 139
9a270388
JR
140%description cgi -l pl.UTF-8
141Te programy są częścią projektu do monitorowania wielu UPS-ów w jakimś
142otoczeniu. Wiele modeli ma porty szeregowe i pozwala na jakąś formę
143sprawdzania stanu. Ta funkcjonalność pozwala na bezpieczne
144zatrzymywanie systemów, sprawdzanie stanu zasilania przez WWW i inne.
145Ten pakiet zawiera narzędzia CGI.
e3915765 146
9a270388
JR
147%description cgi -l ru.UTF-8
148Этот пакет включает CGI программы для доступа к информации о статусе
149UPS через веб-интерфейс.
5ae18b3b 150
9a270388
JR
151%description cgi -l uk.UTF-8
152Цей пакет включає CGI програми для доступу до інформації про статус
153UPS через веб-інтерфейс.
5ae18b3b 154
75ada04b
JB
155%package devel
156Summary: Files for NUT clients development
c6724b41 157Summary(pl.UTF-8): Pliki do tworzenia klientów NUT-a
75ada04b 158Group: Development/Libraries
5f4e72de 159Requires: openssl-devel >= 0.9.7c
75ada04b
JB
160# it does NOT require nut
161
162%description devel
163Object file and header for developing NUT clients.
164
9a270388
JR
165%description devel -l pl.UTF-8
166Plik wynikowy oraz nagłówek służące do tworzenia klientów NUT-a.
75ada04b 167
256539ca 168%prep
bdc056b1 169%setup -q
47438095 170%patch0 -p1
339bd4b5 171%patch1 -p1
7993f35d 172%patch2 -p1
256539ca 173
174%build
98bc0d34 175cp -f /usr/share/automake/config.sub .
a1ad492b 176%{__aclocal} -I m4
47438095 177%{__automake}
e9811b1d 178%{__autoconf}
bdc056b1 179%configure \
47438095 180 --datadir=%{_datadir}/%{name} \
d42048d2
SS
181 %{?with_hal:--with-hal} \
182 %{!?with_hal:--without-hal} \
25a2fc94 183 --with-serial \
d42048d2
SS
184 %{?with_snmp:--with-snmp} \
185 %{!?with_snmp:--without-snmp} \
186 %{?with_usb:--with-usb} \
187 %{!?with_usb:--without-usb} \
b43b4863 188 --with-ssl \
7a608f5b
SS
189 %{?with_cgi:--with-cgi} \
190 %{!?with_cgi:--without-cgi} \
bb94ceb4
AM
191 --with-linux-hiddev=%{_includedir}/linux/hiddev.h \
192 --with-statepath=%{_var}/lib/ups \
f0c6d93d 193 --with-drvpath=/lib/nut \
bb94ceb4 194 --with-cgipath=/home/services/httpd/cgi-bin \
00007c1c 195 --with-user=ups \
f0c6d93d 196 --with-group=ups
c476bf32 197%{__make}
256539ca 198
199%install
b5b3df3f 200rm -rf $RPM_BUILD_ROOT
61cb8b6a 201install -d $RPM_BUILD_ROOT{/sbin,/etc/{sysconfig,rc.d/init.d},/var/lib/ups} \
f0c6d93d 202 $RPM_BUILD_ROOT{/lib/nut,%{_libdir},%{_includedir}/nut}
256539ca 203
32690701 204%{__make} install \
bb94ceb4 205 DESTDIR=$RPM_BUILD_ROOT
256539ca 206
dd7f6db0 207install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ups
40676016
SZ
208install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ups
209install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/upsmon
c98eee00 210install %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/upsmon
256539ca 211
ed885e39
SS
212for i in $RPM_BUILD_ROOT%{_sysconfdir}/*.sample; do
213 mv -f $i ${i%.sample}
214done
aa4169fd 215
0ebdc37c
JB
216install clients/upsclient.o common/parseconf.o $RPM_BUILD_ROOT%{_libdir}
217install clients/upsclient.h include/parseconf.h $RPM_BUILD_ROOT%{_includedir}/nut
75ada04b 218
fcb7474e
AM
219cat > $RPM_BUILD_ROOT/sbin/poweroff-ups << EOF
220#!/bin/sh
221/etc/rc.d/init.d/ups powerdown
222EOF
223
e3915765
JB
224%clean
225rm -rf $RPM_BUILD_ROOT
226
8e1c5beb
JB
227%post
228/sbin/chkconfig --add ups
bafdd0d8 229%service ups restart "NUT ups daemon"
8e1c5beb
JB
230
231%preun
232if [ "$1" = "0" ]; then
bafdd0d8 233 %service ups stop
8e1c5beb
JB
234 /sbin/chkconfig --del ups
235fi
236
f70aa0cd 237%pre common
ec237ac6
ER
238# move to trigger?
239if [ -n "`/usr/bin/getgid ups`" ] && [ "`/usr/bin/getgid ups`" = 121 ]; then
240 /usr/sbin/groupmod -g 76 ups
241 chgrp ups %{_sysconfdir}/{upsd.conf,ups.conf,upsd.users}
242 /usr/sbin/usermod -g 76 ups
00007c1c 243fi
ec237ac6
ER
244%groupadd -g 76 ups
245%useradd -u 70 -d /usr/share/empty -s /bin/false -c "UPS Manager User" -g ups ups
00007c1c 246
40676016
SZ
247%post client
248/sbin/chkconfig --add upsmon
bafdd0d8 249%service upsmon restart "NUT upsmon daemon"
40676016 250
40676016
SZ
251%preun client
252if [ "$1" = "0" ]; then
bafdd0d8 253 %service upsmon stop
40676016
SZ
254 /sbin/chkconfig --del upsmon
255fi
27c27cdd 256
f70aa0cd 257%postun common
00007c1c 258if [ "$1" = "0" ]; then
d4e46a3a 259 %userremove ups
260 %groupremove ups
2aa46474 261fi
00007c1c 262
256539ca 263%files
bdc056b1 264%defattr(644,root,root,755)
17231a88 265%attr(755,root,root) %{_bindir}/upscmd
bdc056b1 266%attr(755,root,root) %{_bindir}/upslog
b43b4863 267%attr(755,root,root) %{_bindir}/upsrw
bb94ceb4 268%attr(755,root,root) %{_sbindir}/upsd
fcb7474e 269%attr(755,root,root) /sbin/poweroff-ups
b2c2fd62 270%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ups
dd7f6db0 271%attr(754,root,root) /etc/rc.d/init.d/ups
b2c2fd62
JB
272%attr(640,root,ups) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/upsd.conf
273%attr(640,root,ups) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ups.conf
274%attr(640,root,ups) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/upsd.users
61cb8b6a
JB
275%{_mandir}/man5/ups.conf.5*
276%{_mandir}/man5/upsd.conf.5*
277%{_mandir}/man5/upsd.users.5*
61cb8b6a 278%{_mandir}/man8/upscmd.8*
e3eed19f 279%{_mandir}/man8/upscode2.8*
61cb8b6a
JB
280%{_mandir}/man8/upsd.8*
281%{_mandir}/man8/upsdrvctl.8*
282%{_mandir}/man8/upslog.8*
283%{_mandir}/man8/upsrw.8*
f0c6d93d
JK
284%dir %attr(770,root,ups) /var/lib/ups
285%dir /lib/nut
8eb1294c
SS
286%attr(755,root,root) /lib/nut/al175
287%attr(755,root,root) /lib/nut/apcsmart
288%attr(755,root,root) /lib/nut/bcmxcp
d42048d2 289%{?with_usb:%attr(755,root,root) /lib/nut/bcmxcp_usb}
8eb1294c
SS
290%attr(755,root,root) /lib/nut/belkin
291%attr(755,root,root) /lib/nut/belkinunv
292%attr(755,root,root) /lib/nut/bestfcom
293%attr(755,root,root) /lib/nut/bestuferrups
294%attr(755,root,root) /lib/nut/bestups
8eb1294c
SS
295%attr(755,root,root) /lib/nut/cpsups
296%attr(755,root,root) /lib/nut/cyberpower
b89318ae 297%attr(755,root,root) /lib/nut/dummy-ups
d42048d2 298%{?with_usb:%attr(755,root,root) /lib/nut/energizerups}
8eb1294c
SS
299%attr(755,root,root) /lib/nut/etapro
300%attr(755,root,root) /lib/nut/everups
8eb1294c
SS
301%attr(755,root,root) /lib/nut/gamatronic
302%attr(755,root,root) /lib/nut/genericups
d42048d2 303%if %{with hal}
b89318ae
SS
304%attr(755,root,root) /lib/nut/hald-addon-bcmxcp_usb
305%attr(755,root,root) /lib/nut/hald-addon-megatec_usb
306%attr(755,root,root) /lib/nut/hald-addon-tripplite_usb
307%attr(755,root,root) /lib/nut/hald-addon-usbhid-ups
d42048d2 308%endif
8eb1294c
SS
309%attr(755,root,root) /lib/nut/isbmex
310%attr(755,root,root) /lib/nut/liebert
311%attr(755,root,root) /lib/nut/masterguard
312%attr(755,root,root) /lib/nut/megatec
d42048d2 313%{?with_usb:%attr(755,root,root) /lib/nut/megatec_usb}
8eb1294c
SS
314%attr(755,root,root) /lib/nut/metasys
315%attr(755,root,root) /lib/nut/mge-shut
316%attr(755,root,root) /lib/nut/mge-utalk
b89318ae 317%attr(755,root,root) /lib/nut/newmge-shut
8eb1294c
SS
318%attr(755,root,root) /lib/nut/nitram
319%attr(755,root,root) /lib/nut/oneac
320%attr(755,root,root) /lib/nut/optiups
321%attr(755,root,root) /lib/nut/powercom
322%attr(755,root,root) /lib/nut/powerpanel
323%attr(755,root,root) /lib/nut/rhino
324%attr(755,root,root) /lib/nut/safenet
b89318ae 325%attr(755,root,root) /lib/nut/skel
d42048d2 326%{?with_snmp:%attr(755,root,root) /lib/nut/snmp-ups}
8eb1294c
SS
327%attr(755,root,root) /lib/nut/solis
328%attr(755,root,root) /lib/nut/tripplite
8eb1294c 329%attr(755,root,root) /lib/nut/tripplitesu
d42048d2 330%{?with_usb:%attr(755,root,root) /lib/nut/tripplite_usb}
8eb1294c
SS
331%attr(755,root,root) /lib/nut/upscode2
332%attr(755,root,root) /lib/nut/upsdrvctl
d42048d2 333%{?with_usb:%attr(755,root,root) /lib/nut/usbhid-ups}
8eb1294c 334%attr(755,root,root) /lib/nut/victronups
47438095 335%{_datadir}/nut
b89318ae
SS
336%{_mandir}/man8/al175.8*
337%{_mandir}/man8/apcsmart.8*
338%{_mandir}/man8/bcmxcp.8*
d42048d2 339%{?with_usb:%{_mandir}/man8/bcmxcp_usb.8*}
b89318ae
SS
340%{_mandir}/man8/belkin.8*
341%{_mandir}/man8/belkinunv.8*
342%{_mandir}/man8/bestfcom.8*
343%{_mandir}/man8/bestuferrups.8*
344%{_mandir}/man8/bestups.8*
345%{_mandir}/man8/cpsups.8*
346%{_mandir}/man8/cyberpower.8*
347%{_mandir}/man8/dummy-ups.8*
d42048d2 348%{?with_usb:%{_mandir}/man8/energizerups.8*}
b89318ae
SS
349%{_mandir}/man8/etapro.8*
350%{_mandir}/man8/everups.8*
cb3bd3f3 351%{_mandir}/man8/gamatronic.8*
b89318ae
SS
352%{_mandir}/man8/genericups.8*
353%{_mandir}/man8/isbmex.8*
354%{_mandir}/man8/liebert.8*
355%{_mandir}/man8/masterguard.8*
356%{_mandir}/man8/megatec.8*
d42048d2 357%{?with_usb:%{_mandir}/man8/megatec_usb.8*}
b89318ae
SS
358%{_mandir}/man8/metasys.8*
359%{_mandir}/man8/mge-shut.8*
360%{_mandir}/man8/mge-utalk.8*
361%{_mandir}/man8/nitram.8*
362%{_mandir}/man8/nutupsdrv.8*
363%{_mandir}/man8/oneac.8*
364%{_mandir}/man8/optiups.8*
365%{_mandir}/man8/powercom.8*
366%{_mandir}/man8/powerpanel.8*
cb3bd3f3 367%{_mandir}/man8/rhino.8*
b89318ae 368%{_mandir}/man8/safenet.8*
d42048d2 369%{?with_snmp:%{_mandir}/man8/snmp-ups.8*}
b89318ae
SS
370%{_mandir}/man8/solis.8*
371%{_mandir}/man8/tripplite.8*
372%{_mandir}/man8/tripplitesu.8*
d42048d2
SS
373%{?with_usb:%{_mandir}/man8/tripplite_usb.8*}
374%{?with_usb:%{_mandir}/man8/usbhid-ups.8*}
b89318ae 375%{_mandir}/man8/victronups.8*
256539ca 376
61cb8b6a
JB
377%files common
378%defattr(644,root,root,755)
cb3bd3f3 379%doc AUTHORS MAINTAINERS NEWS README UPGRADING ChangeLog docs
61cb8b6a
JB
380%dir %{_sysconfdir}
381
256539ca 382%files client
bdc056b1 383%defattr(644,root,root,755)
bdc056b1 384%attr(755,root,root) %{_bindir}/upsc
2d7b3549
MK
385%attr(755,root,root) %{_sbindir}/upsmon
386%attr(755,root,root) %{_sbindir}/upssched
47438095 387%attr(755,root,root) %{_sbindir}/upssched-cmd
40676016 388%attr(754,root,root) /etc/rc.d/init.d/upsmon
f70aa0cd
AZ
389%attr(640,root,ups) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/upsmon.conf
390%attr(640,root,ups) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/upssched.conf
b2c2fd62 391%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/upsmon
61cb8b6a
JB
392%{_mandir}/man5/upsmon.conf.5*
393%{_mandir}/man5/upssched.conf.5*
394%{_mandir}/man8/upsc.8*
395%{_mandir}/man8/upsmon.8*
396%{_mandir}/man8/upssched.8*
256539ca 397
7a608f5b 398%if %{with cgi}
b5b3df3f 399%files cgi
bdc056b1 400%defattr(644,root,root,755)
bb94ceb4 401%attr(755,root,root) /home/services/httpd/cgi-bin/*.cgi
b2c2fd62
JB
402%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/hosts.conf
403%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/upsset.conf
404%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.html
61cb8b6a
JB
405%{_mandir}/man5/hosts.conf.5*
406%{_mandir}/man5/upsset.conf.5*
407%{_mandir}/man5/upsstats.html.5*
408%{_mandir}/man8/upsimage.cgi.8*
409%{_mandir}/man8/upsset.cgi.8*
410%{_mandir}/man8/upsstats.cgi.8*
7a608f5b 411%endif
75ada04b
JB
412
413%files devel
414%defattr(644,root,root,755)
415%{_libdir}/upsclient.o
0ebdc37c
JB
416%{_libdir}/parseconf.o
417%{_includedir}/nut
This page took 0.101034 seconds and 4 git commands to generate.