]> git.pld-linux.org Git - packages/nut.git/blobdiff - nut.spec
- added /sbin/poweroff-ups
[packages/nut.git] / nut.spec
index 01cc0f56bf982723c19ef8c10c20980627779fb7..c51a8c636d8db585bf12e486ae56ead5cfea724a 100644 (file)
--- a/nut.spec
+++ b/nut.spec
 Summary:       Network UPS Tools
+Summary(pl):   Sieciowe narzêdzie do UPS-ów
+Summary(ru):   NUT - Network UPS Tools
+Summary(uk):   NUT - Network UPS Tools
 Name:          nut
-Version:       0.43.2
+Version:       1.2.1
 Release:       1
 License:       GPL
-Group:         Utilities/System
-Group(pl):     Narzêdzia/System
-Source0:       http://www.exploits.org/nut/release/%{name}-%{version}.tar.gz
-Source1:       ups.init
+Group:         Applications/System
+Source0:       http://penguin.harrison.k12.co.us/mirrors/nut/release/1.2/%{name}-%{version}.tar.gz
+Source1:       %{name}.init
+Source2:       %{name}.sysconfig
+Source3:       %{name}-upsmon.init
+Patch0:                %{name}-client.patch
 URL:           http://www.exploits.org/nut/
-Prereq:                chkconfig
-Prereq:                fileutils
-Requires:      nut-client
+BuildRequires: autoconf
+BuildRequires: automake
+BuildRequires: gd-devel >= 2.0.1
+BuildRequires: libpng-devel
+BuildRequires: openssl-devel
+Prereq:                rc-scripts
+Prereq:                /sbin/chkconfig
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+Obsoletes:     smartupstools
 
 %define                _sysconfdir     /etc/ups
 
 %description
-These programs are part of a developing project to monitor the assortment
-of UPSes that are found out there in the field. Many models have serial
-serial ports of some kind that allow some form of state checking. This
-capability has been harnessed where possible to allow for safe shutdowns,
-live status tracking on web pages, and more.
+These programs are part of a developing project to monitor the
+assortment of UPSes that are found out there in the field. Many models
+have serial serial ports of some kind that allow some form of state
+checking. This capability has been harnessed where possible to allow
+for safe shutdowns, live status tracking on web pages, and more.
+
+%description -l pl
+Te programy s± czê¶ci± projektu do monitorowania wielu UPS-ów w jakim¶
+otoczeniu. Wiele modeli ma porty szeregowe i pozwala na jak±¶ formê
+sprawdzania stanu. Ta funkcjonalno¶æ pozwala na bezpieczne
+zatrzymywanie systemów, sprawdzanie stanu zasilania przez WWW i inne.
+
+%description -l ru
+üÔÉ ÐÒÏÇÒÁÍÍÙ - ÞÁÓÔØ ÐÒÏÅËÔÁ ÐÏ ÍÏÎÉÔÏÒÉÎÇÕ ÒÁÚÌÉÞÎÙÈ UPS. õ ÍÎÏÇÉÈ
+ÍÏÄÅÌÅÊ ÅÓÔØ ÓÅÒÉÁÌØÎÙÅ ÐÏÒÔÙ, ÐÏÚ×ÏÌÑÀÝÉÅ ÐÒÏ×ÅÒÑÔØ ÓÏÓÔÏÑÎÉÅ ÜÔÉÈ
+UPS. üÔÁ ×ÏÚÍÏÖÎÏÓÔØ ÂÙÌÁ ÉÓÐÏÌØÚÏ×ÁÎÁ, ÇÄÅ ÜÔÏ ×ÏÚÍÏÖÎÏ, ÄÌÑ
+×ÙÐÏÌÎÅÎÉÑ ÂÅÚÏÐÁÓÎÙÈ ÏÓÔÁÎÏ×Ï× ËÏÍÐØÀÔÅÒÏ×, ÏÔÓÌÅÖÉ×ÁÎÉÑ ÓÔÁÔÕÓÁ
+ÞÅÒÅÚ ×Å ɠÔ.Ð.
+
+%description -l uk
+㦠ÐÒÏÇÒÁÍÉ ¤ ÞÁÓÔÉÎÏÀ ÐÒÏÅËÔÕ ÐÏ ÍÏΦÔÏÒÉÎÇÕ Ò¦ÚÎÏÍÁΦÔÎÉÈ UPS.
+âÁÇÁÔÏ ÍÏÄÅÌÅÊ ÍÁÀÔØ ÓÅÒ¦ÁÌØΦ ÐÏÒÔÉ, ÝÏ ÄÏÚ×ÏÌÑÔØ ÐÅÒÅצÒÑÔÉ ÓÔÁΠÃÉÈ
+UPS. ãÑ ÍÏÖÌÉצÓÔØ ÂÕÌÁ ×ÉËÏÒÉÓÔÁÎÁ, ÄÅ ÃÅ ÍÏÖÌÉ×Ï, ÄÌÑ ×ÉËÏÎÁÎÎÑ
+ÂÅÚÐÅÞÎÉÈ ÚÕÐÉÎÏË ËÏÍÐ'ÀÔÅÒ¦×, ×¦ÄÓ̦ÄËÏ×Õ×ÁÎÎÑ ÓÔÁÔÕÓÕ ÞÅÒÅÚ ×ÅÂ,
+ÔÏÝÏ.
 
 %package client
 Summary:       Multi-vendor UPS Monitoring Project Client Utilities
