The primary goal of the Network UPS Tools (NUT) project is to provide

reliable monitoring of UPS hardware and ensure safe shutdowns of the
systems which are connected.

Network communications are used so that multiple systems can monitor a
single physical UPS and shut down together if necessary without any
special "sharing hardware" on the UPS itself.
This commit is contained in:
Jason White 2008-02-01 03:23:42 +00:00 committed by Thomas Klausner
parent 5f9619b311
commit ecd68ccce4
17 changed files with 648 additions and 0 deletions

7
ups-nut/DESCR Normal file
View file

@ -0,0 +1,7 @@
The primary goal of the Network UPS Tools (NUT) project is to provide
reliable monitoring of UPS hardware and ensure safe shutdowns of the
systems which are connected.
Network communications are used so that multiple systems can monitor a
single physical UPS and shut down together if necessary without any
special "sharing hardware" on the UPS itself.

12
ups-nut/MESSAGE Normal file
View file

@ -0,0 +1,12 @@
===========================================================================
$NetBSD: MESSAGE,v 1.1.1.1 2008/02/01 03:23:42 jdwhite Exp $
Various changes occurred in version 1.4.
If upgrading from a prior version, refer to
${NUT_DOCDIR}/UPGRADING for more information.
Driver changes occurred in version 2.2.
If upgrading from a prior version, refer to
${NUT_DOCDIR}/UPGRADING for more information.
===========================================================================

98
ups-nut/Makefile Normal file
View file

