]> git.pld-linux.org Git - packages/nut.git/blob - nut.spec
perl -pi -e "s/^automake -a -c -f --foreing/\%\{__automake\}/; \
[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.5
5 Release:        3
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. This
67 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 %package devel
77 Summary:        Files for NUT clients development
78 Summary(pl):    Pliki do tworzenia klientów NUT-a
79 Group:          Development/Libraries
80 # it does NOT require nut
81
82 %description devel
83 Object file and header for developing NUT clients.
84
85 %description devel -l pl
86 Plik wynikowy oraz nag³ówek s³u¿±ce do tworzenia klientów NUT-a.
87
88 %prep
89 %setup -q
90 %patch0 -p1
91 %patch1 -p1
92 %patch2 -p1
93
94 %build
95 %{__autoconf}
96 %configure \
97         --with-statepath=/var/lib/ups \
98         --with-uid=nobody \
99         --with-group=ttyS \
100         --with-modelpath=%{_libdir}/nut
101 %{__make} all cgi
102
103 %install
104 rm -rf $RPM_BUILD_ROOT
105 install -d $RPM_BUILD_ROOT/{etc/{sysconfig,rc.d/init.d},/var/lib/ups} \
106         $RPM_BUILD_ROOT{%{_libdir}/nut,%{_includedir}}
107
108 %{__make} install \
109         DESTDIR=$RPM_BUILD_ROOT \
110         CGIPATH=/home/httpd/cgi-bin
111
112 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ups
113 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ups
114 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/upsmon
115 install conf/ups.conf $RPM_BUILD_ROOT%{_sysconfdir}/ups.conf
116
117 install clients/upsfetch.o $RPM_BUILD_ROOT%{_libdir}
118 install clients/upsfetch.h $RPM_BUILD_ROOT%{_includedir}
119
120 gzip -9nf CREDITS README docs/{FAQ,Changes*,*.txt,cables/*}
121
122 %clean
123 rm -rf $RPM_BUILD_ROOT
124
125 #%pre
126 #if [ -n "`id -u ups 2>/dev/null`" ]; then
127 #       if [ "`id -u ups`" != "68" ]; then
128 #               echo "Warning: user ups does not have uid=68. Correct this before installing NUT" 1>&2
129 #               exit 1
130 #       fi
131 #else
132 #       /usr/sbin/useradd -u 68 -r -d /var/lib/ups -s /bin/sh -c "Network UPS Tools User" -g ttyS ups 1>&2
133 #fi
134
135 %post
136 /sbin/chkconfig --add ups
137 if [ -f /var/lock/subsys/ups ]; then
138         /etc/rc.d/init.d/ups restart >&2
139 else
140         echo "Run \"/etc/rc.d/init.d/ups start\" to start NUT ups daemon."
141 fi
142
143 %post client
144 /sbin/chkconfig --add upsmon
145 if [ -f /var/lock/subsys/upsmon ]; then
146         /etc/rc.d/init.d/upsmon restart >&2
147 else
148         echo "Run \"/etc/rc.d/init.d/upsmon start\" to start NUT upsmon daemon."
149 fi
150
151 %preun
152 if [ "$1" = "0" ]; then
153         if [ -f /var/lock/subsys/ups ]; then
154                 /etc/rc.d/init.d/ups stop >&2
155         fi
156         /sbin/chkconfig --del ups
157 fi
158
159 #%postun
160 #if [ "$1" = "0" ]; then
161 #       userdel ups 2>&1
162 #fi
163
164 %preun client
165 if [ "$1" = "0" ]; then
166         if [ -f /var/lock/subsys/upsmon ]; then
167                 /etc/rc.d/init.d/upsmon stop >&2
168         fi
169         /sbin/chkconfig --del upsmon
170 fi
171
172 %files
173 %defattr(644,root,root,755)
174 %doc *.gz docs/{,cables}/*.gz
175 %attr(755,root,root) %{_bindir}/upscmd
176 %attr(755,root,root) %{_sbindir}/upsd
177 %attr(755,root,root) %{_bindir}/upslog
178 %config(noreplace) /etc/sysconfig/ups
179 %attr(754,root,root) /etc/rc.d/init.d/ups
180 %attr(640,root,root) %config(noreplace) %{_sysconfdir}/upsd.conf
181 %attr(640,root,root) %config(noreplace) %{_sysconfdir}/ups.conf
182 %attr(640,root,root) %config(noreplace) %{_sysconfdir}/upsd.users
183 %{_mandir}/man5/*
184 %{_mandir}/man8/*
185 %dir %attr(750,nobody,root) /var/lib/ups
186 %dir %attr(755,root,root) %{_libdir}/nut
187 %attr(755,root,root) %{_libdir}/nut/*
188
189 %files client
190 %defattr(644,root,root,755)
191 %attr(755,root,root) %{_bindir}/upsc
192 %attr(755,root,root) %{_bindir}/upsct
193 %attr(755,root,root) %{_bindir}/upsct2
194 %attr(755,root,root) %{_sbindir}/upsmon
195 %attr(755,root,root) %{_sbindir}/upssched
196 %attr(755,root,root) %{_sbindir}/upssched-cmd
197 %attr(754,root,root) /etc/rc.d/init.d/upsmon
198 %attr(600,root,root) %config(noreplace) %{_sysconfdir}/upsmon.conf
199 %attr(600,root,root) %config(noreplace) %{_sysconfdir}/upssched.conf
200
201 %files cgi
202 %defattr(644,root,root,755)
203 %attr(755,root,root) /home/httpd/cgi-bin/*.cgi
204 %config(noreplace) %{_sysconfdir}/hosts.conf
205 %config(noreplace) %{_sysconfdir}/multimon.conf
206 %config(noreplace) %{_sysconfdir}/upsset.conf
207
208 %files devel
209 %defattr(644,root,root,755)
210 %{_libdir}/upsfetch.o
211 %{_includedir}/upsfetch.h
This page took 0.07864 seconds and 4 git commands to generate.