From 0750536218ac803b137d1bee60363cfd229a832e Mon Sep 17 00:00:00 2001 From: cvsdist Date: Sep 09 2004 09:22:07 +0000 Subject: auto-import changelog data from nut-1.4.0-3.src.rpm Wed Sep 24 2003 Mike McLean 1.4.0-3 - fixed 'nut' user problem with nut-cgi (bug#104872) Mon Sep 15 2003 Than Ngo 1.4.0-2 - added missing hidups driver (bug #104412) Tue Sep 09 2003 Than Ngo 1.4.0-1 - 1.4.0 - fixed permission problem (bug #103023) - fixed rpm file list (bug #90848) - added support multiple drivers, thanks to Gilbert E. Detillieux (bug #79465) Thu Jun 26 2003 Than Ngo 1.2.2-3 - Add variable to ups sysconfig file for upsd (bug #97900) Wed Jun 04 2003 Elliot Lee - rebuilt Wed May 07 2003 Than Ngo 1.2.2-1 - 1.2.2 Tue May 06 2003 Phil Knirsch 1.2.0-7 - Bumped release and rebuilt because of new gd version. --- diff --git a/.cvsignore b/.cvsignore index 5933de0..43b0c19 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -nut-1.2.0.tar.gz +nut-1.4.0.tar.gz diff --git a/nut-1.4.0-buildroot.patch b/nut-1.4.0-buildroot.patch new file mode 100644 index 0000000..3f905d5 --- /dev/null +++ b/nut-1.4.0-buildroot.patch @@ -0,0 +1,22 @@ +--- nut-1.4.0/clients/Makefile.in.orig 2003-09-09 15:02:46.000000000 +0200 ++++ nut-1.4.0/clients/Makefile.in 2003-09-09 15:03:57.000000000 +0200 +@@ -16,7 +16,7 @@ + CC = @CC@ + CFLAGS = -I../include @CFLAGS@ + PROGS = upsc upslog upsrw upscmd +-SPROGS = upsmon upssched ++SPROGS = upsmon upssched upssched-cmd + CGIPROGS = upsstats.cgi upsimage.cgi upsset.cgi + LIBDEP = @LIBOBJ@ + LIBOBJ = $(LIBDEP) @NETLIBS@ +--- nut-1.4.0/Makefile.in.orig 2003-09-09 15:04:06.000000000 +0200 ++++ nut-1.4.0/Makefile.in 2003-09-09 15:05:39.000000000 +0200 +@@ -6,7 +6,7 @@ + + BINDIR = $(DESTDIR)@bindir@ + SBINDIR = $(DESTDIR)@sbindir@ +-CONFPATH = $(DESTDIR)@sysconfdir@ ++CONFPATH = $(DESTDIR)@sysconfdir@/ups + CGIPATH = $(DESTDIR)@CGIPATH@ + DRVPATH = $(DESTDIR)@DRVPATH@ + diff --git a/nut.spec b/nut.spec index cd2a088..ae65217 100644 --- a/nut.spec +++ b/nut.spec @@ -5,10 +5,12 @@ %define cgidir /var/www/nut-cgi-bin %define modeldir /sbin +%define devel 0 + Summary: Network UPS Tools Name: nut -Version: 1.2.0 -Release: 6 +Version: 1.4.0 +Release: 3 Group: Applications/System License: GPL BuildRoot: %{_tmppath}/%{name}-%{version}-root @@ -17,7 +19,7 @@ Source: http://www.exploits.org/nut/release/%{name}-%{version}.tar.gz Source1: ups.init Source2: ups.sysconfig -Patch0: nut-1.2.0-buildroot.patch +Patch0: nut-1.4.0-buildroot.patch Patch1: nut-0.45.0-conffiles.patch Patch2: nut-0.45.4-conf.patch @@ -58,42 +60,48 @@ Requires: webserver %description cgi This package includes CGI programs for accessing UPS status via a web browser. + +%package devel +Group: Development/Libraries +Summary: Development files for NUT Client +Requires: webserver + +%description devel +This package contains the development header files and libraries +necessary to develop NUT client applications. %prep %setup -q -# remove chown /var/lib/state so that we don't have to build rpms as root. %patch0 -p1 -b .buildroot %patch1 -p1 -b .conf %patch2 -p1 -b .conf1 %build %configure \ - --with-cgi \ --with-user=%{name} \ --with-group=uucp \ --with-statepath=%{_localstatedir}/lib/ups \ --sysconfdir=%{_sysconfdir}/ups \ --with-cgipath=%{cgidir} \ --with-drvpath=%{modeldir} \ + --with-cgi \ + --with-gd-libs \ --with-linux-hiddev=/usr/include/linux/hiddev.h -make -make -C drivers hidups +make %{?smp_mflags} +make %{?smp_mflags} -C drivers hidups %install rm -rf %{buildroot} -mkdir -p %{buildroot}%{modeldir} -make install install-cgi DESTDIR=%{buildroot} -install -m 755 drivers/hidups %{buildroot}%{modeldir}/hidups +mkdir -p %{buildroot}%{modeldir} \ + %{buildroot}%{_sysconfdir}/sysconfig \ + %{buildroot}%{_localstatedir}/lib/ups \ + %{buildroot}%{initdir} -mkdir -p %{buildroot}%{_sysconfdir}/sysconfig +make install install-cgi install-misc DESTDIR=%{buildroot} +install -m 755 drivers/hidups %{buildroot}%{modeldir}/hidups install -m 755 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/ups - -mkdir -p %{buildroot}%{_localstatedir}/lib/ups - -# install SYSV init stuff -mkdir -p %{buildroot}%{initdir} install -m 755 %{SOURCE1} %{buildroot}%{initdir}/ups # rename @@ -102,6 +110,12 @@ do mv $file %{buildroot}%{_sysconfdir}/ups/`basename $file .sample` done +%if !%{devel} +rm -rf %{buildroot}%{_includedir} \ + %{buildroot}%{_mandir}/man3/upscli_* \ + %{buildroot}%{_libdir}/upsclient.o +%endif + %pre /usr/sbin/useradd -c "Network UPS Tools" -u %{nut_uid} -G uucp \ -s /bin/false -r -d %{_localstatedir}/lib/ups %{name} 2> /dev/null || : @@ -110,6 +124,10 @@ done /usr/sbin/useradd -c "Network UPS Tools" -u %{nut_uid} -G uucp \ -s /bin/false -r -d %{_localstatedir}/lib/ups %{name} 2> /dev/null || : +%pre cgi +/usr/sbin/useradd -c "Network UPS Tools" -u %{nut_uid} -G uucp \ + -s /bin/false -r -d %{_localstatedir}/lib/ups %{name} 2> /dev/null || : + %post client /sbin/chkconfig --add ups @@ -130,39 +148,111 @@ rm -rf %{buildroot} %files %defattr(-,root,root) %doc COPYING CREDITS CHANGES README docs +%config(noreplace) %attr(444,root,root) %{_sysconfdir}/ups/ups.conf +%config(noreplace) %attr(444,root,root) %{_sysconfdir}/ups/upsd.conf +%config(noreplace) %attr(400,root,root) %{_sysconfdir}/ups/upsd.users %config(noreplace) %attr(644,root,root) %{_sysconfdir}/sysconfig/ups %{modeldir}/* %{_sbindir}/upsd %{_bindir}/upslog -%{_mandir}/man8/* +%{_datadir}/cmdvartab +%{_mandir}/man5/ups.conf.5.gz +%{_mandir}/man5/upsd.conf.5.gz +%{_mandir}/man5/upsd.users.5.gz +%{_mandir}/man8/apcsmart.8.gz +%{_mandir}/man8/bcmxcp.8.gz +%{_mandir}/man8/belkin.8.gz +%{_mandir}/man8/bestups.8.gz +%{_mandir}/man8/bestferrups801-807.8.gz +%{_mandir}/man8/bestfortress.8.gz +%{_mandir}/man8/bestuferrups.8.gz +%{_mandir}/man8/cyberpower.8.gz +%{_mandir}/man8/everups.8.gz +%{_mandir}/man8/etapro.8.gz +%{_mandir}/man8/fentonups.8.gz +%{_mandir}/man8/genericups.8.gz +%{_mandir}/man8/hp.8.gz +%{_mandir}/man8/isbmex.8.gz +%{_mandir}/man8/liebert.8.gz +%{_mandir}/man8/masterguard.8.gz +%{_mandir}/man8/mge-utalk.8.gz +%{_mandir}/man8/microdowell.8.gz +%{_mandir}/man8/newapc.8.gz +%{_mandir}/man8/nutupsdrv.8.gz +%{_mandir}/man8/oneac.8.gz +%{_mandir}/man8/powercom.8.gz +%{_mandir}/man8/powernet.8.gz +%{_mandir}/man8/sec.8.gz +%{_mandir}/man8/sms.8.gz +%{_mandir}/man8/snmp-ups.8.gz +%{_mandir}/man8/tripplite.8.gz +%{_mandir}/man8/tripplitesu.8.gz +%{_mandir}/man8/victronups.8.gz +%{_mandir}/man8/upsd.8.gz +%{_mandir}/man8/upsdrvctl.8.gz +%{_mandir}/man8/mge-shut.8.gz %files client %defattr(-,root,root) %attr(755,root,root) %{initdir}/ups -%config(noreplace) %{_sysconfdir}/ups/hosts.conf %dir %{_sysconfdir}/ups -%config(noreplace) %attr(600,root,root) %{_sysconfdir}/ups/ups.conf -%config(noreplace) %attr(600,root,root) %{_sysconfdir}/ups/upsd.conf -%config(noreplace) %attr(600,root,root) %{_sysconfdir}/ups/upsd.users -%config(noreplace) %attr(600,root,root) %{_sysconfdir}/ups/upsmon.conf -%config(noreplace) %attr(600,root,root) %{_sysconfdir}/ups/upsset.conf -%config(noreplace) %attr(600,root,root) %{_sysconfdir}/ups/upssched.conf -%dir %attr(700,nut,nut) %{_localstatedir}/lib/ups +%config(noreplace) %attr(400,nut,nut) %{_sysconfdir}/ups/upsmon.conf +%config(noreplace) %attr(400,nut,nut) %{_sysconfdir}/ups/upssched.conf +%dir %attr(750,nut,nut) %{_localstatedir}/lib/ups %{_bindir}/upsc %{_bindir}/upscmd %{_bindir}/upsrw %{_sbindir}/upsmon %{_sbindir}/upssched %{_sbindir}/upssched-cmd -%{_mandir}/man5/* +%{_mandir}/man5/upsmon.conf.5.gz +%{_mandir}/man5/upssched.conf.5.gz +%{_mandir}/man8/upsc.8.gz +%{_mandir}/man8/upscmd.8.gz +%{_mandir}/man8/upsrw.8.gz +%{_mandir}/man8/upslog.8.gz +%{_mandir}/man8/upsmon.8.gz +%{_mandir}/man8/upssched.8.gz %files cgi %defattr(-,root,root) +%config(noreplace) %attr(644,root,root) %{_sysconfdir}/ups/hosts.conf +%config(noreplace) %attr(600,nut,root) %{_sysconfdir}/ups/upsset.conf %config(noreplace) %attr(644,root,root) %{_sysconfdir}/ups/upsstats.html %config(noreplace) %attr(644,root,root) %{_sysconfdir}/ups/upsstats-single.html %{cgidir}/* +%{_mandir}/man5/hosts.conf.5.gz +%{_mandir}/man5/upsstats.html.5.gz +%{_mandir}/man5/upsset.conf.5.gz +%{_mandir}/man8/upsimage.cgi.8.gz +%{_mandir}/man8/upsstats.cgi.8.gz +%{_mandir}/man8/upsset.cgi.8.gz %changelog +* Wed Sep 24 2003 Mike McLean 1.4.0-3 +- fixed 'nut' user problem with nut-cgi (bug#104872) + +* Mon Sep 15 2003 Than Ngo 1.4.0-2 +- added missing hidups driver (bug #104412) + +* Tue Sep 09 2003 Than Ngo 1.4.0-1 +- 1.4.0 +- fixed permission problem (bug #103023) +- fixed rpm file list (bug #90848) +- added support multiple drivers, thanks to Gilbert E. Detillieux (bug #79465) + +* Thu Jun 26 2003 Than Ngo 1.2.2-3 +- Add variable to ups sysconfig file for upsd (bug #97900) + +* Wed Jun 04 2003 Elliot Lee +- rebuilt + +* Wed May 7 2003 Than Ngo 1.2.2-1 +- 1.2.2 + +* Tue May 06 2003 Phil Knirsch 1.2.0-7 +- Bumped release and rebuilt because of new gd version. + * Thu Feb 13 2003 Than Ngo 1.2.0-6 - build with correct userid #84199 - fix directory permission @@ -235,7 +325,7 @@ rm -rf %{buildroot} * Fri Feb 9 2001 Than Ngo - fixed typo (Bug #26535) -* Tue Feb 6 2001 Trond Eivind Glomsr�d +* Tue Feb 6 2001 Trond Eivind Glomsrd - Fix some of the i18n - make it exit cleanly if not configured diff --git a/sources b/sources index 1af8a72..ebdee72 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -06c76b6ec45525f05351afd819bee158 nut-1.2.0.tar.gz +1ddf547866db0f1eeb9c535ba0339906 nut-1.4.0.tar.gz diff --git a/ups.init b/ups.init index ea9207e..03f0c6a 100644 --- a/ups.init +++ b/ups.init @@ -1,4 +1,4 @@ -#!/bin/bash +#! /bin/bash # # chkconfig: - 26 74 # description: Network UPS Tools is a collection of programs which provide a common \ @@ -9,11 +9,11 @@ # Source function library. if [ -f /etc/init.d/functions ]; then - . /etc/init.d/functions + . /etc/init.d/functions elif [ -f /etc/rc.d/init.d/functions ]; then - . /etc/rc.d/init.d/functions + . /etc/rc.d/init.d/functions else - exit 0 + exit 0 fi # Get config. @@ -32,12 +32,16 @@ start() { fi echo -n $"Starting $MODEL: " - daemon /sbin/$MODEL $OPTIONS $DEVICE + if [ "$MODEL" = "upsdrvctl" ]; then + daemon /sbin/upsdrvctl start + else + daemon /sbin/$MODEL $OPTIONS $DEVICE + fi echo prog="upsd" echo -n $"Starting $prog: " - daemon /usr/sbin/upsd + daemon /usr/sbin/upsd $UPSD_OPTIONS RETVAL=$? echo @@ -54,22 +58,26 @@ start() { } stop() { - echo -n $"Stopping UPS monitor: " - killproc upsmon - echo - - if [ "$SERVER" = "yes" ]; then - prog="upsd" - echo -n $"Stopping $prog: " - killproc upsd - RETVAL=$? + echo -n $"Stopping UPS monitor: " + killproc upsmon echo - echo -n $"Shutting down $MODEL: " - killproc $MODEL - echo - fi - [ "$RETVAL" = 0 ] && rm -f /var/lock/subsys/ups + if [ "$SERVER" = "yes" ]; then + prog="upsd" + echo -n $"Stopping $prog: " + killproc upsd + RETVAL=$? + echo + + echo -n $"Shutting down $MODEL: " + if [ "$MODEL" = "upsdrvctl" ]; then + /sbin/upsdrvctl stop + else + killproc $MODEL + fi + echo + fi + [ "$RETVAL" = 0 ] && rm -f /var/lock/subsys/ups } restart() { @@ -79,28 +87,34 @@ restart() { # See how we are called. case "$1" in - start) - start - ;; - stop) - stop - ;; - restart) - restart - ;; - condrestart) - [ -f /var/lock/subsys/ups ] && restart || : - ;; - status) - if [ "$HOST" = "localhost" ]; then - status upsd - status $MODEL - fi - status upsmon - ;; - *) - echo $"Usage: $0 {start|stop|restart|condrestart|status}" - exit 1 + start) + start ;; + + stop) + stop ;; + + restart) + restart ;; + + condrestart) + [ -f /var/lock/subsys/ups ] && restart || : + ;; + + status) + if [ "$SERVER" = "yes" ]; then + if [ "$MODEL" = "upsdrvctl" ]; then + /sbin/upsdrvctl -v status + else + status $MODEL + fi + status upsd + fi + status upsmon + ;; + + *) + echo $"Usage: $0 {start|stop|restart|condrestart|status}" + exit 1 esac exit $RETVAL diff --git a/ups.sysconfig b/ups.sysconfig index cb0ee8a..8dfacb9 100644 --- a/ups.sysconfig +++ b/ups.sysconfig @@ -8,7 +8,9 @@ SERVER=yes # bestups # genericups # ups-trust425+625 +# upsdrvctl # You MUST change this, or set SERVER to "no" +# To support multiple drivers, set MODEL=upsdrvctl MODEL=NONE # UPS device - needed if UPS is locally attached DEVICE=/dev/ttyS0 @@ -16,5 +18,7 @@ DEVICE=/dev/ttyS0 # ex. for my TrippLite UPS, use # OPTIONS="-t 5" OPTIONS= +# Any options to pass to upsd +UPSD_OPTIONS= # # [End]