Imported Debian patch 2.4.3-1

This commit is contained in:
Arnaud Quette 2010-02-24 22:58:53 +01:00 committed by arnaud.quette@free.fr
parent 26fb71b504
commit 31a319d731
47 changed files with 3098 additions and 0 deletions

8
debian/Makefile.am vendored Normal file
View File

@ -0,0 +1,8 @@
EXTRA_DIST = changelog control copyright description.subst hotplug \
nut-cgi.config nut-cgi.docs nut-cgi.examples nut-cgi.postinst nut-cgi.postrm \
nut-cgi.preinst nut-cgi.README.Debian nut-cgi.templates nut.config \
nut.default nut.dirs nut.docs nut.examples nut-hal-drivers.docs \
nut.init nut.links nut.postinst nut.postrm nut.preinst nut.prerm \
nut.README.Debian nut.templates nut.TODO.Debian \
rules watch po/ca.po po/cs.po po/de.po po/fr.po po/POTFILES.in \
po/pt.po po/pt_BR.po po/templates.pot po/vi.po

381
debian/Makefile.in vendored Normal file
View File

@ -0,0 +1,381 @@
# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = packaging/debian
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_create_stdint_h.m4 \
$(top_srcdir)/m4/nut_arg_with.m4 \
$(top_srcdir)/m4/nut_check_hiddev.m4 \
$(top_srcdir)/m4/nut_check_ipv6.m4 \
$(top_srcdir)/m4/nut_check_libgd.m4 \
$(top_srcdir)/m4/nut_check_libhal.m4 \
$(top_srcdir)/m4/nut_check_libneon.m4 \
$(top_srcdir)/m4/nut_check_libnetsnmp.m4 \
$(top_srcdir)/m4/nut_check_libssl.m4 \
$(top_srcdir)/m4/nut_check_libusb.m4 \
$(top_srcdir)/m4/nut_report_feature.m4 \
$(top_srcdir)/m4/nut_type_socklen_t.m4 \
$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/include/config.h
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CONFPATH = @CONFPATH@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DRIVER_BUILD_LIST = @DRIVER_BUILD_LIST@
DRIVER_INSTALL_TARGET = @DRIVER_INSTALL_TARGET@
DRIVER_MAN_LIST = @DRIVER_MAN_LIST@
DSYMUTIL = @DSYMUTIL@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
GREP = @GREP@
HAL_CALLOUTS_PATH = @HAL_CALLOUTS_PATH@
HAL_FDI_PATH = @HAL_FDI_PATH@
HAL_USER = @HAL_USER@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBGD_CFLAGS = @LIBGD_CFLAGS@
LIBGD_LDFLAGS = @LIBGD_LDFLAGS@
LIBHAL_CFLAGS = @LIBHAL_CFLAGS@
LIBHAL_LDFLAGS = @LIBHAL_LDFLAGS@
LIBNEON_CFLAGS = @LIBNEON_CFLAGS@
LIBNEON_LDFLAGS = @LIBNEON_LDFLAGS@
LIBNETSNMP_CFLAGS = @LIBNETSNMP_CFLAGS@
LIBNETSNMP_LDFLAGS = @LIBNETSNMP_LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBSSL_CFLAGS = @LIBSSL_CFLAGS@
LIBSSL_LDFLAGS = @LIBSSL_LDFLAGS@
LIBTOOL = @LIBTOOL@
LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
LIBUSB_LDFLAGS = @LIBUSB_LDFLAGS@
LINUX_HIDDEV = @LINUX_HIDDEV@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
NETLIBS = @NETLIBS@
NMEDIT = @NMEDIT@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
RUN_AS_GROUP = @RUN_AS_GROUP@
RUN_AS_USER = @RUN_AS_USER@
SED = @SED@
SERLIBS = @SERLIBS@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STATEPATH = @STATEPATH@
STRIP = @STRIP@
SUN_LIBUSB = @SUN_LIBUSB@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
cgiexecdir = @cgiexecdir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
driverexecdir = @driverexecdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
hotplugdir = @hotplugdir@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
pkgconfigdir = @pkgconfigdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
udevdir = @udevdir@
EXTRA_DIST = changelog control copyright description.subst hotplug \
nut-cgi.config nut-cgi.docs nut-cgi.examples nut-cgi.postinst nut-cgi.postrm \
nut-cgi.preinst nut-cgi.README.Debian nut-cgi.templates nut.config \
nut.default nut.dirs nut.docs nut.examples nut-hal-drivers.docs \
nut.init nut.links nut.postinst nut.postrm nut.preinst nut.prerm \
nut.README.Debian nut.templates nut.TODO.Debian \
rules watch po/ca.po po/cs.po po/de.po po/fr.po po/POTFILES.in \
po/pt.po po/pt_BR.po po/templates.pot po/vi.po
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu packaging/debian/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu packaging/debian/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-exec-am:
install-html: install-html-am
install-info: install-info-am
install-man:
install-pdf: install-pdf-am
install-ps: install-ps-am
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am:
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
distclean distclean-generic distclean-libtool distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

1307
debian/changelog vendored Normal file

File diff suppressed because it is too large Load Diff

1
debian/compat vendored Normal file
View File

@ -0,0 +1 @@
6

130
debian/control vendored Normal file
View File

