]> git.pld-linux.org Git - packages/nut.git/blob - nut.spec
- added Obsoletes: smartupstools
[packages/nut.git] / nut.spec
1 Summary:        Network UPS Tools
2 Summary(pl):    Sieciowe narzêdzie do UPS-ów
3 Name:           nut
4 Version:        0.45.2
5 Release:        1
6 License:        GPL
7 Group:          Applications/System
8 Group(de):      Applikationen/System
9 Group(pl):      Aplikacje/System
10 Source0:        http://www.exploits.org/nut/release/%{name}-%{version}.tar.gz
11 Source1:        %{name}.init
12 Source2:        %{name}.sysconfig
13 Source3:        %{name}-upsmon.init
14 Patch0:         %{name}-DESTDIR.patch
15 Patch1:         %{name}-client.patch
16 Patch2:         %{name}-lookup_for_libgd_ac_fix.patch
17 URL:            http://www.exploits.org/nut/
18 BuildRequires:  autoconf
19 BuildRequires:  gd-devel >= 2.0.1
20 BuildRequires:  libpng-devel
21 Prereq:         rc-scripts
22 Prereq:         /sbin/chkconfig
23 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
24 Obsoletes:      smartupstools
25
26 %define         _sysconfdir     /etc/ups
27
28 %description
29 These programs are part of a developing project to monitor the
30 assortment of UPSes that are found out there in the field. Many models
31 have serial serial ports of some kind that allow some form of state
32 checking. This capability has been harnessed where possible to allow
33 for safe shutdowns, live status tracking on web pages, and more.
34
35 %description -l pl
36 Te programy s± czê¶ci± projektu do monitorowania wielu UPS-ów w jakim¶
37 otoczeniu. Wiele modeli ma porty szeregowe i pozwala na jak±¶ formê
38 sprawdzania stanu. Ta funkcjonalno¶æ pozwala na bezpieczne
39 zatrzymywanie systemów, sprawdzanie stanu zasilania przez WWW i inne.
40
41 %package client
42 Summary:        Multi-vendor UPS Monitoring Project Client Utilities
43 Summary(pl):    Narzêdzia klienckie do monitorowania UPS-ów
44 Group:          Applications/System
45 Group(de):      Applikationen/System
46 Group(pl):      Aplikacje/System
47 Prereq:         rc-scripts
48 Prereq:         /sbin/chkconfig
49
50 %description client
51 This package includes the client utilities that are required to
52 monitor a UPS that the client host is plugged into but monitored via
53 serial cable by another host on the network....
54
55 %description client -l pl
56 Ten pakiet zawiera narzêdzia kliencie potrzebne do monitorowania UPS-a
57 do którego pod³±czony jest komputer kliencki, kiedy kabel szeregowy
58 UPS-a jest pod³±czony do innego komputera w sieci.
59
60 %package cgi
61 Summary:        Multi-vendor UPS Monitoring Project Server - CGI utils
62 Summary(pl):    Narzêdzia CGI do monitorowania UPS-ów
63 Group:          Applications/System
64 Group(de):      Applikationen/System
65 Group(pl):      Aplikacje/System
66
67 %description cgi
68 These programs are part of a developing project to monitor the
69 assortment of UPSes that are found out there in the field. Many models
70 have serial serial ports of some kind that allow some form of state
71 checking. This capability has been harnessed where possible to allow
72 for safe shutdowns, live status tracking on web pages, and more.
73 This package contains CGI utils.
74
75 %description cgi -l pl
76 Te programy s± czê¶ci± projektu do monitorowania wielu UPS-ów w jakim¶
77 otoczeniu. Wiele modeli ma porty szeregowe i pozwala na jak±¶ formê
78 sprawdzania stanu. Ta funkcjonalno¶æ pozwala na bezpieczne
79 zatrzymywanie systemów, sprawdzanie stanu zasilania przez WWW i inne.
80 Ten pakiet zawiera narzêdzia CGI.
81
82 %prep
83 %setup -q
84 %patch0 -p1
85 %patch1 -p1
86 %patch2 -p1
87
88 %build
89 autoconf
90 %configure \
91         --with-statepath=/var/lib/ups \
92         --with-uid=nobody \
93         --with-group=ttyS
94 %{__make} all cgi
95
96 %install
97 rm -rf $RPM_BUILD_ROOT
98 install -d $RPM_BUILD_ROOT/{etc/{sysconfig,rc.d/init.d},/var/lib/ups}
99
100 %{__make} install install-cgi \
101         DESTDIR=$RPM_BUILD_ROOT \
102         CGIPATH=/home/httpd/cgi-bin
103
104 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ups
105 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ups
106 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/upsmon
107 install conf/ups.conf $RPM_BUILD_ROOT%{_sysconfdir}/ups.conf
108
109 gzip -9nf CREDITS README docs/{FAQ,Changes*,*.txt,cables/*}
110
111 %clean
112 rm -rf $RPM_BUILD_ROOT
113
114 #%pre
115 #if [ -n "`id -u ups 2>/dev/null`" ]; then
116 #       if [ "`id -u ups`" != "68" ]; then
117 #               echo "Warning: user ups does not have uid=68. Correct this before installing NUT" 1>&2
118 #               exit 1
119 #       fi
120 #else
121 #       /usr/sbin/useradd -u 68 -r -d /var/lib/ups -s /bin/sh -c "Network UPS Tools User" -g ttyS ups 1>&2
122 #fi
123
124 %post
125 /sbin/chkconfig --add ups
126 if [ -f /var/lock/subsys/ups ]; then
127         /etc/rc.d/init.d/ups restart >&2
128 else
129         echo "Run \"/etc/rc.d/init.d/ups start\" to start NUT ups daemon."
130 fi
131
132 %post client
133 /sbin/chkconfig --add upsmon
134 if [ -f /var/lock/subsys/upsmon ]; then
135         /etc/rc.d/init.d/upsmon restart >&2
136 else
137         echo "Run \"/etc/rc.d/init.d/upsmon start\" to start NUT upsmon daemon."
138 fi
139
140 %preun
141 if [ "$1" = "0" ]; then
142         if [ -f /var/lock/subsys/ups ]; then
143                 /etc/rc.d/init.d/ups stop >&2
144         fi
145         /sbin/chkconfig --del ups
146 fi
147
148 #%postun
149 #if [ "$1" = "0" ]; then
150 #       userdel ups 2>&1
151 #fi
152
153 %preun client
154 if [ "$1" = "0" ]; then
155         if [ -f /var/lock/subsys/upsmon ]; then
156                 /etc/rc.d/init.d/upsmon stop >&2
157         fi
158         /sbin/chkconfig --del upsmon
159 fi
160         
161 %files
162 %defattr(644,root,root,755)
163 %doc *.gz docs/{,cables}/*.gz
164 %attr(755,root,root) %{_bindir}/aeg
165 %attr(755,root,root) %{_bindir}/apcsmart
166 %attr(755,root,root) %{_bindir}/belkin
167 %attr(755,root,root) %{_bindir}/bestfort
168 %attr(755,root,root) %{_bindir}/bestuferrups
169 %attr(755,root,root) %{_bindir}/bestups
170 %attr(755,root,root) %{_bindir}/engetron
171 %attr(755,root,root) %{_bindir}/everups
172 %attr(755,root,root) %{_bindir}/fentonups
173 %attr(755,root,root) %{_bindir}/genericups
174 %attr(755,root,root) %{_bindir}/ipt-anzen
175 %attr(755,root,root) %{_bindir}/mge-ellipse
176 %attr(755,root,root) %{_bindir}/mgeups
177 %attr(755,root,root) %{_bindir}/masterguard
178 %attr(755,root,root) %{_bindir}/multilink
179 %attr(755,root,root) %{_bindir}/mustekups
180 %attr(755,root,root) %{_bindir}/newapc
181 %attr(755,root,root) %{_bindir}/optiups
182 %attr(755,root,root) %{_bindir}/powercom
183 %attr(755,root,root) %{_bindir}/sec
184 %attr(755,root,root) %{_bindir}/sms
185 %attr(755,root,root) %{_bindir}/toshiba1500
186 %attr(755,root,root) %{_bindir}/upscmd
187 %attr(755,root,root) %{_bindir}/upsdrvctl
188 %attr(755,root,root) %{_bindir}/upseyeux
189 %attr(755,root,root) %{_bindir}/ups-trust425+625
190 %attr(755,root,root) %{_sbindir}/upsd
191 %attr(755,root,root) %{_bindir}/upslog
192 %attr(755,root,root) %{_bindir}/victronups
193 %config(noreplace) /etc/sysconfig/ups
194 %attr(754,root,root) /etc/rc.d/init.d/ups
195 %attr(640,root,root) %config(noreplace) %{_sysconfdir}/upsd.conf
196 %attr(640,root,root) %config(noreplace) %{_sysconfdir}/ups.conf
197 %attr(640,root,root) %config(noreplace) %{_sysconfdir}/upsd.users
198 %{_mandir}/man5/*
199 %{_mandir}/man8/*
200 %dir %attr(750,nobody,root) /var/lib/ups
201
202 %files client
203 %defattr(644,root,root,755)
204 %attr(755,root,root) %{_bindir}/upsc
205 %attr(755,root,root) %{_bindir}/upsct
206 %attr(755,root,root) %{_bindir}/upsct2
207 %attr(755,root,root) %{_sbindir}/upsmon
208 %attr(755,root,root) %{_sbindir}/upssched
209 %attr(755,root,root) %{_sbindir}/upssched-cmd
210 %attr(754,root,root) /etc/rc.d/init.d/upsmon
211 %attr(600,root,root) %config(noreplace) %{_sysconfdir}/upsmon.conf
212 %attr(600,root,root) %config(noreplace) %{_sysconfdir}/upssched.conf
213
214 %files cgi
215 %defattr(644,root,root,755)
216 %attr(755,root,root) /home/httpd/cgi-bin/*.cgi
217 %config(noreplace) %{_sysconfdir}/hosts.conf
218 %config(noreplace) %{_sysconfdir}/multimon.conf
219 %config(noreplace) %{_sysconfdir}/upsset.conf
This page took 0.044464 seconds and 4 git commands to generate.