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