@ -0,0 +1,130 @@
Source: nut
Section: admin
Priority: optional
Maintainer: Arnaud Quette <aquette@debian.org>
Build-Depends: debhelper (>= 7), autoconf, automake, libtool, libgd2-xpm-dev | libgd2-noxpm-dev, libsnmp-dev | libsnmp9-dev, libusb-dev (>= 0.1.8), libhal-dev (>= 0.5.8), hal, libdbus-1-dev, libdbus-glib-1-dev, libglib2.0-dev, libneon27-gnutls-dev | libneon26-gnutls-dev | libneon-dev | libneon27-dev | libneon26-dev, libpowerman0-dev (>= 2.3.3), libwrap0-dev (>= 7.6)
Standards-Version: 3.8.4
Homepage: http://www.networkupstools.org
Vcs-Browser: http://svn.debian.org/wsvn/nut
Vcs-Svn: svn://svn.debian.org/nut/trunk
Package: nut
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, lsb-base (>= 3.0-6), ${udev}
Recommends: bash-completion
Suggests: nut-cgi, nut-snmp, nut-dev, nut-xml
Provides: ups-monitor, nut-doc, nut-usb
Conflicts: ups-monitor, nut-doc, nut-hal-drivers, nut-usb (<< 2.1.0-3), nut-dev (<< 2.2.2)
Replaces: nut-doc
Description: network UPS tools - core system
Network UPS Tools (NUT) is a client/server monitoring system that
allows computers to share uninterruptible power supply (UPS) and
power distribution unit (PDU) hardware. Clients access the hardware
through the server, and are notified whenever the power status
changes.
.
This package provides NUT's core system, and the serial and USB UPS
drivers. In most cases it is sufficient for a basic UPS monitoring
system.
Package: nut-cgi
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, adduser
Recommends: apache | httpd
Suggests: nut
Replaces: nut (<< 1.1.11)
Description: network UPS tools - web interface
Network UPS Tools (NUT) is a client/server monitoring system that
allows computers to share uninterruptible power supply (UPS) and
power distribution unit (PDU) hardware. Clients access the hardware
through the server, and are notified whenever the power status
changes.
.
This package provides an HTTP interface for Network UPS Tools which makes
it possible to monitor the core NUT system with a web browser.
Package: nut-snmp
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, nut (>= 1.4.1-pre1)
Conflicts: nut (<= 1.4.0)
Description: network UPS tools - SNMP driver
Network UPS Tools (NUT) is a client/server monitoring system that
allows computers to share uninterruptible power supply (UPS) and
power distribution unit (PDU) hardware. Clients access the hardware
through the server, and are notified whenever the power status
changes.
.
This package provides snmp-ups, the SNMP multi-MIB driver for UPS, which
supports various MIBs including IETF, MGE, and APC. It adds an SNMP
Manager interface to the core NUT system.
Package: nut-hal-drivers
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, ${udev}
Conflicts: nut
Provides: hal-ups-support
Breaks: udev (<< 124-1)
Description: network UPS tools - HAL interface
Network UPS Tools (NUT) is a client/server monitoring system that
allows computers to share uninterruptible power supply (UPS) and
power distribution unit (PDU) hardware. Clients access the hardware
through the server, and are notified whenever the power status
changes.
.
This package provides add-ons for the hardware abstraction layer (HAL) that
allow desktop environments to monitor locally-connected UPS equipment. The
HAL drivers cannot be used at the same time as the normal NUT upsd.
Package: nut-xml
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, nut (>= 2.2.2)
Description: network UPS tools - XML/HTTP driver
Network UPS Tools (NUT) is a client/server monitoring system that
allows computers to share uninterruptible power supply (UPS) and
power distribution unit (PDU) hardware. Clients access the hardware
through the server, and are notified whenever the power status
changes.
.
This package provides netxml-ups, which supports UPS models from
Eaton or MGE that use an XML/HTTP-based Network Management Card or
Proxy.
Package: nut-powerman-pdu
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, nut (>= 2.4.0), powerman (>= 2.3.3)
Description: network UPS tools - PowerMan PDU driver
Network UPS Tools (NUT) is a client/server monitoring system that
allows computers to share uninterruptible power supply (UPS) and
power distribution unit (PDU) hardware. Clients access the hardware
through the server, and are notified whenever the power status
changes.
.
This package provides powerman-pdu, which allows NUT clients to communicate
with the PowerMan daemon to support PDUs.
Package: libupsclient1
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: network UPS tools - client library
Network UPS Tools (NUT) is a client/server monitoring system that
allows computers to share uninterruptible power supply (UPS) and
power distribution unit (PDU) hardware. Clients access the hardware
through the server, and are notified whenever the power status
changes.
.
This package provides the shared client library.
Package: libupsclient1-dev
Section: libdevel
Architecture: any
Depends: libupsclient1 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
Provides: nut-dev
Conflicts: nut-dev (<< 2.2.2)
Description: network UPS tools - development files
Network UPS Tools (NUT) is a client/server monitoring system that
allows computers to share uninterruptible power supply (UPS) and
power distribution unit (PDU) hardware. Clients access the hardware
through the server, and are notified whenever the power status
changes.
.
This package provides the development files.

69
debian/copyright vendored Normal file
View File

