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