]> git.pld-linux.org Git - packages/nut.git/blob - nut.spec
- merged DEVEL
[packages/nut.git] / nut.spec
1 Summary:        Network UPS Tools
2 Summary(pl):    Sieciowe narzêdzie do UPS-ów
3 Name:           nut
4 Version:        1.0.0
5 Release:        1
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 URL:            http://www.exploits.org/nut/
15 BuildRequires:  autoconf
16 BuildRequires:  automake
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
93 %build
94 install /usr/share/automake/config.* .
95 %{__aclocal}
96 %{__autoconf}
97 %configure \
98         --with-cgi \
99         --with-linux-hiddev=%{_includedir}/linux/hiddev.h \
100         --with-statepath=%{_var}/lib/ups \
101         --with-drvpath=%{_libdir}/nut \
102         --with-cgipath=/home/services/httpd/cgi-bin \
103         --with-user=nobody \
104         --with-group=ttyS
105 %{__make} all cgi
106
107 %install
108 rm -rf $RPM_BUILD_ROOT
109 install -d $RPM_BUILD_ROOT/{etc/{sysconfig,rc.d/init.d},/var/lib/ups} \
110         $RPM_BUILD_ROOT{%{_libdir}/nut,%{_includedir}}
111
112 %{__make} install install-cgi \
113         DESTDIR=$RPM_BUILD_ROOT
114
115 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ups
116 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ups
117 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/upsmon
118
119 rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/*
120 install -m644 conf/*.users conf/*.conf $RPM_BUILD_ROOT%{_sysconfdir}
121
122 install -m644 clients/upsfetch.o $RPM_BUILD_ROOT%{_libdir}
123 install -m644 clients/upsfetch.h $RPM_BUILD_ROOT%{_includedir}
124
125 ln -s %{_libdir}/nut/upsdrvctl $RPM_BUILD_ROOT%{_sbindir}
126
127 %clean
128 rm -rf $RPM_BUILD_ROOT
129
130 %post
131 /sbin/chkconfig --add ups
132 if [ -f /var/lock/subsys/ups ]; then
133         /etc/rc.d/init.d/ups restart >&2
134 else
135         echo "Run \"/etc/rc.d/init.d/ups start\" to start NUT ups daemon."
136 fi
137
138 %post client
139 /sbin/chkconfig --add upsmon
140 if [ -f /var/lock/subsys/upsmon ]; then
141         /etc/rc.d/init.d/upsmon restart >&2
142 else
143         echo "Run \"/etc/rc.d/init.d/upsmon start\" to start NUT upsmon daemon."
144 fi
145
146 %preun
147 if [ "$1" = "0" ]; then
148         if [ -f /var/lock/subsys/ups ]; then
149                 /etc/rc.d/init.d/ups stop >&2
150         fi
151         /sbin/chkconfig --del ups
152 fi
153
154 %preun client
155 if [ "$1" = "0" ]; then
156         if [ -f /var/lock/subsys/upsmon ]; then
157                 /etc/rc.d/init.d/upsmon stop >&2
158         fi
159         /sbin/chkconfig --del upsmon
160 fi
161
162 %files
163 %defattr(644,root,root,755)
164 %doc NEWS README CHANGES CREDITS docs/*
165 %attr(755,root,root) %{_bindir}/upscmd
166 %attr(755,root,root) %{_bindir}/upslog
167 %attr(755,root,root) %{_sbindir}/upsdrvctl
168 %attr(755,root,root) %{_sbindir}/upsd
169 %config(noreplace) /etc/sysconfig/ups
170 %attr(754,root,root) /etc/rc.d/init.d/ups
171 %attr(640,root,root) %config(noreplace) %{_sysconfdir}/upsd.conf
172 %attr(640,root,nobody) %config(noreplace) %{_sysconfdir}/ups.conf
173 %attr(640,root,root) %config(noreplace) %{_sysconfdir}/upsd.users
174 %{_mandir}/man5/*
175 %{_mandir}/man8/*
176 %dir %attr(750,nobody,root) /var/lib/ups
177 %dir %attr(755,root,root) %{_libdir}/nut
178 %attr(755,root,root) %{_libdir}/nut/*
179
180 %files client
181 %defattr(644,root,root,755)
182 %attr(755,root,root) %{_bindir}/upsc
183 %attr(755,root,root) %{_bindir}/upsct
184 %attr(755,root,root) %{_bindir}/upsct2
185 %attr(755,root,root) %{_sbindir}/upsmon
186 %attr(755,root,root) %{_sbindir}/upssched
187 %attr(755,root,root) %{_sbindir}/upssched-cmd
188 %attr(754,root,root) /etc/rc.d/init.d/upsmon
189 %attr(600,root,root) %config(noreplace) %{_sysconfdir}/upsmon.conf
190 %attr(600,root,root) %config(noreplace) %{_sysconfdir}/upssched.conf
191
192 %files cgi
193 %defattr(644,root,root,755)
194 %attr(755,root,root) /home/services/httpd/cgi-bin/*.cgi
195 %config(noreplace) %{_sysconfdir}/hosts.conf
196 %config(noreplace) %{_sysconfdir}/multimon.conf
197 %config(noreplace) %{_sysconfdir}/upsset.conf
198
199 %files devel
200 %defattr(644,root,root,755)
201 %{_libdir}/upsfetch.o
202 %{_includedir}/upsfetch.h
This page took 0.079173 seconds and 4 git commands to generate.