@ -0,0 +1,69 @@
This package was debianized by Luca Filipozzi <lfilipoz@debian.org> on
Wed Jun 28 19:48:05 PDT 2000
It was downloaded from http://www.networkupstools.org/
Upstream Authors:
Russell Kroll <rkroll@exploits.org>
Arnaud Quette <http://arnaud.quette.free.fr/contact.html>
Arjen de Korte <arjen@de-korte.org>
Charles Lepple <clepple@gmail.com>
Kjell Claesson <kjell.claesson@epost.tidanet.se>
David Goncalves <david@lestat.st>
and the NUT Team
Copyright:
Copyright (C) 2000-2008 Russell Kroll, Arnaud Quette and the NUT Team
Licenses:
Most files are licensed under the GNU General Public License (GPL) version 2,
or (at your option) any later version.
The files in the scripts/python/ directory are released under GNU General
Public License (GPL) version 3, or (at your option) any later version.
GPL-2
-----
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
On Debian systems, the full text of the GNU General Public License v2
may be found in /usr/share/common-licenses/GPL-2.
GPL-3
-----
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
On Debian systems, the full text of the GNU General Public License v3
may be found in /usr/share/common-licenses/GPL-3.
The Debian packaging is (C) 2008, Arnaud Quette <aquette@debian.org> and
is licensed under the GPL, see `/usr/share/common-licenses/GPL'.

1
debian/description.subst vendored Normal file
View File

@ -0,0 +1 @@
description=nut is a client/server uninterruptible power supply (UPS) monitoring system${Newline}${Space}that permits the sharing of one (or more) UPS between several machines. The${Newline}${Space}'server' monitors the UPS and notifies the 'clients' when the UPS is on${Newline}${Space}battery or has a low battery.

24
debian/hotplug vendored Normal file
View File

@ -0,0 +1,24 @@
#!/bin/bash
# taken from libgphoto2
GROUP=nut
# for previous udev versions
if [ "$ACTION" = "add" ] && [ -f "$DEVICE" ]
then
# check if $GROUP really exists
if getent group $GROUP > /dev/null; then
chmod 660 "$DEVICE"
chown root:$GROUP "$DEVICE"
fi
fi
# for recent udev versions
if [ "$ACTION" = "add" ] && [ -r "$DEVNAME" ]
then
# check if $GROUP really exists
if getent group $GROUP > /dev/null; then
chmod 660 "$DEVNAME"
chown root:$GROUP "$DEVNAME"
fi
fi

1
debian/libupsclient1-dev.dirs vendored Normal file
View File

@ -0,0 +1 @@
/lib

5
debian/libupsclient1-dev.install vendored Normal file
View File

@ -0,0 +1,5 @@
debian/tmp/lib/libupsclient.so
debian/tmp/lib/libupsclient.a
debian/tmp/lib/libupsclient.la
debian/tmp/usr/lib/pkgconfig/
debian/tmp/usr/include

1
debian/libupsclient1-dev.links vendored Normal file
View File

@ -0,0 +1 @@
/lib/libupsclient.so.1.0.0 /usr/lib/libupsclient.so

1
debian/libupsclient1-dev.manpages vendored Normal file
View File

@ -0,0 +1 @@
debian/tmp/usr/share/man/man3/*.3

1
debian/libupsclient1.install vendored Normal file
View File

@ -0,0 +1 @@
debian/tmp/lib/libupsclient.so.*

29
debian/libupsclient1.postinst vendored Normal file
View File

@ -0,0 +1,29 @@
#!/bin/sh -e
case "$1" in
configure)
ldconfig
;;
abort-upgrade)
# do nothing
;;
abort-remove)
# do nothing
;;
abort-deconfigure)
# do nothing
;;
*)
echo "$0: incorrect arguments: $*" >&2
exit 1
;;
esac
#DEBHELPER#

41
debian/libupsclient1.postrm vendored Normal file
View File

@ -0,0 +1,41 @@
#!/bin/sh -e
case "$1" in
remove)
ldconfig
;;
purge)
# do nothing
;;
upgrade)
# do nothing
;;
failed-upgrade)
# do nothing
;;
abort-install)
# do nothing
;;
abort-upgrade)
# do nothing
;;
disappear)
# do nothing
;;
*)
echo "$0: incorrect arguments: $*" >&2
exit 1
;;
esac
#DEBHELPER#

39
debian/nut-cgi.README.Debian vendored Normal file
View File

@ -0,0 +1,39 @@
Network UPS Tools - CGI Interface - Quick Start for Debian
----------------------------------------------------------
(I) Installation
=================
1) Sample configuration files are provided in /etc/nut/
Rename without the ".sample" suffix the files hosts.conf, upsstats.html,
upsstats-single.html and optionaly upsset.conf.
Then edit these to match your configuration.
2) Ensure these configuration files are readable by others
chmod 755 /etc/nut
chmod 644 /etc/nut/upsset.conf
chmod 644 /etc/nut/hosts.conf
chmod 644 /etc/nut/upsstats.html
chmod 644 /etc/nut/upsstats-single.html
3) You will then be able to access NUT CGI through a Web browser.
The URL, which depends on your httpd configuration, is:
http://localhost/cgi-bin/nut/upsstats.cgi
4) NUT also provides a set of HTML files to wrap the CGIs.
To use it, create a new virtual host with your preferred webserver, and point the
Document Root to: /usr/share/nut/www/
You can also add an alias to an existing site, if it is supported:
Alias /nut/ "/usr/share/nut/www/"
Also ensure that the files in this directory have the suitable permissions.
For more information on nut-cgi configuration, have a look at the following
manual pages:
- upsstats.html (5)
- hosts.conf (5)
- upsset.conf (5)

1
debian/nut-cgi.docs vendored Normal file
View File

@ -0,0 +1 @@
data/html/README

6
debian/nut-cgi.install vendored Normal file
View File

@ -0,0 +1,6 @@
debian/tmp/etc/nut/hosts.conf
debian/tmp/etc/nut/upsset.conf
debian/tmp/etc/nut/upsstats.html
debian/tmp/etc/nut/upsstats-single.html
debian/tmp/usr/lib/cgi-bin/
debian/tmp/usr/share/nut/www

6
debian/nut-cgi.manpages vendored Normal file
View File

@ -0,0 +1,6 @@
debian/tmp/usr/share/man/man5/hosts.conf.5
debian/tmp/usr/share/man/man5/upsset.conf.5
debian/tmp/usr/share/man/man5/upsstats.html.5
debian/tmp/usr/share/man/man8/upsimage.cgi.8
debian/tmp/usr/share/man/man8/upsset.cgi.8
debian/tmp/usr/share/man/man8/upsstats.cgi.8

55
debian/nut-cgi.postinst vendored Normal file
View File

@ -0,0 +1,55 @@
#!/bin/sh -e
case "$1" in
configure)
# make sure the nut user exists and has correct memberships
if ! getent group nut >/dev/null; then
addgroup --quiet --system nut
fi
if ! getent passwd nut >/dev/null; then
adduser --quiet --system --ingroup nut --home /var/lib/nut --no-create-home nut
elif ! groups nut | grep -qw nut; then
adduser nut nut
fi
# for Ubuntu, while waiting for a proper debconf
# if ! groups nut | grep -qw dialout; then
# adduser nut dialout
# fi
# Ensure /etc/nut is readable/crossable for others
if [ -d /etc/nut/ ] ; then
chmod 755 /etc/nut
fi
# Ensure nut-cgi configuration files are readable by others
for file in upsset.conf hosts.conf upsstats.html upsstats-single.html ; do
if [ -f /etc/nut/$file ] ; then
chmod 644 /etc/nut/$file
fi
done
;;
abort-upgrade)
# do nothing
;;
abort-remove)
# do nothing
;;
abort-deconfigure)
# do nothing
;;
*)
echo "$0: incorrect arguments: $*" >&2
exit 1
;;
esac
#DEBHELPER#
exit 0

46
debian/nut-cgi.postrm vendored Normal file
View File

@ -0,0 +1,46 @@
#!/bin/sh -e
case "$1" in
remove)
# remove sample file if those were previously (wrongly) installed
for file in upsset.conf hosts.conf upsstats.html upsstats-single.html ; do
if [ -f /etc/nut/${file}.sample ] ; then
rm -f /etc/nut/${file}.sample
fi
done
;;
purge)
# do nothing
;;
upgrade)
# do nothing
;;
failed-upgrade)
# do nothing
;;
abort-install)
# do nothing
;;
abort-upgrade)
# do nothing
;;
disappear)
# do nothing
;;
*)
echo "$0: incorrect arguments: $*" >&2
exit 1
;;
esac
#DEBHELPER#

1
debian/nut-hal-drivers.docs vendored Normal file
View File

@ -0,0 +1 @@
docs/nut-hal.txt

3
debian/nut-hal-drivers.install vendored Normal file
View File

@ -0,0 +1,3 @@
debian/tmp/lib/hal/ /usr/lib/
debian/tmp/usr/share/hal
debian/tmp/*/udev/

24
debian/nut-hal-drivers.postinst vendored Normal file
View File

@ -0,0 +1,24 @@
#!/bin/sh
set -e
case "$1" in
configure)
# ask udev to check for new udev rules
[ -x /etc/init.d/udev ] && pidof udevd > /dev/null \
&& udevadm trigger --action=change
;;
abort-upgrade|abort-remove|abort-deconfigure)
# do nothing
;;
*)
echo "$0: incorrect arguments: $*" >&2
exit 1
;;
esac
#DEBHELPER#

18
debian/nut-hal-drivers.preinst vendored Normal file
View File

@ -0,0 +1,18 @@
#!/bin/sh
set -e
if [ "$1" = install ] || [ "$1" = upgrade ]; then
# Remove previous rules if unchanged, otherwise move to new filename.
if [ -e "/etc/udev/rules.d/52_nut-usbups.rules" ]; then
if [ "`md5sum \"/etc/udev/rules.d/52_nut-usbups.rules\" | sed -e \"s/ .*//\"`" = \
"`dpkg-query -W -f='${Conffiles}' nut-hal-drivers | sed -n -e \"\\\\' /etc/udev/rules.d/52_nut-usbups.rules's/.* //p\"`" ]
then
rm -f "/etc/udev/rules.d/52_nut-usbups.rules"
else
mv "/etc/udev/rules.d/52_nut-usbups.rules" "/etc/udev/rules.d/52-nut-usbups.rules"
fi
fi
fi
#DEBHELPER#