@ -0,0 +1,98 @@
# $NetBSD: Makefile,v 1.1.1.1 2008/02/01 03:23:42 jdwhite Exp $
DISTNAME= nut-2.2.1
PKGNAME= ups-${DISTNAME}
CATEGORIES= sysutils
MASTER_SITES= http://www.networkupstools.org/source/2.2/
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://www.networkupstools.org/
COMMENT= Network UPS Tools
.include "options.mk"
GNU_CONFIGURE= yes
USE_TOOLS+= gmake
PLIST_SRC+= ${.CURDIR}/PLIST
CHECK_PORTABILITY_SKIP+= packaging/mandriva/upsmon
PKG_SYSCONFSUBDIR?= nut
NUT_CONFDIR= ${PKG_SYSCONFDIR}
NUT_DATADIR= ${PREFIX}/share/nut
NUT_DOCDIR= ${PREFIX}/share/doc/nut
NUT_DRVDIR= ${PREFIX}/libexec/nut
NUT_EGDIR= ${PREFIX}/share/examples/nut
NUT_STATEDIR?= ${VARBASE}/db/nut
NUT_CGIDIR= ${PREFIX}/libexec/cgi-bin/nut
CONFIGURE_ARGS+= --sysconfdir=${NUT_CONFDIR:Q}
CONFIGURE_ARGS+= --datadir=${NUT_DATADIR:Q}
CONFIGURE_ARGS+= --localstatedir=${NUT_STATEDIR:Q}
CONFIGURE_ARGS+= --with-statepath=${NUT_STATEDIR:Q}
CONFIGURE_ARGS+= --with-user=${NUT_USER:Q}
CONFIGURE_ARGS+= --with-group=${NUT_GROUP:Q}
CONFIGURE_ARGS+= --with-drvpath=${NUT_DRVDIR:Q}
CONFIGURE_ARGS+= --with-altpidpath=${NUT_STATEDIR:Q}
CONFIGURE_ARGS+= --with-pidpath=${NUT_STATEDIR:Q}
#INSTALLATION_DIRS+= share/examples/nut
INSTALLATION_DIRS_FROM_PLIST= yes
NUT_USER?= nut
NUT_GROUP?= nut
PKG_GROUPS_VARS+= NUT_GROUP
PKG_USERS_VARS+= NUT_USER
BUILD_DEFS+= NUT_STATEDIR
BUILD_DEFS+= VARBASE
FILES_SUBST+= NUT_CONFDIR=${NUT_CONFDIR:Q}
FILES_SUBST+= NUT_STATEDIR=${NUT_STATEDIR:Q}
MESSAGE_SUBST+= NUT_CONFDIR=${NUT_CONFDIR}
MESSAGE_SUBST+= NUT_EGDIR=${NUT_EGDIR}
MESSAGE_SUBST+= NUT_DOCDIR=${NUT_DOCDIR}
PKG_GROUPS= ${NUT_GROUP}
PKG_USERS= ${NUT_USER}:${NUT_GROUP}
PKG_GECOS.${NUT_USER}= Network UPS Tools
PKG_HOME.${NUT_USER}= ${NUT_STATEDIR}
PKG_SHELL.${NUT_USER}= ${SH}
CONF_FILES+= ${NUT_EGDIR}/ups.conf.sample ${NUT_CONFDIR}/ups.conf
CONF_FILES_PERMS+= ${NUT_EGDIR}/upssched.conf.sample \
${NUT_CONFDIR}/upssched.conf \
${ROOT_USER} ${NUT_GROUP} 0640
CONF_FILES_PERMS+= ${NUT_EGDIR}/upsd.conf.sample \
${NUT_CONFDIR}/upsd.conf \
${ROOT_USER} ${NUT_GROUP} 0640
CONF_FILES_PERMS+= ${NUT_EGDIR}/upsd.users.sample \
${NUT_CONFDIR}/upsd.users \
${ROOT_USER} ${NUT_GROUP} 0640
CONF_FILES_PERMS+= ${NUT_EGDIR}/upsmon.conf.sample \
${NUT_CONFDIR}/upsmon.conf \
${ROOT_USER} ${NUT_GROUP} 0640
RCD_SCRIPTS= ups upsd upsdriver upslog upsmon
OWN_DIRS+= ${NUT_CONFDIR} ${NUT_DOCDIR}/drivers
OWN_DIRS_PERMS= ${NUT_STATEDIR} ${NUT_USER} ${NUT_GROUP} 0770
pre-install:
mkdir ${NUT_STATEDIR}
mkdir ${NUT_DRVDIR}
chown ${NUT_USER} ${NUT_STATEDIR}
${INSTALL_DATA_DIR} ${NUT_EGDIR}
post-install:
${INSTALL_DATA_DIR} ${NUT_DOCDIR}
${INSTALL_DATA_DIR} ${NUT_DOCDIR}/cables
${INSTALL_DATA_DIR} ${NUT_DOCDIR}/drivers
for f in AUTHORS COPYING INSTALL MAINTAINERS NEWS README UPGRADING; do \
${INSTALL_DATA} ${WRKSRC}/$$f ${NUT_DOCDIR}; \
done
${INSTALL_DATA} ${WRKSRC}/docs/FAQ ${NUT_DOCDIR}
${INSTALL_DATA} ${WRKSRC}/data/driver.list ${NUT_DOCDIR}
${INSTALL_DATA} ${WRKSRC}/docs/*.txt ${NUT_DOCDIR}
${INSTALL_DATA} ${WRKSRC}/docs/cables/*.txt ${NUT_DOCDIR}/cables
.include "../../mk/bsd.pkg.mk"

155
ups-nut/PLIST Normal file
View file

@ -0,0 +1,155 @@
@comment $NetBSD: PLIST,v 1.1.1.1 2008/02/01 03:23:42 jdwhite Exp $
bin/upsc
bin/upscmd
bin/upslog
bin/upsrw
bin/upssched-cmd
libexec/nut/al175
libexec/nut/apcsmart
libexec/nut/bcmxcp
libexec/nut/belkin
libexec/nut/belkinunv
libexec/nut/bestfcom
libexec/nut/bestuferrups
libexec/nut/bestups
libexec/nut/cpsups
libexec/nut/cyberpower
libexec/nut/dummy-ups
libexec/nut/etapro
libexec/nut/everups
libexec/nut/gamatronic
libexec/nut/genericups
libexec/nut/isbmex
libexec/nut/liebert
libexec/nut/masterguard
libexec/nut/megatec
libexec/nut/metasys
libexec/nut/mge-shut
libexec/nut/mge-utalk
libexec/nut/newmge-shut
libexec/nut/nitram
libexec/nut/oneac
libexec/nut/optiups
libexec/nut/powercom
libexec/nut/powerpanel
libexec/nut/rhino
libexec/nut/safenet
libexec/nut/skel
libexec/nut/solis
libexec/nut/tripplite
libexec/nut/tripplitesu
libexec/nut/upscode2
libexec/nut/upsdrvctl
libexec/nut/victronups
man/man5/ups.conf.5
man/man5/upsd.conf.5
man/man5/upsd.users.5
man/man5/upsmon.conf.5
man/man5/upssched.conf.5
man/man8/al175.8
man/man8/apcsmart.8
man/man8/bcmxcp.8
man/man8/belkin.8
man/man8/belkinunv.8
man/man8/bestfcom.8
man/man8/bestuferrups.8
man/man8/bestups.8
man/man8/cpsups.8
man/man8/cyberpower.8
man/man8/dummy-ups.8
man/man8/etapro.8
man/man8/everups.8
man/man8/gamatronic.8
man/man8/genericups.8
man/man8/isbmex.8
man/man8/liebert.8
man/man8/masterguard.8
man/man8/megatec.8
man/man8/metasys.8
man/man8/mge-shut.8
man/man8/mge-utalk.8
man/man8/nitram.8
man/man8/nutupsdrv.8
man/man8/oneac.8
man/man8/optiups.8
man/man8/powercom.8
man/man8/powerpanel.8
man/man8/rhino.8
man/man8/safenet.8
man/man8/solis.8
man/man8/tripplite.8
man/man8/tripplitesu.8
man/man8/upsc.8
man/man8/upscmd.8
man/man8/upscode2.8
man/man8/upsd.8
man/man8/upsdrvctl.8
man/man8/upslog.8
man/man8/upsmon.8
man/man8/upsrw.8
man/man8/upssched.8
man/man8/victronups.8
sbin/upsd
sbin/upsmon
sbin/upssched
share/doc/nut/AUTHORS
share/doc/nut/COPYING
share/doc/nut/FAQ
share/doc/nut/INSTALL
share/doc/nut/MAINTAINERS
share/doc/nut/NEWS
share/doc/nut/README
share/doc/nut/UPGRADING
share/doc/nut/acpi.txt
share/doc/nut/al175-vars.txt
share/doc/nut/big-servers.txt
share/doc/nut/cables/apc-rs500-serial.txt
share/doc/nut/cables/apc.txt
share/doc/nut/cables/ge-imv-victron.txt
share/doc/nut/cables/imv.txt
share/doc/nut/cables/mgeups.txt
share/doc/nut/cables/powerware.txt
share/doc/nut/cables/repotec.txt
share/doc/nut/cables/sms.txt
share/doc/nut/chroot.txt
share/doc/nut/commands.txt
share/doc/nut/config-files.txt
share/doc/nut/configure.txt
share/doc/nut/contact-closure.txt
share/doc/nut/data-room.txt
share/doc/nut/design.txt
share/doc/nut/developers.txt
share/doc/nut/driver.list
share/doc/nut/hid-subdrivers.txt
share/doc/nut/ideas.txt
share/doc/nut/macros.txt
share/doc/nut/megatec.txt
share/doc/nut/new-drivers.txt
share/doc/nut/new-names.txt
share/doc/nut/nut-hal.txt
share/doc/nut/osd-notify.txt
share/doc/nut/pager.txt
share/doc/nut/powersaving.txt
share/doc/nut/protocol.txt
share/doc/nut/shutdown.txt
share/doc/nut/snmp.txt
share/doc/nut/sock-protocol.txt
share/doc/nut/ssl.txt
share/doc/nut/upssched.txt
share/examples/nut/ups.conf.sample
share/examples/nut/upsd.conf.sample
share/examples/nut/upsd.users.sample
share/examples/nut/upsmon.conf.sample
share/examples/nut/upssched.conf.sample
share/examples/rc.d/ups
share/examples/rc.d/upsd
share/examples/rc.d/upsdriver
share/examples/rc.d/upslog
share/examples/rc.d/upsmon
share/nut/cmdvartab
share/nut/driver.list
@dirrm share/nut
@dirrm share/examples/nut
@dirrm share/doc/nut/cables
@dirrm share/doc/nut
@dirrm libexec/nut

21
ups-nut/PLIST.cgi Normal file
View file

@ -0,0 +1,21 @@
@comment $NetBSD: PLIST.cgi,v 1.1.1.1 2008/02/01 03:23:42 jdwhite Exp $
libexec/cgi-bin/nut/upsimage.cgi
libexec/cgi-bin/nut/upsset.cgi
libexec/cgi-bin/nut/upsstats.cgi
man/man5/hosts.conf.5
man/man5/upsset.conf.5
man/man5/upsstats.html.5
man/man8/upsimage.cgi.8
man/man8/upsset.cgi.8
man/man8/upsstats.cgi.8
share/examples/nut/hosts.conf.sample
share/examples/nut/upsset.conf.sample
share/examples/nut/upsstats-single.html.sample
share/examples/nut/upsstats.html.sample
share/httpd/htdocs/nut/bottom.html
share/httpd/htdocs/nut/header.html
share/httpd/htdocs/nut/index.html
share/httpd/htdocs/nut/nut-banner.png
@dirrm share/httpd/htdocs/nut
@dirrm share/httpd/htdocs
@dirrm libexec/cgi-bin/nut

3
ups-nut/PLIST.snmp Normal file
View file

@ -0,0 +1,3 @@
@comment $NetBSD: PLIST.snmp,v 1.1.1.1 2008/02/01 03:23:42 jdwhite Exp $
libexec/nut/snmp-ups
man/man8/snmp-ups.8

9
ups-nut/PLIST.usb Normal file
View file

@ -0,0 +1,9 @@
@comment $NetBSD: PLIST.usb,v 1.1.1.1 2008/02/01 03:23:42 jdwhite Exp $
libexec/nut/bcmxcp_usb
libexec/nut/megatec_usb
libexec/nut/tripplite_usb
libexec/nut/usbhid-ups
man/man8/bcmxcp_usb.8
man/man8/megatec_usb.8
man/man8/tripplite_usb.8
man/man8/usbhid-ups.8

7
ups-nut/distinfo Normal file
View file

@ -0,0 +1,7 @@
$NetBSD: distinfo,v 1.1.1.1 2008/02/01 03:23:42 jdwhite Exp $
SHA1 (nut-2.2.1.tar.gz) = a51c0aae6b94f6cf55b2719b4a499d8c31e62862
RMD160 (nut-2.2.1.tar.gz) = 5ad5e486b391bd0d1a3f6fe521043f45ee98c2e9
Size (nut-2.2.1.tar.gz) = 1192538 bytes
SHA1 (patch-aa) = 7a024e1c8367eb700c048b0826fa330003e33c46
SHA1 (patch-ab) = cd69de203fb58ba54b6f6438f88006758c8374c1

55
ups-nut/files/ups.sh Normal file
View file

@ -0,0 +1,55 @@
#!@RCD_SCRIPTS_SHELL@
#
# $NetBSD: ups.sh,v 1.1.1.1 2008/02/01 03:23:42 jdwhite Exp $
#
# KEYWORD: nostart
if [ -f /etc/rc.subr ]
then
. /etc/rc.subr
fi
rcd_dir=`@DIRNAME@ $0`
# NOTE: run_rc_command sets $rc_arg
#
forward_commands()
{
# Backward compat with NetBSD <1.6:
[ -z "$rc_arg" ] && rc_arg=$_arg
for file in $COMMAND_LIST; do
$rcd_dir/$file $rc_arg
done
}
reverse_commands()
{
# Backward compat with NetBSD <1.6:
[ -z "$rc_arg" ] && rc_arg=$_arg
REVCOMMAND_LIST=
for file in $COMMAND_LIST; do
REVCOMMAND_LIST="$file $REVCOMMAND_LIST"
done
for file in $REVCOMMAND_LIST; do
$rcd_dir/$file $rc_arg
done
}
COMMAND_LIST="upsdriver upsd upsmon upslog"
name="ups"
start_cmd="forward_commands"
stop_cmd="reverse_commands"
status_cmd="forward_commands"
extra_commands="status"
if [ -f /etc/rc.subr ]
then
run_rc_command "$1"
else
@ECHO@ -n " ${name}"
_arg="$1"
${start_cmd}
fi

28
ups-nut/files/upsd.sh Normal file
View file

@ -0,0 +1,28 @@
#!@RCD_SCRIPTS_SHELL@
#
# $NetBSD: upsd.sh,v 1.1.1.1 2008/02/01 03:23:42 jdwhite Exp $
#
# PROVIDE: upsd
# REQUIRE: upsdriver
# BEFORE: upsmon
# KEYWORD: shutdown
if [ -f /etc/rc.subr ]
then
. /etc/rc.subr
fi
name="upsd"
rcvar=$name
command="@PREFIX@/sbin/${name}"
required_files="@NUT_CONFDIR@/${name}.conf"
pidfile="@NUT_STATEDIR@/${name}.pid"
if [ -f /etc/rc.subr ]
then
load_rc_config $name
run_rc_command "$1"
else
@ECHO@ -n " ${name}"
${command} ${upsd_flags} ${command_args}
fi

View file

@ -0,0 +1,58 @@
#!@RCD_SCRIPTS_SHELL@
#
# $NetBSD: upsdriver.sh,v 1.1.1.1 2008/02/01 03:23:42 jdwhite Exp $
#
# PROVIDE: upsdriver
# REQUIRE: NETWORK syslogd mountcritremote
#
# You will need to set some variables in /etc/rc.conf to start the UPS
# driver(s) properly, e.g.
#
# upsdriver=YES
# upsdriver_type="newapc"
# upsdriver_flags="-a smartups"
#
# If "upsdriver_type" is unset, then use "upsdrvctl" to control the UPS
# drivers. Please refer to nutupsdrv(8) for more information about the
# arguments to pass to the UPS drivers.
if [ -f /etc/rc.subr ]
then
. /etc/rc.subr
fi
name="upsdriver"
rcvar=$name
if [ -f /etc/rc.subr ]
then
load_rc_config $name
fi
if [ "${upsdriver_type:-upsdrvctl}" = "upsdrvctl" ]
then
ctl_command="@PREFIX@/libexec/nut/upsdrvctl"
required_files="@NUT_CONFDIR@/ups.conf"
start_cmd="${ctl_command} start"
stop_cmd="${ctl_command} stop"
else
command="@PREFIX@/libexec/nut/${upsdriver_type}"
#
# XXX - We need a way to easily determine the pidfile, which is of
# XXX - the form @NUT_STATEDIR@/${updriver_type}-${tty}.pid
#
#pidfile="@NUT_STATEDIR@/${upsdriver_type}-${tty}.pid"
fi
if [ -f /etc/rc.subr ]
then
run_rc_command "$1"
else
@ECHO@ -n " ${name}"
if [ -n "${start_cmd}" ]
then
${start_cmd}
else
${command} ${upsdriver_flags} ${command_args}
fi
fi

34
ups-nut/files/upslog.sh Normal file
View file

@ -0,0 +1,34 @@
#!@RCD_SCRIPTS_SHELL@
#
# $NetBSD: upslog.sh,v 1.1.1.1 2008/02/01 03:23:42 jdwhite Exp $
#
# PROVIDE: upslog
# REQUIRE: upsd
#
# You will need to set some variables in /etc/rc.conf to start upslog
# properly, e.g.
#
# upslog=YES
# upslog_flags="smartups@localhost /var/log/ups 60"
#
# Please refer to upslog(8) for more information about the arguments to pass
# to upslog.
if [ -f /etc/rc.subr ]
then
. /etc/rc.subr
fi
name="upslog"
rcvar="${name}"
command="@PREFIX@/bin/${name}"
pidfile="@NUT_STATEDIR@/${name}.pid"
if [ -f /etc/rc.subr ]
then
load_rc_config $name
run_rc_command "$1"
else
@ECHO@ -n " ${name}"
${command} ${upslog_flags} ${command_args}
fi

26
ups-nut/files/upsmon.sh Normal file
View file

@ -0,0 +1,26 @@
#!@RCD_SCRIPTS_SHELL@
#
# $NetBSD: upsmon.sh,v 1.1.1.1 2008/02/01 03:23:42 jdwhite Exp $
#
# PROVIDE: upsmon
# KEYWORD: shutdown
if [ -f /etc/rc.subr ]
then
. /etc/rc.subr
fi
name="upsmon"
rcvar="${name}"
command="@PREFIX@/sbin/${name}"
pidfile="@NUT_STATEDIR@/${name}.pid"
required_files="@NUT_CONFDIR@/${name}.conf"
if [ -f /etc/rc.subr ]
then
load_rc_config $name
run_rc_command "$1"
else
@ECHO@ -n " ${name}"
${command} ${upsmon_flags} ${command_args}
fi

View file

@ -0,0 +1,3 @@
ups-nut-cgi Build and install CGI programs.
ups-nut-snmp Enable SNMP drivers.
ups-nut-usb Enable USB drivers.

46
ups-nut/options.mk Normal file
View file

@ -0,0 +1,46 @@
# $NetBSD: options.mk,v 1.1.1.1 2008/02/01 03:23:42 jdwhite Exp $
.include "../../mk/bsd.prefs.mk"
PKG_OPTIONS_VAR= PKG_OPTIONS.ups-nut
PKG_SUPPORTED_OPTIONS+= ups-nut-cgi ups-nut-snmp ups-nut-usb
PKG_SUGGESTED_OPTIONS=
.include "../../mk/bsd.options.mk"
.if !empty(PKG_OPTIONS:Mups-nut-cgi)
CONFIGURE_ARGS+= --with-cgi
CONFIGURE_ARGS+= --with-cgipath=${NUT_CGIDIR:Q}
CONFIGURE_ARGS+= --with-htmlpath=${PREFIX}/share/httpd/htdocs/nut
PLIST_SRC+= ${.CURDIR}/PLIST.cgi
CONF_FILES+= ${NUT_EGDIR}/upsstats-single.html.sample \
${NUT_CONFDIR}/upsstats-single.html
CONF_FILES+= ${NUT_EGDIR}/upsstats.html.sample \
${NUT_CONFDIR}/upsstats.html
CONF_FILES_PERMS+= ${NUT_EGDIR}/hosts.conf.sample \
${NUT_CONFDIR}/hosts.conf \
${ROOT_USER} ${ROOT_GROUP} 0600
CONF_FILES_PERMS+= ${NUT_EGDIR}/upsset.conf.sample \
${NUT_CONFDIR}/upsset.conf \
${ROOT_USER} ${ROOT_GROUP} 0600
.include "../../graphics/freetype2/buildlink3.mk"
.include "../../graphics/gd/buildlink3.mk"
.else
CONFIGURE_ARGS+= --without-cgi
.endif
.if !empty(PKG_OPTIONS:Mups-nut-snmp)
CONFIGURE_ARGS+= --with-snmp
PLIST_SRC+= ${.CURDIR}/PLIST.snmp
.include "../../net/net-snmp/buildlink3.mk"
.else
CONFIGURE_ARGS+= --without-snmp
.endif
.if !empty(PKG_OPTIONS:Mups-nut-usb)
CONFIGURE_ARGS+= --with-usb=auto
.include "../../devel/libusb/buildlink3.mk"
PLIST_SRC+= ${.CURDIR}/PLIST.usb
.else
CONFIGURE_ARGS+= --without-usb
.endif

74
ups-nut/patches/patch-aa Normal file
View file

@ -0,0 +1,74 @@
$NetBSD: patch-aa,v 1.1.1.1 2008/02/01 03:23:42 jdwhite Exp $
--- conf/Makefile.in.orig 2007-12-21 06:00:51.000000000 -0600
+++ conf/Makefile.in 2008-01-31 16:41:13.000000000 -0600
@@ -41,7 +41,7 @@
target_triplet = @target@
subdir = conf
DIST_COMMON = $(am__dist_sysconf_DATA_DIST) $(srcdir)/Makefile.am \
- $(srcdir)/Makefile.in $(srcdir)/upssched.conf.sample.in
+ $(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 \
@@ -64,7 +64,7 @@
DIST_SOURCES =
am__dist_sysconf_DATA_DIST = upsmon.conf.sample upsd.conf.sample \
upsd.users.sample ups.conf.sample hosts.conf.sample \
- upsset.conf.sample upsstats.html.sample \
+ upssched.conf.sample upsset.conf.sample upsstats.html.sample \
upsstats-single.html.sample
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
@@ -153,6 +153,7 @@
RANLIB = @RANLIB@
RUN_AS_GROUP = @RUN_AS_GROUP@
RUN_AS_USER = @RUN_AS_USER@
+SAMPLEDIR = $(DESTDIR)@prefix@/share/examples/nut
SED = @SED@
SERLIBS = @SERLIBS@
SET_MAKE = @SET_MAKE@
@@ -239,7 +240,8 @@
target_vendor = @target_vendor@
udevdir = @udevdir@
INSTALL_0600 = $(INSTALL) -m 0600
-SECFILES = upsmon.conf.sample upsd.conf.sample upsd.users.sample
+SECFILES = upsmon.conf.sample upsd.conf.sample upsd.users.sample \
+ upssched.conf.sample
PUBFILES = ups.conf.sample
CGIPUB = hosts.conf.sample upsset.conf.sample upsstats.html.sample \
upsstats-single.html.sample
@@ -247,7 +249,7 @@
@WITH_CGI_FALSE@CGI_INSTALL =
@WITH_CGI_TRUE@CGI_INSTALL = $(CGIPUB)
dist_sysconf_DATA = $(SECFILES) $(PUBFILES) $(CGI_INSTALL)
-nodist_sysconf_DATA = upssched.conf.sample
+nodist_sysconf_DATA =
all: all-am
.SUFFIXES:
@@ -294,20 +296,20 @@
uninstall-info-am:
install-dist_sysconfDATA: $(dist_sysconf_DATA)
@$(NORMAL_INSTALL)
- test -z "$(sysconfdir)" || $(mkdir_p) "$(DESTDIR)$(sysconfdir)"
+ test -z "$(SAMPLEDIR)" || $(mkdir_p) "$(SAMPLEDIR)"
@list='$(dist_sysconf_DATA)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
- echo " $(dist_sysconfDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(sysconfdir)/$$f'"; \
- $(dist_sysconfDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(sysconfdir)/$$f"; \
+ echo " $(dist_sysconfDATA_INSTALL) '$$d$$p' '$(SAMPLEDIR)/$$f'"; \
+ $(dist_sysconfDATA_INSTALL) "$$d$$p" "$(SAMPLEDIR)/$$f"; \
done
uninstall-dist_sysconfDATA:
@$(NORMAL_UNINSTALL)
@list='$(dist_sysconf_DATA)'; for p in $$list; do \
f=$(am__strip_dir) \
- echo " rm -f '$(DESTDIR)$(sysconfdir)/$$f'"; \
- rm -f "$(DESTDIR)$(sysconfdir)/$$f"; \
+ echo " rm -f '$(SAMPLEDIR)/$$f'"; \
+ rm -f "$(SAMPLEDIR)/$$f"; \
done
install-nodist_sysconfDATA: $(nodist_sysconf_DATA)
@$(NORMAL_INSTALL)

12
ups-nut/patches/patch-ab Normal file
View file

@ -0,0 +1,12 @@
$NetBSD: patch-ab,v 1.1.1.1 2008/02/01 03:23:42 jdwhite Exp $
--- include/Makefile.in.orig 2007-12-21 06:00:52.000000000 -0600
+++ include/Makefile.in 2008-01-31 16:26:56.000000000 -0600
@@ -229,7 +229,7 @@
BUILT_SOURCES = nut_version.h nut_stdint.h
CLEANFILES = nut_version.h nut_stdint.h
SVNREV = $(shell unset LANG && svnversion -n $(top_srcdir) 2>/dev/null)
-NUT_VERSION = $(shell if test "$(SVNREV)" = "exported"; then echo "$(PACKAGE_VERSION)"; else echo "$(PACKAGE_VERSION)-$(SVNREV)"; fi)
+NUT_VERSION = $(shell if test "$(SVNREV)" = "exported" || test "$(SVNREV)" = "" ; then echo "$(PACKAGE_VERSION)"; else echo "$(PACKAGE_VERSION)-$(SVNREV)"; fi)
all: $(BUILT_SOURCES) config.h
$(MAKE) $(AM_MAKEFLAGS) all-am