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