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