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