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