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