]> git.pld-linux.org Git - packages/nut.git/blob - nut.spec
- BR xorg-lib-libXpm-devel
[packages/nut.git] / nut.spec
1 #
2 # Conditional build:
3 %bcond_without  hidups                  # experimental hidups driver
4 #
5 Summary:        Network UPS Tools
6 Summary(pl.UTF-8):      Sieciowe narzędzie do UPS-ów
7 Name:           nut
8 Version:        2.0.5
9 Release:        2
10 License:        GPL
11 Group:          Applications/System
12 Source0:        http://eu1.networkupstools.org/source/2.0/%{name}-%{version}.tar.gz
13 # Source0-md5:  b08fde86191154bbcfda860f95a5dca2
14 Source1:        %{name}.init
15 Source2:        %{name}.sysconfig
16 Source3:        %{name}-upsmon.init
17 Source4:        %{name}.sysconfig.upsmon
18 Patch0:         %{name}-client.patch
19 Patch1:         %{name}-datadir.patch
20 Patch2:         %{name}-config.patch
21 Patch3:         %{name}-smartdp-load.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:  net-snmp-devel
28 BuildRequires:  openssl-devel >= 0.9.7d
29 BuildRequires:  rpmbuild(macros) >= 1.268
30 BuildRequires:  xorg-lib-libXpm-devel
31 Requires(post,preun):   /sbin/chkconfig
32 Requires:       %{name}-common = %{version}-%{release}
33 Requires:       rc-scripts
34 Obsoletes:      smartupstools
35 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36
37 %define         _sysconfdir     /etc/ups
38
39 %description
40 These programs are part of a developing project to monitor the
41 assortment of UPSes that are found out there in the field. Many models
42 have serial serial ports of some kind that allow some form of state
43 checking. This capability has been harnessed where possible to allow
44 for safe shutdowns, live status tracking on web pages, and more.
45
46 %description -l pl.UTF-8
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 %description -l ru.UTF-8
53 Эти программы - часть проекта по мониторингу различных UPS. У многих
54 моделей есть сериальные порты, позволяющие проверять состояние этих
55 UPS. Эта возможность была использована, где это возможно, для
56 выполнения безопасных остановов компьютеров, отслеживания статуса
57 через веб и т.п.
58
59 %description -l uk.UTF-8
60 Ці програми є частиною проекту по моніторингу різноманітних UPS.
61 Багато моделей мають серіальні порти, що дозволять перевіряти стан цих
62 UPS. Ця можливість була використана, де це можливо, для виконання
63 безпечних зупинок комп'ютерів, відслідковування статусу через веб,
64 тощо.
65
66 %package common
67 Summary:        Package with common files for nut daemon and its clients
68 Summary(pl.UTF-8):      Pakiet z plikami wspólnymi dla demona nut i jego klientów
69 Group:          Applications/System
70 Requires(postun):       /usr/sbin/groupdel
71 Requires(postun):       /usr/sbin/userdel
72 Requires(pre):  /bin/id
73 Requires(pre):  /usr/bin/getgid
74 Requires(pre):  /usr/sbin/groupadd
75 Requires(pre):  /usr/sbin/groupmod
76 Requires(pre):  /usr/sbin/useradd
77 Provides:       group(ups)
78 Provides:       user(ups)
79
80 %description common
81 Package with common files for nut daemon and its clients.
82
83 %description common -l pl.UTF-8
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.UTF-8):      Narzędzia klienckie do monitorowania UPS-ów
89 Summary(ru.UTF-8):      Network UPS Tools - клиентские утилиты мониторинга
90 Summary(uk.UTF-8):      Network UPS Tools - клієнтські утиліти моніторингу
91 Group:          Applications/System
92 Requires(post,preun):   /sbin/chkconfig
93 Requires:       %{name}-common = %{version}-%{release}
94 Requires:       rc-scripts
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.UTF-8
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.UTF-8
107 Этот пакет включает клиентские утилиты, необходимые для мониторинга
108 UPS, к которому клиентский хост имеет доступ, но UPS физически
109 подключен к другому компьютеру в сети.
110
111 %description client -l uk.UTF-8
112 Цей пакет включає клієнтські утиліти, потрібні для моніторингу UPS, до
113 якого клієнтський хост має доступ, але UPS фізично підключений до
114 іншого комп'ютеру в мережі.
115
116 %package cgi
117 Summary:        Multi-vendor UPS Monitoring Project Server - CGI utils
118 Summary(pl.UTF-8):      Narzędzia CGI do monitorowania UPS-ów
119 Summary(ru.UTF-8):      Network UPS Tools - CGI утилиты
120 Summary(uk.UTF-8):      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.UTF-8
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.UTF-8
140 Этот пакет включает CGI программы для доступа к информации о статусе
141 UPS через веб-интерфейс.
142
143 %description cgi -l uk.UTF-8
144 Цей пакет включає CGI програми для доступу до інформації про статус
145 UPS через веб-інтерфейс.
146
147 %package devel
148 Summary:        Files for NUT clients development
149 Summary(pl.UTF-8):      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.UTF-8
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 %patch2 -p1
165 %patch3 -p1
166
167 %build
168 cp -f /usr/share/automake/config.sub .
169 %{__aclocal}
170 %{__autoconf}
171 LDFLAGS="-L%{_prefix}/X11R6/%{_lib}"; export LDFLAGS
172 %configure \
173         %{?with_hidups:--with-linux-hiddev} \
174         --with-ssl \
175         --with-cgi \
176         --with-linux-hiddev=%{_includedir}/linux/hiddev.h \
177         --with-statepath=%{_var}/lib/ups \
178         --with-drvpath=/lib/nut \
179         --with-cgipath=/home/services/httpd/cgi-bin \
180         --with-user=ups \
181         --with-group=ups
182 %{__make} all snmp cgi
183 %{?with_hidups:%{__make} build-usb}
184
185 %install
186 rm -rf $RPM_BUILD_ROOT
187 install -d $RPM_BUILD_ROOT{/sbin,/etc/{sysconfig,rc.d/init.d},/var/lib/ups} \
188         $RPM_BUILD_ROOT{/lib/nut,%{_libdir},%{_includedir}/nut}
189
190 %{__make} install install-snmp install-cgi \
191         DESTDIR=$RPM_BUILD_ROOT
192
193 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ups
194 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ups
195 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/upsmon
196 install %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/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 %{?with_hidups:install drivers/newhidups $RPM_BUILD_ROOT/lib/nut}
206
207 cat > $RPM_BUILD_ROOT/sbin/poweroff-ups << EOF
208 #!/bin/sh
209 /etc/rc.d/init.d/ups powerdown
210 EOF
211
212 %clean
213 rm -rf $RPM_BUILD_ROOT
214
215 %post
216 /sbin/chkconfig --add ups
217 %service ups restart "NUT ups daemon"
218
219 %preun
220 if [ "$1" = "0" ]; then
221         %service ups stop
222         /sbin/chkconfig --del ups
223 fi
224
225 %pre common
226 # move to trigger?
227 if [ -n "`/usr/bin/getgid ups`" ] && [ "`/usr/bin/getgid ups`" = 121 ]; then
228         /usr/sbin/groupmod -g 76 ups
229         chgrp ups %{_sysconfdir}/{upsd.conf,ups.conf,upsd.users}
230         /usr/sbin/usermod -g 76 ups
231 fi
232 %groupadd -g 76 ups
233 %useradd -u 70 -d /usr/share/empty -s /bin/false -c "UPS Manager User" -g ups ups
234
235 %post client
236 /sbin/chkconfig --add upsmon
237 %service upsmon restart "NUT upsmon daemon"
238
239 %preun client
240 if [ "$1" = "0" ]; then
241         %service upsmon stop
242         /sbin/chkconfig --del upsmon
243 fi
244
245 %postun common
246 if [ "$1" = "0" ]; then
247         %userremove ups
248         %groupremove ups
249 fi
250
251 %files
252 %defattr(644,root,root,755)
253 %attr(755,root,root) %{_bindir}/upscmd
254 %attr(755,root,root) %{_bindir}/upslog
255 %attr(755,root,root) %{_bindir}/upsrw
256 %attr(755,root,root) %{_sbindir}/upsd
257 %attr(755,root,root) /sbin/poweroff-ups
258 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ups
259 %attr(754,root,root) /etc/rc.d/init.d/ups
260 %attr(640,root,ups) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/upsd.conf
261 %attr(640,root,ups) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ups.conf
262 %attr(640,root,ups) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/upsd.users
263 %{_mandir}/man5/ups.conf.5*
264 %{_mandir}/man5/upsd.conf.5*
265 %{_mandir}/man5/upsd.users.5*
266 %{_mandir}/man8/[!u]*.8*
267 %{_mandir}/man8/upscmd.8*
268 %{_mandir}/man8/upscode2.8*
269 %{_mandir}/man8/upsd.8*
270 %{_mandir}/man8/upsdrvctl.8*
271 %{_mandir}/man8/upslog.8*
272 %{_mandir}/man8/upsrw.8*
273 %dir %attr(770,root,ups) /var/lib/ups
274 %dir /lib/nut
275 %attr(755,root,root) /lib/nut/*
276 %{_datadir}/nut
277
278 %files common
279 %defattr(644,root,root,755)
280 %doc NEWS README ChangeLog CREDITS docs
281 %dir %{_sysconfdir}
282
283 %files client
284 %defattr(644,root,root,755)
285 %attr(755,root,root) %{_bindir}/upsc
286 %attr(755,root,root) %{_sbindir}/upsmon
287 %attr(755,root,root) %{_sbindir}/upssched
288 %attr(755,root,root) %{_sbindir}/upssched-cmd
289 %attr(754,root,root) /etc/rc.d/init.d/upsmon
290 %attr(640,root,ups) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/upsmon.conf
291 %attr(640,root,ups) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/upssched.conf
292 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/upsmon
293 %{_mandir}/man5/upsmon.conf.5*
294 %{_mandir}/man5/upssched.conf.5*
295 %{_mandir}/man8/upsc.8*
296 %{_mandir}/man8/upsmon.8*
297 %{_mandir}/man8/upssched.8*
298
299 %files cgi
300 %defattr(644,root,root,755)
301 %attr(755,root,root) /home/services/httpd/cgi-bin/*.cgi
302 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/hosts.conf
303 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/upsset.conf
304 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.html
305 %{_mandir}/man5/hosts.conf.5*
306 %{_mandir}/man5/upsset.conf.5*
307 %{_mandir}/man5/upsstats.html.5*
308 %{_mandir}/man8/upsimage.cgi.8*
309 %{_mandir}/man8/upsset.cgi.8*
310 %{_mandir}/man8/upsstats.cgi.8*
311
312 %files devel
313 %defattr(644,root,root,755)
314 %{_libdir}/upsclient.o
315 %{_libdir}/parseconf.o
316 %{_includedir}/nut
This page took 0.081316 seconds and 4 git commands to generate.