-Group:         Utilities/System
-Group(pl):     Narzêdzia/System
+Summary(pl):   Narzêdzia klienckie do monitorowania UPS-ów
+Summary(uk):   Network UPS Tools - Ë̦¤ÎÔÓØ˦ ÕÔÉ̦ÔÉ ÍÏΦÔÏÒÉÎÇÕ
+Summary(ru):   Network UPS Tools - ËÌÉÅÎÔÓËÉÅ ÕÔÉÌÉÔÙ ÍÏÎÉÔÏÒÉÎÇÁ
+Group:         Applications/System
+Prereq:                rc-scripts
+Prereq:                /sbin/chkconfig
 
 %description client
-This package includes the client utilities that are required to monitor a
-ups that the client host is plugged into but monitored via serial cable by
-another host on the network....
+This package includes the client utilities that are required to
+monitor a UPS that the client host is plugged into but monitored via
+serial cable by another host on the network....
+
+%description client -l pl
+Ten pakiet zawiera narzêdzia kliencie potrzebne do monitorowania UPS-a
+do którego pod³±czony jest komputer kliencki, kiedy kabel szeregowy
+UPS-a jest pod³±czony do innego komputera w sieci.
+
+%description client -l ru
+üÔÏÔ ÐÁËÅÔ ×ËÌÀÞÁÅÔ ËÌÉÅÎÔÓËÉÅ ÕÔÉÌÉÔÙ, ÎÅÏÂÈÏÄÉÍÙÅ ÄÌÑ ÍÏÎÉÔÏÒÉÎÇÁ
+UPS, Ë ËÏÔÏÒÏÍÕ ËÌÉÅÎÔÓËÉÊ ÈÏÓÔ ÉÍÅÅÔ ÄÏÓÔÕÐ, ÎÏ UPS ÆÉÚÉÞÅÓËÉ
+ÐÏÄËÌÀÞÅΠˠÄÒÕÇÏÍÕ ËÏÍÐØÀÔÅÒÕ × ÓÅÔÉ.
+
+%description client -l uk
+ãÅÊ ÐÁËÅÔ ×ËÌÀÞÁ¤ Ë̦¤ÎÔÓØ˦ ÕÔÉ̦ÔÉ, ÐÏÔÒ¦ÂΦ ÄÌÑ ÍÏΦÔÏÒÉÎÇÕ UPS, ÄÏ
+ÑËÏÇÏ Ë̦¤ÎÔÓØËÉÊ ÈÏÓÔ ÍÁ¤ ÄÏÓÔÕÐ, ÁÌÅ UPS Æ¦ÚÉÞÎϠЦÄËÌÀÞÅÎÉÊ ÄÏ
+¦ÎÛÏÇÏ ËÏÍÐ'ÀÔÅÒÕ × ÍÅÒÅÖ¦.
 
 %package cgi
 Summary:       Multi-vendor UPS Monitoring Project Server - CGI utils
-Group:         Utilities/System
-Group(pl):     Narzêdzia/System
+Summary(pl):   Narzêdzia CGI do monitorowania UPS-ów
+Summary(ru):   Network UPS Tools - CGI ÕÔÉÌÉÔÙ
+Summary(uk):   Network UPS Tools - CGI ÕÔÉ̦ÔÉ
+Group:         Applications/System
 
 %description cgi
