]> git.pld-linux.org Git - packages/nut.git/blobdiff - nut.spec
- added /sbin/poweroff-ups
[packages/nut.git] / nut.spec
index 3ddadc39f73b58dfff9c6bc5d522b25f73fed5c9..c51a8c636d8db585bf12e486ae56ead5cfea724a 100644 (file)
--- a/nut.spec
+++ b/nut.spec
@@ -1,23 +1,27 @@
 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.45.1
+Version:       1.2.1
 Release:       1
 License:       GPL
 Group:         Applications/System
-Group(de):     Applikationen/System
-Group(pl):     Aplikacje/System
-Source0:       http://www.exploits.org/nut/release/%{name}-%{version}.tar.gz
-Source1:       ups.init
-Patch0:                %{name}-DESTDIR.patch
-Patch1:                %{name}-client.patch
-Patch2:                %{name}-lookup_for_libgd_ac_fix.patch
+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/
 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
 
@@ -28,57 +32,141 @@ 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
+Summary(pl):   Narzêdzia klienckie do monitorowania UPS-ów
+Summary(uk):   Network UPS Tools - Ë̦¤ÎÔÓØ˦ ÕÔÉ̦ÔÉ ÍÏΦÔÏÒÉÎÇÕ
+Summary(ru):   Network UPS Tools - ËÌÉÅÎÔÓËÉÅ ÕÔÉÌÉÔÙ ÍÏÎÉÔÏÒÉÎÇÁ
 Group:         Applications/System
-Group(de):     Applikationen/System
-Group(pl):     Aplikacje/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
+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
+Summary(pl):   Narzêdzia CGI do monitorowania UPS-ów
+Summary(ru):   Network UPS Tools - CGI ÕÔÉÌÉÔÙ
+Summary(uk):   Network UPS Tools - CGI ÕÔÉ̦ÔÉ
 Group:         Applications/System
-Group(de):     Applikationen/System
-Group(pl):     Aplikacje/System
-Requires:      %{name} = %{version}
 
 %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.
+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
-%patch1 -p1
-%patch2 -p1
 
 %build
-autoconf
+%{__aclocal}
+%{__autoconf}
 %configure \
-       --with-statepath=/var/lib/ups \
-       --with-uid=99 \
-       --with-gid=99
+       --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}
+install -d $RPM_BUILD_ROOT/{sbin,etc/{sysconfig,rc.d/init.d},/var/lib/ups} \
+       $RPM_BUILD_ROOT{%{_libdir}/nut,%{_includedir}}
 
 %{__make} install install-cgi \
-       DESTDIR=$RPM_BUILD_ROOT \
-       CGIPATH=/home/httpd/cgi-bin
+       DESTDIR=$RPM_BUILD_ROOT
 
-install scripts/RedHat-6.0/ups-config $RPM_BUILD_ROOT/etc/sysconfig/ups
 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
+
+rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/*
+install conf/*.users conf/*.conf conf/*.html $RPM_BUILD_ROOT%{_sysconfdir}
 
-gzip -9nf CREDITS README docs/{FAQ,Changes*,*.txt,cables/*}
+install clients/upsclient.o $RPM_BUILD_ROOT%{_libdir}
+install clients/upsclient.h $RPM_BUILD_ROOT%{_includedir}
+
+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
@@ -88,6 +176,14 @@ 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
@@ -96,63 +192,54 @@ if [ "$1" = "0" ]; then
        /sbin/chkconfig --del ups
 fi
 
-%clean
-rm -rf $RPM_BUILD_ROOT
+%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 *.gz docs/{,cables}/*.gz
-
-%attr(755,root,root) %{_bindir}/aeg
-%attr(755,root,root) %{_bindir}/apcsmart
-%attr(755,root,root) %{_bindir}/belkin
-%attr(755,root,root) %{_bindir}/bestfort
-%attr(755,root,root) %{_bindir}/bestuferrups
-%attr(755,root,root) %{_bindir}/bestups
-%attr(755,root,root) %{_bindir}/engetron
-%attr(755,root,root) %{_bindir}/everups
-%attr(755,root,root) %{_bindir}/fentonups
-%attr(755,root,root) %{_bindir}/genericups
-%attr(755,root,root) %{_bindir}/ipt-anzen
-%attr(755,root,root) %{_bindir}/mge-ellipse
-%attr(755,root,root) %{_bindir}/mgeups
-%attr(755,root,root) %{_bindir}/multilink
-%attr(755,root,root) %{_bindir}/mustekups
-%attr(755,root,root) %{_bindir}/newapc
-%attr(755,root,root) %{_bindir}/optiups
-%attr(755,root,root) %{_bindir}/powercom
-%attr(755,root,root) %{_bindir}/sec
-%attr(755,root,root) %{_bindir}/sms
-%attr(755,root,root) %{_bindir}/toshiba1500
-%attr(755,root,root) %{_bindir}/upsc
+%doc NEWS README CHANGES CREDITS docs
 %attr(755,root,root) %{_bindir}/upscmd
-%attr(755,root,root) %{_bindir}/upsct
-%attr(755,root,root) %{_bindir}/upsct2
-%attr(755,root,root) %{_bindir}/upsdrvctl
-%attr(755,root,root) %{_bindir}/upseyeux
-%attr(755,root,root) %{_bindir}/ups-trust425+625
-
-%attr(755,root,root) %{_sbindir}/upsd
 %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
-%attr(600,root,root) %config(noreplace) %{_sysconfdir}/upsd.conf
+%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(775,root,nobody) /var/lib/ups
+%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)
 %attr(755,root,root) %{_bindir}/upsc
-%attr(755,root,root) %{_bindir}/upsct
-%attr(755,root,root) %{_bindir}/upsct2
 %attr(755,root,root) %{_sbindir}/upsmon
 %attr(755,root,root) %{_sbindir}/upssched
 %attr(755,root,root) %{_sbindir}/upssched-cmd
-%config(noreplace) %{_sysconfdir}/hosts.conf
-%config(noreplace) %{_sysconfdir}/multimon.conf
+%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)
-%attr(755,root,root) /home/httpd/cgi-bin/*.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.100785 seconds and 4 git commands to generate.