1
debian/nut-powerman-pdu.install vendored Normal file
View File

@ -0,0 +1 @@
debian/tmp/lib/nut/powerman-pdu

1
debian/nut-powerman-pdu.manpages vendored Normal file
View File

@ -0,0 +1 @@
debian/tmp/usr/share/man/man8/powerman-pdu.8

1
debian/nut-snmp.install vendored Normal file
View File

@ -0,0 +1 @@
debian/tmp/lib/nut/snmp-ups

6
debian/nut-snmp.lintian-overrides vendored Normal file
View File

@ -0,0 +1,6 @@
# due to libnetsnmp.la overlinking on dependency_libs
# dpkg-shlibdeps: warning: dependency on libcrypto.so.0.9.8 could be avoided if
# "debian/nut-snmp/lib/nut/snmp-ups" were not uselessly linked against it (they
# use none of its symbols)..
# This will be cleanly solved upstream...
nut-snmp: possible-gpl-code-linked-with-openssl

1
debian/nut-snmp.manpages vendored Normal file
View File

@ -0,0 +1 @@
debian/tmp/usr/share/man/man8/snmp-ups.8

1
debian/nut-xml.install vendored Normal file
View File

@ -0,0 +1 @@
debian/tmp/lib/nut/netxml-ups

1
debian/nut-xml.manpages vendored Normal file
View File

@ -0,0 +1 @@
debian/tmp/usr/share/man/man8/netxml-ups.8

155
debian/nut.README.Debian vendored Normal file
View File

@ -0,0 +1,155 @@
Network UPS Tools - Quick Start for Debian
------------------------------------------
Anyway, here are the quick start instructions for using nut:
These Quick Start instructions are useful for a UPS connected to a single
machine. For a UPS connected to multiple machines, additional steps must be
taken, as outlined at the end of this file, including the notice regarding
SECURITY CONSIDERATIONS.
(I) Upgrading
=============
In case of upgrading, follow instructions given in:
/usr/share/doc/nut/UPGRADING
Note that service(s) (driver(s), upsd, upsmon) are not restarted upon
upgrade, to avoid service disruption. You have to manually do it.
(II) Installation
=================
Configuration files are located in /etc/nut/
In order to tune NUT configuration according to your needs, follow the below
information, along with the one provided inside these files.
(1) /etc/nut/nut.conf (see 'man 5 nut.conf' for more information)
Edit /etc/nut/nut.conf and modify the "MODE" variable according to your
configuration.
You can also fine tune the daemons options through UPSD_OPTIONS and
UPSMON_OPTIONS.
The steps 2 to 5 are only required if you use a "standalone" or "netserver"
MODE. If you are running in "netclient" MODE, jump directly to section 6.
(2) /etc/nut/ups.conf (see 'man 5 ups.conf' for more information)
Edit /etc/nut/ups.conf and add something like:
[myups]
driver = usbhid-ups
port = auto
Use the appropriate driver for your UPS and select the correct port.
To select the driver, take a look at the UPS compatibility list:
/usr/share/nut/driver.list
If you have more than one UPS, add as many entries as needed.
If you wish to test manually whether your configuration of ups.conf is
correct, you may invoke upsdrvctl by hand (as root):
/sbin/upsdrvctl start [myups]
/sbin/upsdrvctl stop [myups]
Ensure that the permissions of ups.conf do not permit the world to
read it. It should already be thus, but the following command
accomplishes this:
chown root:nut /etc/nut/ups.conf
chmod 640 /etc/nut/ups.conf
(3) device port permissions
The nut user need to be able to access the device port both for reading and
writing.
For serial devices, there are two possibilities:
a) You can add the nut user to the dialout group.
The following command accomplishes this:
addgroup nut dialout
This is not done by default for security reason on Debian, but is applied
on Ubuntu.
b) Another solution, for system supporting udev, is to create a file
(for example /etc/udev/rules.d/52_nut-serialups.rules), placed
after 020_permissions.rules and to add something like:
KERNEL=="ttyS1", GROUP="nut"
where 'ttyS1' has to be replaced by the exact name of your serial port.
For USB devices, permissions are automatically set by the
52-nut-usbups.rules udev rules file.
(4) /etc/nut/upsd.conf (see 'man 5 upsd.conf' for more information)
the default /etc/nut/upsd.conf is fine for a "standalone" configuration.
If you are in "netserver" MODE, you will have to modify the LISTEN option
to something suitable.
Ensure that the permissions of upsd.conf do not permit the world to
read it. It should already be thus, but the following command
accomplishes this:
chown root:nut /etc/nut/upsd.conf
chmod 640 /etc/nut/upsd.conf
(5) /etc/nut/upsd.users (see 'man 5 upsd.users' for more information)
Edit /etc/nut/upsd.users and add something like the following,
without the comments, in order to define a user:
[monmaster]
password = blah
upsmon master
Please use *different* usernames and passwords than you use on your
system; see the note regarding SECURITY CONSIDERATIONS at the end
of this file.
Ensure that the permissions of upsd.users do not permit the world to
read it. It should already be thus, but the following command
accomplishes this:
chown root:nut /etc/nut/upsd.users
chmod 640 /etc/nut/upsd.users
(6) /etc/nut/upsmon.conf (see 'man 5 upsmon.conf' for more information)
Edit /etc/nut/upsmon.conf and add something like the following:
MONITOR myups@localhost 1 monmaster blah master
POWERDOWNFLAG /etc/killpower
SHUTDOWNCMD "/sbin/shutdown -h +0"
Ensure that the permissions of upsmon.conf do not permit the world to
read it. It should already be thus, but the following commands
accomplishes this:
chown root:nut /etc/nut/upsmon.conf
chmod 640 /etc/nut/upsmon.conf
(7) /etc/default/nut
This file is not used anymore.
nut.conf provides all the needed features to replace this file.
(8) start the daemon
Invoke '/etc/init.d/nut start' to start the daemon(s). Check
/var/log/syslog to ensure that upsd, appropriate drivers, and upsmon
started up correctly.
Additional Notes for Sharing a UPS
----------------------------------
If you have multiple machines connected to the same UPS, you will need to
(a) modify the access control lists in upsd.conf on the server;
(b) add additional users to upsd.users on the server; and
(c) configure upsmon.conf on the clients.
Please note that upsmon on a client machine and upsd on a server machine need
to communicate via your network. This means that you need to ensure that all
the networking equipment (hub, switch, router, etc.) between the client and the
server is powered by the UPS. Otherwise, when the power goes down, the network
connection between the client machine will be broken and the client will not
be told to shut down.
SECURITY CONSIDERATIONS
-----------------------
Finally, please be aware of the following SECURITY CONSIDERATIONS: the TCP
communications between the client daemon, upsmon, and the server daemon, upsd,
send the username and passwords defined in upsd.users and used in upsmon.conf
over the wire UNENCRYPTED. This means that somebody could sniff the username
and password. A version that encrypts the connection using SSL should be
available someday.
Please see the documentation in /usr/share/doc/nut/docs for more information.