-These programs are part of a developing project to monitor the assortment
-of UPSes that are found out there in the field. Many models have serial
-serial ports of some kind that allow some form of state checking. This
-capability has been harnessed where possible to allow for safe shutdowns,
-live status tracking on web pages, and more.
+These programs are part of a developing project to monitor the
+assortment of UPSes that are found out there in the field. Many models
+have serial serial ports of some kind that allow some form of state
+checking. This capability has been harnessed where possible to allow
+for safe shutdowns, live status tracking on web pages, and more. This
+package contains CGI utils.
+
+%description cgi -l pl
+Te programy s± czê¶ci± projektu do monitorowania wielu UPS-ów w jakim¶
+otoczeniu. Wiele modeli ma porty szeregowe i pozwala na jak±¶ formê
+sprawdzania stanu. Ta funkcjonalno¶æ pozwala na bezpieczne
+zatrzymywanie systemów, sprawdzanie stanu zasilania przez WWW i inne.
+Ten pakiet zawiera narzêdzia CGI.
+
+%description cgi -l ru
+üÔÏÔ ÐÁËÅÔ ×ËÌÀÞÁÅÔ CGI ÐÒÏÇÒÁÍÍÙ ÄÌÑ ÄÏÓÔÕÐÁ Ë ÉÎÆÏÒÍÁÃÉÉ Ï ÓÔÁÔÕÓÅ
+UPS ÞÅÒÅÚ ×ÅÂ-ÉÎÔÅÒÆÅÊÓ.
+
+%description cgi -l uk
+ãÅÊ ÐÁËÅÔ ×ËÌÀÞÁ¤ CGI ÐÒÏÇÒÁÍÉ ÄÌÑ ÄÏÓÔÕÐÕ ÄÏ ¦ÎÆÏÒÍÁ槠ÐÒÏ ÓÔÁÔÕÓ
+UPS ÞÅÒÅÚ ×ÅÂ-¦ÎÔÅÒÆÅÊÓ.
+
+%package devel
+Summary:       Files for NUT clients development
+Summary(pl):   Pliki do tworzenia klientów NUT-a
+Group:         Development/Libraries
+Requires:      openssl-devel
+# it does NOT require nut
+
+%description devel
+Object file and header for developing NUT clients.
+
+%description devel -l pl
+Plik wynikowy oraz nag³ówek s³u¿±ce do tworzenia klientów NUT-a.
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
+%{__aclocal}
+%{__autoconf}
 %configure \
-       --with-statepath=/var/lib/ups \
-       --with-uid=99 \
-       --with-gid=99
-%{__make}
+       --with-ssl \
+       --with-cgi \
+       --with-linux-hiddev=%{_includedir}/linux/hiddev.h \
+       --with-statepath=%{_var}/lib/ups \
+       --with-drvpath=%{_libdir}/nut \
+       --with-cgipath=/home/services/httpd/cgi-bin \
+       --with-user=nobody \
+       --with-group=ttyS
+%{__make} all cgi
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT/{etc/{sysconfig,rc.d/init.d},var/lib/ups}
-%{__make} CONFPATH=$RPM_BUILD_ROOT%{_sysconfdir} BASEPATH=$RPM_BUILD_ROOT%{_prefix} STATEPATH=$RPM_BUILD_ROOT/var/lib/ups install
-%{__make} CONFPATH=$RPM_BUILD_ROOT%{_sysconfdir} BASEPATH=$RPM_BUILD_ROOT/home/httpd STATEPATH=$RPM_BUILD_ROOT/var/lib/ups install-cgi
+install -d $RPM_BUILD_ROOT/{sbin,etc/{sysconfig,rc.d/init.d},/var/lib/ups} \
+       $RPM_BUILD_ROOT{%{_libdir}/nut,%{_includedir}}
 
-install scripts/RedHat-6.0/ups-config $RPM_BUILD_ROOT/etc/sysconfig/ups
-install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d
+%{__make} install install-cgi \
+       DESTDIR=$RPM_BUILD_ROOT
 
-%preun client
-/etc/rc.d/init.d/ups stop
+install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ups
+install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ups
+install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/upsmon
 
