]> git.pld-linux.org Git - packages/nut.git/blob - nut.spec
- Release: 4 (in Ra is 3)
[packages/nut.git] / nut.spec
1 Summary:        Network UPS Tools
2 Summary(pl):    Sieciowe narzêdzie do UPS-ów
3 Name:           nut
4 Version:        1.4.0
5 Release:        3
6 License:        GPL
7 Group:          Applications/System
8 Source0:        http://penguin.harrison.k12.co.us/mirrors/nut/release/1.4/%{name}-%{version}.tar.gz
9 # Source0-md5:  1ddf547866db0f1eeb9c535ba0339906
10 Source1:        %{name}.init
11 Source2:        %{name}.sysconfig
12 Source3:        %{name}-upsmon.init
13 Source4:        http://www.nixz.net/nut/everups.c
14 # NoSource4-md5:        526bd50f3f5cedf6d60b99998f866b0d
15 Patch0:         %{name}-client.patch
16 Patch1:         %{name}-datadir.patch
17 URL:            http://www.exploits.org/nut/
18 BuildRequires:  autoconf
19 BuildRequires:  automake
20 BuildRequires:  gd-devel >= 2.0.15
21 BuildRequires:  libpng-devel
22 BuildRequires:  openssl-devel >= 0.9.7c
23 PreReq:         rc-scripts
24 Requires(pre):  /bin/id
25 Requires(pre):  /usr/bin/getgid
26 Requires(pre):  /usr/sbin/useradd
27 Requires(pre):  /usr/sbin/groupadd
28 Requires(post,preun):   /sbin/chkconfig
29 Requires(postun):       /usr/sbin/groupdel
30 Requires(postun):       /usr/sbin/userdel
31 Requires:       %{name}-common = %{version}
32 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33 Obsoletes:      smartupstools
34
35 %define         _sysconfdir     /etc/ups
36
37 %description
38 These programs are part of a developing project to monitor the
39 assortment of UPSes that are found out there in the field. Many models
40 have serial serial ports of some kind that allow some form of state
41 checking. This capability has been harnessed where possible to allow
42 for safe shutdowns, live status tracking on web pages, and more.
43
44 This nut ships with modified everups.c - support for Ever UPS models
45 (by Mikolaj Tutak <mtutak@eranet.pl>)
46
47 %description -l pl
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 Ta wersja posiada zmieniony sterownik everups.c - obs³uguje zasilacze
54 firmy Ever UPS models (autorstwa Miko³aja Tutaka <mtutak@eranet.pl>)
55
56 %description -l ru
57 üÔÉ ÐÒÏÇÒÁÍÍÙ - ÞÁÓÔØ ÐÒÏÅËÔÁ ÐÏ ÍÏÎÉÔÏÒÉÎÇÕ ÒÁÚÌÉÞÎÙÈ UPS. õ ÍÎÏÇÉÈ
58 ÍÏÄÅÌÅÊ ÅÓÔØ ÓÅÒÉÁÌØÎÙÅ ÐÏÒÔÙ, ÐÏÚ×ÏÌÑÀÝÉÅ ÐÒÏ×ÅÒÑÔØ ÓÏÓÔÏÑÎÉÅ ÜÔÉÈ
59 UPS. üÔÁ ×ÏÚÍÏÖÎÏÓÔØ ÂÙÌÁ ÉÓÐÏÌØÚÏ×ÁÎÁ, ÇÄÅ ÜÔÏ ×ÏÚÍÏÖÎÏ, ÄÌÑ
60 ×ÙÐÏÌÎÅÎÉÑ ÂÅÚÏÐÁÓÎÙÈ ÏÓÔÁÎÏ×Ï× ËÏÍÐØÀÔÅÒÏ×, ÏÔÓÌÅÖÉ×ÁÎÉÑ ÓÔÁÔÕÓÁ
61 ÞÅÒÅÚ ×Å ɠÔ.Ð.
62
63 %description -l uk
64 㦠ÐÒÏÇÒÁÍÉ ¤ ÞÁÓÔÉÎÏÀ ÐÒÏÅËÔÕ ÐÏ ÍÏΦÔÏÒÉÎÇÕ Ò¦ÚÎÏÍÁΦÔÎÉÈ UPS.
65 âÁÇÁÔÏ ÍÏÄÅÌÅÊ ÍÁÀÔØ ÓÅÒ¦ÁÌØΦ ÐÏÒÔÉ, ÝÏ ÄÏÚ×ÏÌÑÔØ ÐÅÒÅצÒÑÔÉ ÓÔÁΠÃÉÈ
66 UPS. ãÑ ÍÏÖÌÉצÓÔØ ÂÕÌÁ ×ÉËÏÒÉÓÔÁÎÁ, ÄÅ ÃÅ ÍÏÖÌÉ×Ï, ÄÌÑ ×ÉËÏÎÁÎÎÑ
67 ÂÅÚÐÅÞÎÉÈ ÚÕÐÉÎÏË ËÏÍÐ'ÀÔÅÒ¦×, ×¦ÄÓ̦ÄËÏ×Õ×ÁÎÎÑ ÓÔÁÔÕÓÕ ÞÅÒÅÚ ×ÅÂ,
68 ÔÏÝÏ.
69
70 %package common
71 Summary:        Package with common files for nut daemon and its clients
72 Summary(pl):    Pakiet z plikami wspólnymi dla demona nut i jego klientów
73 Group:          Applications/System
74
75 %description common
76 Package with common files for nut daemon and its clients.
77
78 %description common -l pl
79 Pakiet z plikami wspólnymi dla demona nut i jego klientów.
80
81 %package client
82 Summary:        Multi-vendor UPS Monitoring Project Client Utilities
83 Summary(pl):    Narzêdzia klienckie do monitorowania UPS-ów
84 Summary(uk):    Network UPS Tools - Ë̦¤ÎÔÓØ˦ ÕÔÉ̦ÔÉ ÍÏΦÔÏÒÉÎÇÕ
85 Summary(ru):    Network UPS Tools - ËÌÉÅÎÔÓËÉÅ ÕÔÉÌÉÔÙ ÍÏÎÉÔÏÒÉÎÇÁ
86 Group:          Applications/System
87 PreReq:         rc-scripts
88 Requires(post,preun):   /sbin/chkconfig
89 Requires:       %{name}-common = %{version}
90
91 %description client
92 This package includes the client utilities that are required to
93 monitor a UPS that the client host is plugged into but monitored via
94 serial cable by another host on the network....
95
96 %description client -l pl
97 Ten pakiet zawiera narzêdzia kliencie potrzebne do monitorowania UPS-a
98 do którego pod³±czony jest komputer kliencki, kiedy kabel szeregowy
99 UPS-a jest pod³±czony do innego komputera w sieci.
100
101 %description client -l ru
102 üÔÏÔ ÐÁËÅÔ ×ËÌÀÞÁÅÔ ËÌÉÅÎÔÓËÉÅ ÕÔÉÌÉÔÙ, ÎÅÏÂÈÏÄÉÍÙÅ ÄÌÑ ÍÏÎÉÔÏÒÉÎÇÁ
103 UPS, Ë ËÏÔÏÒÏÍÕ ËÌÉÅÎÔÓËÉÊ ÈÏÓÔ ÉÍÅÅÔ ÄÏÓÔÕÐ, ÎÏ UPS ÆÉÚÉÞÅÓËÉ
104 ÐÏÄËÌÀÞÅΠˠÄÒÕÇÏÍÕ ËÏÍÐØÀÔÅÒÕ × ÓÅÔÉ.
105
106 %description client -l uk
107 ãÅÊ ÐÁËÅÔ ×ËÌÀÞÁ¤ Ë̦¤ÎÔÓØ˦ ÕÔÉ̦ÔÉ, ÐÏÔÒ¦ÂΦ ÄÌÑ ÍÏΦÔÏÒÉÎÇÕ UPS, ÄÏ
108 ÑËÏÇÏ Ë̦¤ÎÔÓØËÉÊ ÈÏÓÔ ÍÁ¤ ÄÏÓÔÕÐ, ÁÌÅ UPS Æ¦ÚÉÞÎϠЦÄËÌÀÞÅÎÉÊ ÄÏ
109 ¦ÎÛÏÇÏ ËÏÍÐ'ÀÔÅÒÕ × ÍÅÒÅÖ¦.
110
111 %package cgi
112 Summary:        Multi-vendor UPS Monitoring Project Server - CGI utils
113 Summary(pl):    Narzêdzia CGI do monitorowania UPS-ów
114 Summary(ru):    Network UPS Tools - CGI ÕÔÉÌÉÔÙ
115 Summary(uk):    Network UPS Tools - CGI ÕÔÉ̦ÔÉ
116 Group:          Applications/System
117 Requires:       %{name}-common = %{version}
118
119 %description cgi
120 These programs are part of a developing project to monitor the
121 assortment of UPSes that are found out there in the field. Many models
122 have serial serial ports of some kind that allow some form of state
123 checking. This capability has been harnessed where possible to allow
124 for safe shutdowns, live status tracking on web pages, and more. This
125 package contains CGI utils.
126
127 %description cgi -l pl
128 Te programy s± czê¶ci± projektu do monitorowania wielu UPS-ów w jakim¶
129 otoczeniu. Wiele modeli ma porty szeregowe i pozwala na jak±¶ formê
130 sprawdzania stanu. Ta funkcjonalno¶æ pozwala na bezpieczne
131 zatrzymywanie systemów, sprawdzanie stanu zasilania przez WWW i inne.
132 Ten pakiet zawiera narzêdzia CGI.
133
134 %description cgi -l ru
135 üÔÏÔ ÐÁËÅÔ ×ËÌÀÞÁÅÔ CGI ÐÒÏÇÒÁÍÍÙ ÄÌÑ ÄÏÓÔÕÐÁ Ë ÉÎÆÏÒÍÁÃÉÉ Ï ÓÔÁÔÕÓÅ
136 UPS ÞÅÒÅÚ ×ÅÂ-ÉÎÔÅÒÆÅÊÓ.
137
138 %description cgi -l uk
139 ãÅÊ ÐÁËÅÔ ×ËÌÀÞÁ¤ CGI ÐÒÏÇÒÁÍÉ ÄÌÑ ÄÏÓÔÕÐÕ ÄÏ ¦ÎÆÏÒÍÁ槠ÐÒÏ ÓÔÁÔÕÓ
140 UPS ÞÅÒÅÚ ×ÅÂ-¦ÎÔÅÒÆÅÊÓ.
141
142 %package devel
143 Summary:        Files for NUT clients development
144 Summary(pl):    Pliki do tworzenia klientów NUT-a
145 Group:          Development/Libraries
146 Requires:       openssl-devel >= 0.9.7c
147 # it does NOT require nut
148
149 %description devel
150 Object file and header for developing NUT clients.
151
152 %description devel -l pl
153 Plik wynikowy oraz nag³ówek s³u¿±ce do tworzenia klientów NUT-a.
154
155 %prep
156 %setup -q
157 %patch0 -p1
158 %patch1 -p1
159 %{?_with_new_everups_driver:install %{SOURCE4} drivers/everups.c }
160
161 %build
162 %{__aclocal}
163 %{__autoconf}
164 LDFLAGS="-L%{_prefix}/X11R6/lib"; export LDFLAGS
165 %configure \
166         --with-ssl \
167         --with-cgi \
168         --with-linux-hiddev=%{_includedir}/linux/hiddev.h \
169         --with-statepath=%{_var}/lib/ups \
170         --with-drvpath=/lib/nut \
171         --with-cgipath=/home/services/httpd/cgi-bin \
172         --with-user=ups \
173         --with-group=ups
174 %{__make} all cgi
175
176 %install
177 rm -rf $RPM_BUILD_ROOT
178 install -d $RPM_BUILD_ROOT{/sbin,/etc/{sysconfig,rc.d/init.d},/var/lib/ups} \
179         $RPM_BUILD_ROOT{/lib/nut,%{_libdir},%{_includedir}/nut}
180
181 %{__make} install DESTDIR=$RPM_BUILD_ROOT
182         
183 %{__make} install install-cgi \
184         DESTDIR=$RPM_BUILD_ROOT
185
186 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ups
187 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ups
188 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/upsmon
189
190 rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/*
191 install conf/*.users conf/*.conf conf/*.html $RPM_BUILD_ROOT%{_sysconfdir}
192
193 install clients/upsclient.o common/parseconf.o $RPM_BUILD_ROOT%{_libdir}
194 install clients/upsclient.h include/parseconf.h $RPM_BUILD_ROOT%{_includedir}/nut
195
196 cat > $RPM_BUILD_ROOT/sbin/poweroff-ups << EOF
197 #!/bin/sh
198 /etc/rc.d/init.d/ups powerdown
199 EOF
200
201 %clean
202 rm -rf $RPM_BUILD_ROOT
203
204 %pre
205 if [ -n "`/usr/bin/getgid ups`" ]; then
206         if [ "`getgid ups`" != "121" ]; then
207                 echo "Error: group ups doesn't have gid=121. Correct this before installing %{name}." 1>&2
208                 exit 1
209         fi
210 else
211         /usr/sbin/groupadd -g 121 -r -f ups
212 fi
213 if [ -n "`id -u ups 2>/dev/null`" ]; then
214         if [ "`id -u ups`" != "70" ]; then
215                 echo "Error: user ups doesn't have uid=70. Correct this before installing %{name}." 1>&2
216                 exit 1
217         fi
218 else
219         echo "Adding user ups UID=70."
220         /usr/sbin/useradd -u 70 -r -d /no/home -s /bin/false -c "UPS Manager User" -g ups ups 1>&2
221 fi
222
223
224 %post
225 /sbin/chkconfig --add ups
226 if [ -f /var/lock/subsys/ups ]; then
227         /etc/rc.d/init.d/ups restart >&2
228 else
229         echo "Run \"/etc/rc.d/init.d/ups start\" to start NUT ups daemon."
230 fi
231
232 %post client
233 /sbin/chkconfig --add upsmon
234 if [ -f /var/lock/subsys/upsmon ]; then
235         /etc/rc.d/init.d/upsmon restart >&2
236 else
237         echo "Run \"/etc/rc.d/init.d/upsmon start\" to start NUT upsmon daemon."
238 fi
239
240 %preun
241 if [ "$1" = "0" ]; then
242         if [ -f /var/lock/subsys/ups ]; then
243                 /etc/rc.d/init.d/ups stop >&2
244         fi
245         /sbin/chkconfig --del ups
246 fi
247
248 %preun client
249 if [ "$1" = "0" ]; then
250         if [ -f /var/lock/subsys/upsmon ]; then
251                 /etc/rc.d/init.d/upsmon stop >&2
252         fi
253         /sbin/chkconfig --del upsmon
254 fi
255
256 %postun
257 if [ "$1" = "0" ]; then
258         echo "Removing user ups."
259         /usr/sbin/userdel ups
260         echo "Removing group ups."
261         /usr/sbin/groupdel ups
262 fi      
263
264 %files
265 %defattr(644,root,root,755)
266 %attr(755,root,root) %{_bindir}/upscmd
267 %attr(755,root,root) %{_bindir}/upslog
268 %attr(755,root,root) %{_bindir}/upsrw
269 %attr(755,root,root) %{_sbindir}/upsd
270 %attr(755,root,root) /sbin/poweroff-ups
271 %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/ups
272 %attr(754,root,root) /etc/rc.d/init.d/ups
273 %attr(640,root,ups) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/upsd.conf
274 %attr(640,root,ups) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/ups.conf
275 %attr(640,root,ups) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/upsd.users
276 %{_mandir}/man5/ups.conf.5*
277 %{_mandir}/man5/upsd.conf.5*
278 %{_mandir}/man5/upsd.users.5*
279 %{_mandir}/man8/[!u]*.8*
280 %{_mandir}/man8/upscmd.8*
281 %{_mandir}/man8/upsd.8*
282 %{_mandir}/man8/upsdrvctl.8*
283 %{_mandir}/man8/upslog.8*
284 %{_mandir}/man8/upsrw.8*
285 %dir %attr(770,root,ups) /var/lib/ups
286 %dir /lib/nut
287 %attr(755,root,root) /lib/nut/*
288 %{_datadir}/nut
289
290 %files common
291 %defattr(644,root,root,755)
292 %doc NEWS README CHANGES CREDITS docs
293 %dir %{_sysconfdir}
294
295 %files client
296 %defattr(644,root,root,755)
297 %attr(755,root,root) %{_bindir}/upsc
298 %attr(755,root,root) %{_sbindir}/upsmon
299 %attr(755,root,root) %{_sbindir}/upssched
300 %attr(755,root,root) %{_sbindir}/upssched-cmd
301 %attr(754,root,root) /etc/rc.d/init.d/upsmon
302 %attr(600,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/upsmon.conf
303 %attr(600,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/upssched.conf
304 %{_mandir}/man5/upsmon.conf.5*
305 %{_mandir}/man5/upssched.conf.5*
306 %{_mandir}/man8/upsc.8*
307 %{_mandir}/man8/upsmon.8*
308 %{_mandir}/man8/upssched.8*
309
310 %files cgi
311 %defattr(644,root,root,755)
312 %attr(755,root,root) /home/services/httpd/cgi-bin/*.cgi
313 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/hosts.conf
314 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/upsset.conf
315 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/*.html
316 %{_mandir}/man5/hosts.conf.5*
317 %{_mandir}/man5/upsset.conf.5*
318 %{_mandir}/man5/upsstats.html.5*
319 %{_mandir}/man8/upsimage.cgi.8*
320 %{_mandir}/man8/upsset.cgi.8*
321 %{_mandir}/man8/upsstats.cgi.8*
322
323 %files devel
324 %defattr(644,root,root,755)
325 %{_libdir}/upsclient.o
326 %{_libdir}/parseconf.o
327 %{_includedir}/nut
This page took 0.064689 seconds and 4 git commands to generate.