11
debian/nut.TODO.Debian vendored Normal file
View File

@ -0,0 +1,11 @@
- address the /var/www issue with upstream
- rewrite and enhance the init script (log output, LSB, ...)
- audit and solve the lintian reports...
- factorise install rules (possibly use CDBS)
- consider an SSL/TLS set of packages (ie nut-ssl, ...)
or help the port to NSS
- apply when available the NUT Packaging Standard (NPS)
ie create a nut-client package
- install the device-recorder.sh script (with nut-client or nut-dev?)
- consider joining the powermgt effort:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=55123

4
debian/nut.dirs vendored Normal file
View File

@ -0,0 +1,4 @@
/etc/nut
/bin
/sbin
/var/lib/nut

5
debian/nut.docs vendored Normal file
View File

@ -0,0 +1,5 @@
AUTHORS
MAINTAINERS
README
UPGRADING
docs

204
debian/nut.init vendored Normal file
View File

@ -0,0 +1,204 @@
#! /bin/sh
### BEGIN INIT INFO
# Provides: nut
# Required-Start: $local_fs $syslog $network $remote_fs
# Required-Stop: $local_fs $syslog $network $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Network UPS Tools initscript
# Description: This script take care of starting and stopping the
# Network UPS Tools components. When needed, it also
# handle the UPS hardware shutdown.
### END INIT INFO
# Author: Arnaud Quette <aquette@debian.org>
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin
NAME=nut
DESC="Network UPS Tools"
DEFAULT=/etc/default/nut
CONFIG=/etc/nut/nut.conf
. /lib/lsb/init-functions
# set upsd specific options. use "man upsd" for more info
UPSD_OPTIONS=""
# set upsmon specific options. use "man upsmon" for more info
UPSMON_OPTIONS=""
# Include defaults if available (transition period)
if [ -f $DEFAULT ] ; then
. $DEFAULT
fi
# Include NUT nut.conf
if [ -f $CONFIG ] ; then
. $CONFIG
fi
# Explicitly require the configuration to be done in /etc/nut/nut.conf
if [ "x$MODE" = "xnone" -o -z "$MODE" ] ; then
log_action_msg "$NAME disabled, please adjust the configuration to your needs"
log_action_msg "Then set MODE to a suitable value in $CONFIG to enable it"
# exit success to avoid breaking the install process!
exit 0
fi
pid_dir=/var/run/nut
upsmon_pid=${pid_dir}/upsmon.pid
upsd_pid=${pid_dir}/upsd.pid
upsd=/sbin/upsd
upsdrvctl=/sbin/upsdrvctl
upsmon=/sbin/upsmon
log=">/dev/null 2>/dev/null"
# Check if /var/run/nut exists and has the correct perms
check_var_directory() {
[ ! -d ${pid_dir} ] && mkdir -p ${pid_dir} \
&& chown root:nut ${pid_dir} \
&& chmod 770 ${pid_dir}
}
# check if the right components are running
check_status() {
case "$MODE" in
standalone|netserver)
status_of_proc -p $upsd_pid $upsd upsd
status_of_proc -p $upsmon_pid $upsmon upsmon
;;
netclient)
status_of_proc -p $upsmon_pid $upsmon upsmon
;;
none|*)
;;
esac
}
start_stop_server () {
case "$MODE" in
standalone|netserver)
case "$1" in
start)
! $upsdrvctl start >/dev/null 2>&1 && \
log_progress_msg "(driver(s) failed)" || log_progress_msg "driver(s)"
start-stop-daemon -S -q -p $upsd_pid -x $upsd \
-- $UPSD_OPTIONS >/dev/null 2>&1
;;
stop)
start-stop-daemon -K -o -q -p $upsd_pid -n upsd >/dev/null 2>&1
! /sbin/upsdrvctl stop >/dev/null 2>&1 && \
log_progress_msg "(driver(s) failed)" || log_progress_msg "driver(s)"
;;
esac
;;
none|netclient|*)
return 1
;;
esac
}
start_stop_client () {
case "$MODE" in
standalone|netserver|netclient)
case "$1" in
start)
start-stop-daemon -S -q -p $upsmon_pid -x $upsmon \
-- $UPSMON_OPTIONS >/dev/null 2>&1
;;
stop)
start-stop-daemon -K -o -q -p $upsmon_pid -n upsmon >/dev/null 2>&1
;;
esac
;;
none|*)
return 1
;;
esac
}
case "$1" in
start)
log_daemon_msg "Starting $DESC"
check_var_directory
start_stop_server start && log_progress_msg "upsd"
start_stop_client start && log_progress_msg "upsmon"
log_end_msg 0
;;
stop)
log_daemon_msg "Stopping $DESC"
start_stop_server stop && log_progress_msg "upsd"
start_stop_client stop && log_progress_msg "upsmon"
log_end_msg 0
;;
reload)
$upsd -c reload >/dev/null 2>&1
$upsmon -c reload >/dev/null 2>&1
;;
restart|force-reload)
log_daemon_msg "Restarting $DESC"
start_stop_client stop
start_stop_server stop
sleep 5
check_var_directory
start_stop_server start && log_progress_msg "upsd"
start_stop_client start && log_progress_msg "upsmon"
log_end_msg 0
;;
status)
#log_daemon_msg "Checking status of $DESC"
echo "Checking status of $DESC"
check_status
exit $?
;;
poweroff)
flag=`sed -ne 's#^ *POWERDOWNFLAG *\(.*\)$#\1#p' /etc/nut/upsmon.conf`
wait_delay=`sed -ne 's#^ *POWEROFF_WAIT= *\(.*\)$#\1#p' /etc/nut/nut.conf`
if [ -f "$flag" ] ; then
if $upsmon -K >/dev/null 2>&1 ; then
log_daemon_msg "Shutting down the UPS ..."
sleep 1
if $upsdrvctl shutdown ; then
sleep 5
log_progress_msg "Waiting for UPS to cut the power"
log_end_msg 0
else
log_progress_msg "Shutdown failed."
log_progress_msg "Waiting for UPS batteries to run down"
log_end_msg 0
fi
if [ "$wait_delay" ] ; then
log_daemon_msg " (will reboot after $wait_delay) ..."
sleep "$wait_delay"
invoke-rc.d reboot stop
fi
else
log_daemon_msg "Power down flag is not set (UPS shutdown not needed)"
fi
else
if [ -z "$flag" ] ; then
log_daemon_msg "##########################################################"
log_progress_msg "## POWERDOWNFLAG is not defined in /etc/nut/upsmon.conf ##"
log_progress_msg "## ##"
log_progress_msg "## Please read the Manual page upsmon.conf(5) ##"
log_progress_msg "##########################################################"
log_end_msg 0
fi
fi
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|reload|restart|force-reload|status|poweroff}" >&2
exit 1
;;
esac
exit 0