-%postun
-echo "You may want to chown root:tty /dev/ttyS#, where # is the \n"
-echo "number of the serial port that the UPS was connected to... \n"
+rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/*
+install conf/*.users conf/*.conf conf/*.html $RPM_BUILD_ROOT%{_sysconfdir}
 
-%postun client
-/sbin/chkconfig --del ups
+install clients/upsclient.o $RPM_BUILD_ROOT%{_libdir}
+install clients/upsclient.h $RPM_BUILD_ROOT%{_includedir}
 
-%post client
-/sbin/chkconfig --add ups
+cat > $RPM_BUILD_ROOT/sbin/poweroff-ups << EOF
+#!/bin/sh
+/etc/rc.d/init.d/ups powerdown
+EOF
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%post
+/sbin/chkconfig --add ups
+if [ -f /var/lock/subsys/ups ]; then
+       /etc/rc.d/init.d/ups restart >&2
+else
+       echo "Run \"/etc/rc.d/init.d/ups start\" to start NUT ups daemon."
+fi
+
+%post client
+/sbin/chkconfig --add upsmon
+if [ -f /var/lock/subsys/upsmon ]; then
+       /etc/rc.d/init.d/upsmon restart >&2
+else
+       echo "Run \"/etc/rc.d/init.d/upsmon start\" to start NUT upsmon daemon."
+fi
+
+%preun
+if [ "$1" = "0" ]; then
+       if [ -f /var/lock/subsys/ups ]; then
+               /etc/rc.d/init.d/ups stop >&2
+       fi
+       /sbin/chkconfig --del ups
+fi
+
+%preun client
+if [ "$1" = "0" ]; then
+       if [ -f /var/lock/subsys/upsmon ]; then
+               /etc/rc.d/init.d/upsmon stop >&2
+       fi
+       /sbin/chkconfig --del upsmon
+fi
+
 %files
 %defattr(644,root,root,755)
-%doc CREDITS Changes QUICKSTART README docs
-%attr(755,root,root) %{_bindir}/apcsmart
-%attr(755,root,root) %{_bindir}/bestups
-%attr(755,root,root) %{_bindir}/fentonups
-%attr(755,root,root) %{_bindir}/genericups
-%attr(755,root,root) %{_bindir}/optiups
-%attr(755,root,root) %{_bindir}/ups-trust425+625
-%attr(755,root,root) %{_bindir}/upsd
+%doc NEWS README CHANGES CREDITS docs
+%attr(755,root,root) %{_bindir}/upscmd
 %attr(755,root,root) %{_bindir}/upslog
+%attr(755,root,root) %{_bindir}/upsrw
+%attr(755,root,root) %{_sbindir}/upsd
+%attr(755,root,root) /sbin/poweroff-ups
+%config(noreplace) /etc/sysconfig/ups
+%attr(754,root,root) /etc/rc.d/init.d/ups
+%dir %{_sysconfdir}
+%attr(640,root,root) %config(noreplace) %{_sysconfdir}/upsd.conf
+%attr(640,root,nobody) %config(noreplace) %{_sysconfdir}/ups.conf
+%attr(640,root,root) %config(noreplace) %{_sysconfdir}/upsd.users
+%{_mandir}/man5/*
+%{_mandir}/man8/*
+%dir %attr(750,nobody,root) /var/lib/ups
+%dir %attr(755,root,root) %{_libdir}/nut
+%attr(755,root,root) %{_libdir}/nut/*
 
 %files client
 %defattr(644,root,root,755)
-%config(noreplace) %{_sysconfdir}/hosts.conf
-%config(noreplace) %{_sysconfdir}/multimon.conf
-%attr(600,root,root) %config(noreplace) %{_sysconfdir}/upsd.conf
-%attr(600,root,root) %config(noreplace) %{_sysconfdir}/upsmon.conf
-%attr(644,root,root) %config(noreplace) /etc/sysconfig/ups
-%attr(754,root,root) /etc/rc.d/init.d/ups
 %attr(755,root,root) %{_bindir}/upsc
-%attr(755,root,root) %{_bindir}/upsct
-%attr(755,root,root) %{_bindir}/upsct2
-%attr(755,root,root) %{_bindir}/upsmon
-%dir %attr(775,root,nobody) /var/lib/ups
+%attr(755,root,root) %{_sbindir}/upsmon
+%attr(755,root,root) %{_sbindir}/upssched
+%attr(755,root,root) %{_sbindir}/upssched-cmd
+%attr(754,root,root) /etc/rc.d/init.d/upsmon
+%dir %{_sysconfdir}
+%attr(600,root,root) %config(noreplace) %{_sysconfdir}/upsmon.conf
+%attr(600,root,root) %config(noreplace) %{_sysconfdir}/upssched.conf
 
 %files cgi
 %defattr(644,root,root,755)
-%doc CREDITS Changes QUICKSTART README docs
-/home/httpd/cgi-bin/cgi-bin/multimon.cgi
-/home/httpd/cgi-bin/upsimage.cgi
-/home/httpd/cgi-bin/upsset.cgi
-/home/httpd/cgi-bin/upsstats.cgi
-%attr(600,root,root) %config(noreplace) %{_sysconfdir}/upsset.passwd
+%attr(755,root,root) /home/services/httpd/cgi-bin/*.cgi
+%dir %{_sysconfdir}
+%config(noreplace) %{_sysconfdir}/hosts.conf
+%config(noreplace) %{_sysconfdir}/upsset.conf
+%config(noreplace) %{_sysconfdir}/*.html
+
+%files devel
+%defattr(644,root,root,755)
+%{_libdir}/upsclient.o
+%{_includedir}/upsclient.h
This page took 0.036407 seconds and 4 git commands to generate.