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