56
debian/nut.install vendored Normal file
View File

@ -0,0 +1,56 @@
debian/tmp/bin/upslog
debian/tmp/bin/upsc
debian/tmp/bin/upsrw
debian/tmp/bin/upscmd
debian/tmp/sbin/
debian/tmp/usr/share/nut/cmdvartab
debian/tmp/usr/share/nut/driver.list
debian/tmp/*/udev/
debian/tmp/etc/nut/nut.conf
debian/tmp/etc/nut/ups.conf
debian/tmp/etc/nut/upsd.conf
debian/tmp/etc/nut/upsd.users
debian/tmp/etc/nut/upsmon.conf
debian/tmp/etc/nut/upssched.conf
debian/tmp/etc/bash_completion.d/nut
debian/tmp/lib/nut/genericups
debian/tmp/lib/nut/mge-shut
debian/tmp/lib/nut/rhino
debian/tmp/lib/nut/bestups
debian/tmp/lib/nut/bestfortress
debian/tmp/lib/nut/usbhid-ups
debian/tmp/lib/nut/apcsmart
debian/tmp/lib/nut/belkin
debian/tmp/lib/nut/blazer_ser
debian/tmp/lib/nut/blazer_usb
debian/tmp/lib/nut/clone
debian/tmp/lib/nut/ivtscd
debian/tmp/lib/nut/metasys
debian/tmp/lib/nut/etapro
debian/tmp/lib/nut/tripplite_usb
debian/tmp/lib/nut/bcmxcp
debian/tmp/lib/nut/bestuferrups
debian/tmp/lib/nut/gamatronic
debian/tmp/lib/nut/newmge-shut
debian/tmp/lib/nut/safenet
debian/tmp/lib/nut/isbmex
debian/tmp/lib/nut/masterguard
debian/tmp/lib/nut/belkinunv
debian/tmp/lib/nut/tripplite
debian/tmp/lib/nut/upscode2
debian/tmp/lib/nut/solis
debian/tmp/lib/nut/oneac
debian/tmp/lib/nut/mge-utalk
debian/tmp/lib/nut/powerpanel
debian/tmp/lib/nut/bestfcom
debian/tmp/lib/nut/liebert
debian/tmp/lib/nut/powercom
debian/tmp/lib/nut/bcmxcp_usb
debian/tmp/lib/nut/victronups
debian/tmp/lib/nut/tripplitesu
debian/tmp/lib/nut/optiups
debian/tmp/lib/nut/megatec_usb
debian/tmp/lib/nut/upsdrvctl /sbin
debian/tmp/lib/nut/megatec
debian/tmp/lib/nut/everups
debian/tmp/lib/nut/dummy-ups

2
debian/nut.link vendored Normal file
View File

@ -0,0 +1,2 @@
etc/init.d/nut etc/init.d/ups-monitor

2
debian/nut.lintian-overrides vendored Normal file
View File

@ -0,0 +1,2 @@
nut: script-in-etc-init.d-not-registered-via-update-rc.d

51
debian/nut.manpages vendored Normal file
View File

@ -0,0 +1,51 @@
debian/tmp/usr/share/man/man5/ups.conf.5
debian/tmp/usr/share/man/man5/upsd.conf.5
debian/tmp/usr/share/man/man5/upsd.users.5
debian/tmp/usr/share/man/man5/upsmon.conf.5
debian/tmp/usr/share/man/man5/upssched.conf.5
debian/tmp/usr/share/man/man8/apcsmart.8
debian/tmp/usr/share/man/man8/bcmxcp.8
debian/tmp/usr/share/man/man8/bcmxcp_usb.8
debian/tmp/usr/share/man/man8/belkin.8
debian/tmp/usr/share/man/man8/belkinunv.8
debian/tmp/usr/share/man/man8/bestfcom.8
debian/tmp/usr/share/man/man8/bestuferrups.8
debian/tmp/usr/share/man/man8/bestups.8
debian/tmp/usr/share/man/man8/bestfortress.8
debian/tmp/usr/share/man/man8/blazer.8
debian/tmp/usr/share/man/man8/clone.8
debian/tmp/usr/share/man/man8/dummy-ups.8
debian/tmp/usr/share/man/man8/etapro.8
debian/tmp/usr/share/man/man8/everups.8
debian/tmp/usr/share/man/man8/gamatronic.8
debian/tmp/usr/share/man/man8/genericups.8
debian/tmp/usr/share/man/man8/isbmex.8
debian/tmp/usr/share/man/man8/liebert.8
debian/tmp/usr/share/man/man8/masterguard.8
debian/tmp/usr/share/man/man8/megatec.8
debian/tmp/usr/share/man/man8/megatec_usb.8
debian/tmp/usr/share/man/man8/metasys.8
debian/tmp/usr/share/man/man8/mge-shut.8
debian/tmp/usr/share/man/man8/mge-utalk.8
debian/tmp/usr/share/man/man8/nutupsdrv.8
debian/tmp/usr/share/man/man8/oneac.8
debian/tmp/usr/share/man/man8/optiups.8
debian/tmp/usr/share/man/man8/powercom.8
debian/tmp/usr/share/man/man8/powerpanel.8
debian/tmp/usr/share/man/man8/rhino.8
debian/tmp/usr/share/man/man8/safenet.8
debian/tmp/usr/share/man/man8/solis.8
debian/tmp/usr/share/man/man8/tripplite.8
debian/tmp/usr/share/man/man8/tripplitesu.8
debian/tmp/usr/share/man/man8/tripplite_usb.8
debian/tmp/usr/share/man/man8/upsc.8
debian/tmp/usr/share/man/man8/upscmd.8
debian/tmp/usr/share/man/man8/upscode2.8
debian/tmp/usr/share/man/man8/upsd.8
debian/tmp/usr/share/man/man8/upsdrvctl.8
debian/tmp/usr/share/man/man8/upslog.8
debian/tmp/usr/share/man/man8/upsmon.8
debian/tmp/usr/share/man/man8/upsrw.8
debian/tmp/usr/share/man/man8/upssched.8
debian/tmp/usr/share/man/man8/usbhid-ups.8
debian/tmp/usr/share/man/man8/victronups.8

136
debian/nut.postinst vendored Normal file
View File

@ -0,0 +1,136 @@
#!/bin/sh -e
case "$1" in
configure)
# make sure the nut user exists and has correct memberships
if ! getent group nut >/dev/null; then
addgroup --quiet --system nut
fi
if ! getent passwd nut >/dev/null; then
adduser --quiet --system --ingroup nut --home /var/lib/nut --no-create-home nut
elif ! groups nut | grep -qw nut; then
adduser nut nut
fi
# for Ubuntu, while waiting for a proper debconf
# if ! groups nut | grep -qw dialout; then
# adduser nut dialout
# fi
# make sure that conffiles are secured and have the correct ownerships
if [ -d /etc/nut/ ] ; then
chown root:nut /etc/nut/
fi
for file in nut.conf ups.conf upsd.conf upsmon.conf upsd.users upssched.conf ; do
if [ -f /etc/nut/$file ] ; then
chown root:nut /etc/nut/$file
chmod 640 /etc/nut/$file
fi
done
# make sure that /var/run/nut exists and has the correct ownerships
if [ ! -d /var/run/nut ] ; then
mkdir -p /var/run/nut
fi
if [ -d /var/run/nut ] ; then
chown root:nut /var/run/nut
chmod 770 /var/run/nut
fi
# make sure that /var/lib/nut has the correct permissions and ownerships
if [ -d /var/lib/nut ] ; then
chown root:nut /var/lib/nut
chmod 770 /var/lib/nut
fi
# ask udev to check for new udev rules
[ -x /etc/init.d/udev ] && pidof udevd > /dev/null \
&& udevadm trigger --action=change
# 557178 udevadm trigger --subsystem-match=usb
# migrate /etc/default/nut to /etc/nut/nut.conf (part #2)
if dpkg --compare-versions "$2" lt-nl "2.4.1-2" ; then
# source the temporary /etc/default/nut.bak file
if [ -f /etc/default/nut.bak ] ; then
. /etc/default/nut.bak
# FIXME: use a template (and debconf to output?)
echo "migrating /etc/default/nut to /etc/nut/nut.conf"
# pre process the config
case "$START_UPSD" in
y|Y|yes|YES|Yes)
START_UPSD=yes
;;
*)
START_UPSD=no
;;
esac
case "$START_UPSMON" in
y|Y|yes|YES|Yes)
START_UPSMON=yes
;;
*)
START_UPSMON=no
;;
esac
# now process the result
if [ "x$START_UPSD" = "xyes" ] ; then
if [ "x$START_UPSMON" = "xyes" ] ; then
# can also be netserver
NUT_MODE=standalone
#else not processed since it should be an error!
fi
else
if [ "x$START_UPSMON" = "xyes" ] ; then
NUT_MODE=netclient
else
NUT_MODE=none
fi
fi
# output back the MODE to nut.conf
sed "s/^MODE\(.*\)/MODE=$NUT_MODE/" /etc/nut/nut.conf > /etc/nut/nut.conf.new
# append the content of default, removing START_* / start...
grep -iv 'START' /etc/default/nut.bak >> /etc/nut/nut.conf.new
# move back to nut.conf
mv /etc/nut/nut.conf.new /etc/nut/nut.conf
# and to init.d/nut
#if [ -f /etc/init.d/nut ] ; then
# sed "s/^UPSD_OPTIONS\(.*\)/UPSD_OPTIONS=\"$UPSD_OPTIONS\"/" /etc/init.d/nut > /etc/init.d/nut.new
# sed "s/^UPSMON_OPTIONS\(.*\)/UPSMON_OPTIONS=\"$UPSMON_OPTIONS\"/" /etc/init.d/nut.new > /etc/init.d/nut
#fi
rm -f /etc/default/nut.bak /etc/default/nut
fi
else
# re process nut.conf MODE so that it can be sourced
NUT_MODE=`grep -e '^ *MODE' /etc/nut/nut.conf | tr -d " "`
sed "s/^ *MODE.*/$NUT_MODE/" /etc/nut/nut.conf > /etc/nut/nut.conf.new
mv /etc/nut/nut.conf.new /etc/nut/nut.conf
fi
;;
abort-upgrade)
# do nothing
;;
abort-remove)
# do nothing
;;
abort-deconfigure)
# do nothing
;;
*)
echo "$0: incorrect arguments: $*" >&2
exit 1
;;
esac
#DEBHELPER#

