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