53
debian/nut.postrm vendored Normal file
View File

@ -0,0 +1,53 @@
#!/bin/sh -e
case "$1" in
remove)
# remove sample file if those were previously (wrongly) installed
for file in ups.conf upsd.conf upsmon.conf upsd.users upssched.conf ; do
rm -f /etc/nut/${file}.sample
done
;;
purge)
# remove udev rules files
rm -f /etc/udev/rules.d/025_nut-usbups.rules
rm -f /etc/udev/rules.d/52_nut-usbups.rules
rm -f /etc/udev/rules.d/52-nut-usbups.rules
# remove the nut user
if getent passwd nut >/dev/null; then
deluser --quiet nut
fi
# handle a dpkg bug
[ -d /etc/nut ] && rmdir --ignore-fail-on-non-empty /etc/nut >/dev/null 2>&1
;;
upgrade)
# do nothing
;;
failed-upgrade)
# do nothing
;;
abort-install)
# do nothing
;;
abort-upgrade)
# do nothing
;;
disappear)
# do nothing
;;
*)
echo "$0: incorrect arguments: $*" >&2
exit 1
;;
esac
#DEBHELPER#

26
debian/nut.preinst vendored Normal file
View File

@ -0,0 +1,26 @@
#!/bin/sh -e
if [ "$1" = upgrade ]; then
# remove the obsolete udev file
[ -f /etc/udev/rules.d/025_nut-usbups.rules ] && rm -f /etc/udev/rules.d/025_nut-usbups.rules
# Remove previous rules if unchanged, otherwise move to new filename.
if [ -e "/etc/udev/rules.d/52_nut-usbups.rules" ]; then
if [ "`md5sum \"/etc/udev/rules.d/52_nut-usbups.rules\" | sed -e \"s/ .*//\"`" = \
"`dpkg-query -W -f='${Conffiles}' nut | sed -n -e \"\\\\' /etc/udev/rules.d/52_nut-usbups.rules's/.* //p\"`" ]
then
rm -f "/etc/udev/rules.d/52_nut-usbups.rules"
else
mv "/etc/udev/rules.d/52_nut-usbups.rules" "/etc/udev/rules.d/52-nut-usbups.rules"
fi
fi
# migrate /etc/default/nut to /etc/nut/nut.conf (part #1)
# we need to do this before default gets trashed
if [ -f /etc/default/nut ] ; then
# backup /etc/default/nut
cp /etc/default/nut /etc/default/nut.bak
fi
fi
#DEBHELPER#

42
debian/nut.prerm vendored Normal file
View File

@ -0,0 +1,42 @@
#!/bin/sh -e
# the DEBHELPER token is purposely not used
# because we don't want the daemon to be
# stopped during an upgrade
case "$1" in
remove)
# nut-usb specifics
[ -f /etc/hotplug/usb/libhid.usermap ] && rm -f /etc/hotplug/usb/libhid.usermap
[ -f /etc/hotplug/usb/libhidups ] && rm -f /etc/hotplug/usb/libhidups
[ -L /usr/doc/nut ] && rm -f /usr/doc/nut
# do stop the daemon on remove
invoke-rc.d nut stop && sleep 1
[ -d /var/run/nut ] && rm -f /var/run/nut/*.pid
;;
upgrade)
[ -L /usr/doc/nut ] && rm -f /usr/doc/nut
# do not stop the daemon on upgrade
;;
failed-upgrade)
# do nothing
;;
deconfigure)
# do nothing
;;
*)
echo "$0: incorrect arguments: $*" >&2
exit 1
;;
esac
#DEBHELPER#
exit 0

138
debian/rules vendored Executable file
View File

@ -0,0 +1,138 @@
#!/usr/bin/make -f
#export DH_VERBOSE=1
export DH_OPTIONS=
DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null)
CFLAGS+=$(if $(findstring debug,$(DEB_BUILD_OPTIONS)),-g)
CFLAGS+=$(if $(findstring noopt,$(DEB_BUILD_OPTIONS)),-O0,-O2)
CONFIGUREFLAGS+=$(if $(findstring nostrip,$(DEB_BUILD_OPTIONS)),,--enable-strip)
CONFIGUREFLAGS+=--build=$(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
CONFIGUREFLAGS+=--host=$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
CONFIGUREFLAGS+=$(if $(wildcard /usr/include/linux/hiddev.h),--with-linux-hiddev=/usr/include/linux/hiddev.h,--without-linux-hiddev)
ifeq (linux,$(DEB_HOST_ARCH_OS))
CONFIGUREFLAGS+=--with-udev-dir=/lib/udev
endif
configure: patch configure-stamp
configure-stamp:
dh_testdir
CFLAGS='$(CFLAGS)' ./configure $(CONFIGUREFLAGS) \
--prefix=/usr \
--exec-prefix=/ \
--sysconfdir=/etc/nut \
--mandir=/usr/share/man \
--libdir=/lib \
--includedir=/usr/include \
--without-ssl \
--with-hal \
--with-cgi \
--with-dev \
--enable-static \
--with-statepath=/var/run/nut \
--with-altpidpath=/var/run/nut \
--with-drvpath=/lib/nut \
--with-cgipath=/usr/lib/cgi-bin/nut \
--with-htmlpath=/usr/share/nut/www \
--with-pidpath=/var/run/nut \
--datadir=/usr/share/nut \
--with-pkgconfig-dir=/usr/lib/pkgconfig \
--with-user=nut --with-group=nut
touch $@
build: configure
build: build-stamp
build-stamp:
dh_testdir
$(MAKE)
touch $@
clean: clean-patched unpatch
clean-patched:
dh_testdir
dh_testroot
rm -f configure-stamp build-stamp install-stamp
[ ! -f Makefile ] || $(MAKE) distclean
dh_clean
# debconf-updatepo
# -test -r /usr/share/misc/config.sub && \
# cp -f /usr/share/misc/config.sub config.sub
# -test -r /usr/share/misc/config.guess && \
# cp -f /usr/share/misc/config.guess config.guess
patch: patch-stamp
patch-stamp:
# dpatch apply-all
# touch $@
# run autoreconf for dpatch
# autoreconf
unpatch:
# dpatch deapply-all
# rm -rf patch-stamp debian/patched
uninstall:
dh_testdir
dh_testroot
rm -f install-stamp
dh_prep
install: build
install: install-stamp
install-stamp: DH_OPTIONS=
install-stamp:
dh_testdir
dh_testroot
dh_prep
dh_installdirs
$(MAKE) install \
DESTDIR=$(CURDIR)/debian/tmp RUNUID=65534 RUNGID=65534
# install the bash completion script
mkdir -p $(CURDIR)/debian/tmp/etc/bash_completion.d
cp $(CURDIR)/scripts/misc/nut.bash_completion \
$(CURDIR)/debian/tmp/etc/bash_completion.d/nut
# install the default configuration
for f in $(CURDIR)/debian/tmp/etc/nut/*; do \
nf=`basename $${f} | sed 's/\(.*\).sample/\1/'`; \
mv $${f} $(CURDIR)/debian/tmp/etc/nut/$${nf}; \
done
dh_installchangelogs ChangeLog
dh_installinit -- start 50 2 3 4 5 . stop 50 0 1 6 .
dh_install
dh_installman
dh_installdocs -XMakefile
dh_link
touch $@
binary-indep: DH_OPTIONS=-i
binary-indep: install
binary-arch: DH_OPTIONS=-a
binary-arch: install
dh_testdir
dh_testroot
# dh_installdebconf
dh_strip
dh_compress
dh_fixperms
dh_makeshlibs
dh_lintian -pnut
dh_installdeb
dh_shlibdeps
# dh_shlibdeps -Xlibupsclient.a
ifeq (linux,$(DEB_HOST_ARCH_OS))
dh_gencontrol -- -Vudev="udev (>= 0.124-1)"
# for Ubuntu
# dh_gencontrol -- -Vudev="udev (>= 136-1)"
else
dh_gencontrol -- -Vudev=""
endif
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary configure install uninstall patch unpatch

2
debian/watch vendored Normal file
View File

@ -0,0 +1,2 @@
version=2
http://www.networkupstools.org/source/2.4/nut-(.*)\.tar\.gz debian uupdate