Jim Klimov
2016-04-06 2313e27ed052579c55411660c2d6ff6e37429199
Initial recipe for NUT-2.7.4
26 files added
2337 ■■■■■ changed files
components/sysutils/nut/Makefile 235 ●●●●● patch | view | raw | blame | history
components/sysutils/nut/files/README-NUT-etc.txt.in 67 ●●●●● patch | view | raw | blame | history
components/sysutils/nut/files/notifyme 76 ●●●●● patch | view | raw | blame | history
components/sysutils/nut/files/nut.in 84 ●●●●● patch | view | raw | blame | history
components/sysutils/nut/files/nut.xml 135 ●●●●● patch | view | raw | blame | history
components/sysutils/nut/nut-augeas.p5m 42 ●●●●● patch | view | raw | blame | history
components/sysutils/nut/nut-bins.p5m 145 ●●●●● patch | view | raw | blame | history
components/sysutils/nut/nut-cgi.p5m 74 ●●●●● patch | view | raw | blame | history
components/sysutils/nut/nut-common.p5m 48 ●●●●● patch | view | raw | blame | history
components/sysutils/nut/nut-devtools.p5m 35 ●●●●● patch | view | raw | blame | history
components/sysutils/nut/nut-driver-ipmi.p5m 33 ●●●●● patch | view | raw | blame | history
components/sysutils/nut/nut-driver-netxml.p5m 32 ●●●●● patch | view | raw | blame | history
components/sysutils/nut/nut-driver-powerman.p5m 32 ●●●●● patch | view | raw | blame | history
components/sysutils/nut/nut-driver-serial.p5m 148 ●●●●● patch | view | raw | blame | history
components/sysutils/nut/nut-driver-snmp.p5m 32 ●●●●● patch | view | raw | blame | history
components/sysutils/nut/nut-driver-usb.p5m 55 ●●●●● patch | view | raw | blame | history
components/sysutils/nut/nut-driver-virtual.p5m 41 ●●●●● patch | view | raw | blame | history
components/sysutils/nut/nut-drivers.p5m 31 ●●●●● patch | view | raw | blame | history
components/sysutils/nut/nut-libs.p5m 133 ●●●●● patch | view | raw | blame | history
components/sysutils/nut/nut.p5m 37 ●●●●● patch | view | raw | blame | history
components/sysutils/nut/patches/01-nut-configure-withDocsAuto.patch 71 ●●●●● patch | view | raw | blame | history
components/sysutils/nut/patches/02-nut-configure-netsnmp-arch.patch 53 ●●●●● patch | view | raw | blame | history
components/sysutils/nut/patches/03-nut-configure-gdlib-arch.patch 52 ●●●●● patch | view | raw | blame | history
components/sysutils/nut/patches/04-nut-WITH_MANS.patch 526 ●●●●● patch | view | raw | blame | history
components/sysutils/nut/patches/05-nut-quiesce-systemd.patch 23 ●●●●● patch | view | raw | blame | history
components/sysutils/nut/patches/06-nut-augeas-inst-dir.patch 97 ●●●●● patch | view | raw | blame | history
components/sysutils/nut/Makefile
New file
@@ -0,0 +1,235 @@
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source.  A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#
#
# Copyright 2016 Jim Klimov
#
include ../../../make-rules/shared-macros.mk
COMPONENT_NAME=    nut
COMPONENT_VERSION=    2.7.4
COMPONENT_SUMMARY=    Network UPS Tools (NUT)
COMPONENT_DESCRIPTION=    Network UPS Tools (NUT) is a versatile power-device monitoring toolkit to facilitate safe shutdowns
COMPONENT_SRC=    $(COMPONENT_NAME)-$(COMPONENT_VERSION)
COMPONENT_ARCHIVE=    $(COMPONENT_SRC).tar.gz
COMPONENT_ARCHIVE_HASH=    \
  sha256:d580915fdf7090655c1c7c98eb116b61952553f06f0039b1f93c9f5a13e2d36b
COMPONENT_ARCHIVE_URL=    \
  https://github.com/networkupstools/$(COMPONENT_NAME)/archive/v$(COMPONENT_VERSION).tar.gz
COMPONENT_PROJECT_URL=    http://networkupstools.org
COMPONENT_FMRI=    system/management/$(COMPONENT_NAME)
COMPONENT_CLASSIFICATION=    System/Administration and Configuration
COMPONENT_LICENSE=    GPLv2+
COMPONENT_LICENSE_FILE=    COPYING
include $(WS_MAKE_RULES)/prep.mk
include $(WS_MAKE_RULES)/configure.mk
include $(WS_MAKE_RULES)/ips.mk
CXXFLAGS.32=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
CFLAGS.32=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
CXXFLAGS+=$(CXXFLAGS.$(BITS))
CFLAGS+=$(CFLAGS.$(BITS))
#LDFLAGS.32= -L$(USRLIBDIR) -R $(USRLIBDIR) $(LDFLAGS) -L$(GNULIB) -R $(GNULIB)
#LDFLAGS.64= -L$(USRLIBDIR64) -R $(USRLIBDIR64) $(LDFLAGS) -L$(GNULIB64) -R $(GNULIB64)
NUTSEDSUBST = -e 's,\@USRDIR\@,$(USRDIR),g' -e 's,\@MACH\@,$(MACH),g' \
    -e 's,\@MACH64\@,$(MACH64),g' -e 's,\@MACH32\@,$(MACH32),g'
#NUTSEDSUBST += -e 's,\@NUTXXXDIR\@,$(NUTXXXDIR),g'
### A lot of paths are defined and exported to pkg(5) tools below,
### so we can flexibly set up location of certain NUT components.
NUTUSER  =    nut
PKG_OPTIONS +=    -D NUTUSER="$(NUTUSER)"
NUTGROUP  =    nut
PKG_OPTIONS +=    -D NUTGROUP="$(NUTGROUP)"
NUTSEDSUBST += \
    -e 's,\@NUTUSER\@,$(NUTUSER),g' \
    -e 's,\@NUTGROUP\@,$(NUTGROUP),g'
# Example data and other resources for NUT
NUTSHAREDIR  =    $(subst .../,,...$(USRSHAREDIR)/nut)
PKG_OPTIONS +=    -D NUTSHAREDIR="$(NUTSHAREDIR)"
NUTSEDSUBST += -e 's,\@NUTSHAREDIR\@,$(NUTSHAREDIR),g'
# This is where config files are expected, INCLUDING (per convention from other
# distros) example config files - e.g. not lost under /usr/shared/... locations
# Also note we must not include the leading slash...
NUTETCDIR  =    $(subst .../,,...$(ETCDIR)/nut)
PKG_OPTIONS +=    -D NUTETCDIR="$(NUTETCDIR)"
NUTSEDSUBST += -e 's,\@NUTETCDIR\@,$(NUTETCDIR),g'
# To be decided - where the example copies land...
NUTETCSAMPLEDIR=    $(NUTSHAREDIR)/etc-samples
#NUTETCSAMPLEDIR=    $(NUTETCDIR)
PKG_OPTIONS +=    -D NUTETCSAMPLEDIR="$(NUTETCSAMPLEDIR)"
NUTSEDSUBST += -e 's,\@NUTETCSAMPLEDIR\@,$(NUTETCSAMPLEDIR),g'
# Extra programs for NUT, not intended for direct user access (drivers, CGIs)
NUTUSRDIR  =    $(subst .../,,...$(USRLIBDIR)/nut)
PKG_OPTIONS +=    -D NUTUSRDIR="$(NUTUSRDIR)"
NUTSEDSUBST += -e 's,\@NUTUSRDIR\@,$(NUTUSRDIR),g'
# Note that binaries reside in base (32-bit) or $(MACH64) subdirectories of
# these dirs; generally 32-bit ones should suffice and be more efficient,
# so `isaexec` is not employed in this package. The 64-bit variants are made
# available for theoretical chance that 32 bits won't suffice, unlikely in NUT:
NUTDRVDIR  =    $(NUTUSRDIR)/bin
NUTCGIDIR  =    $(NUTUSRDIR)/cgi-bin
PKG_OPTIONS +=    -D NUTDRVDIR="$(NUTDRVDIR)"
PKG_OPTIONS +=    -D NUTCGIDIR="$(NUTCGIDIR)"
NUTSEDSUBST += -e 's,\@NUTDRVDIR\@,$(NUTDRVDIR),g'
NUTSEDSUBST += -e 's,\@NUTCGIDIR\@,$(NUTCGIDIR),g'
_NUTVARDIR  =    $(subst .../,,...$(VARDIR))
NUTSTATEDIR  =    $(_NUTVARDIR)/state/ups
PKG_OPTIONS +=    -D NUTSTATEDIR="$(NUTSTATEDIR)"
NUTSEDSUBST += -e 's,\@NUTSTATEDIR\@,$(NUTSTATEDIR),g'
NUTPIDPATH =    $(_NUTVARDIR)/run
NUTRUNDIR  =    $(NUTPIDPATH)/nut
PKG_OPTIONS +=    -D NUTPIDPATH="$(NUTPIDPATH)"
PKG_OPTIONS +=    -D NUTRUNDIR="$(NUTRUNDIR)"
NUTSEDSUBST += -e 's,\@NUTPIDPATH\@,$(NUTPIDPATH),g'
NUTSEDSUBST += -e 's,\@NUTRUNDIR\@,$(NUTRUNDIR),g'
# So far I am not certain where we should deliver this one, so parametrize ;)
# Currently we deliver this as a sample config file, but it may be copied (and
# maybe adapted) into the ultimate Avahi configuration, wherever that is...
NUT_AVAHI_SERVICE_FILENAME=    avahi-nut.service
NUT_AVAHI_SERVICE_SAMPLE=    $(NUTETCSAMPLEDIR)/$(NUT_AVAHI_SERVICE_FILENAME).sample
PKG_OPTIONS +=    -D NUT_AVAHI_SERVICE_SAMPLE="$(NUT_AVAHI_SERVICE_SAMPLE)"
NUTSEDSUBST += -e 's,\@NUT_AVAHI_SERVICE_SAMPLE\@,$(NUT_AVAHI_SERVICE_SAMPLE),g'
# Leading slashes must also be stripped here
NUTHOTPLUGDIR  =    $(subst .../,,...$(ETCDIR)/hotplug)
PKG_OPTIONS +=    -D NUTHOTPLUGDIR="$(NUTHOTPLUGDIR)"
NUTSEDSUBST += -e 's,\@NUTHOTPLUGDIR\@,$(NUTHOTPLUGDIR),g'
###NUTUDEVDIR  =    $(subst .../,,...$(USRDIR)/udev)
NUTUDEVDIR  =    $(NUTETCSAMPLEDIR)/udev
PKG_OPTIONS +=    -D NUTUDEVDIR="$(NUTUDEVDIR)"
NUTSEDSUBST += -e 's,\@NUTUDEVDIR\@,$(NUTUDEVDIR),g'
### Recipe bits follow...
COMPONENT_PREP_ACTION =    ( cd $(SOURCE_DIR) && ./autogen.sh )
COMPONENT_PRE_CONFIGURE_ACTION =    ( $(CLONEY) $(SOURCE_DIR) $(@D) )
CONFIGURE_ENV.32+=    LDFLAGS="$(LDFLAGS.32)"
CONFIGURE_ENV.64+=    LDFLAGS="$(LDFLAGS.64)"
CONFIGURE_OPTIONS.32+=    LDFLAGS="$(LDFLAGS.32)"
CONFIGURE_OPTIONS.64+=    LDFLAGS="$(LDFLAGS.64)"
CONFIGURE_OPTIONS +=    --disable-static
CONFIGURE_OPTIONS +=    --enable-shared
CONFIGURE_OPTIONS +=    --with-user=$(NUTUSER)
CONFIGURE_OPTIONS +=    --with-group=$(NUTGROUP)
CONFIGURE_OPTIONS +=    --sysconfdir=/$(NUTETCDIR)
CONFIGURE_OPTIONS +=    --sharedstatedir=/$(NUTSHAREDIR)
CONFIGURE_OPTIONS +=    --datarootdir=/$(NUTSHAREDIR)
CONFIGURE_OPTIONS +=    --with-hotplug-dir=/$(NUTHOTPLUGDIR)
CONFIGURE_OPTIONS +=    --with-udev-dir=/$(NUTUDEVDIR)
CONFIGURE_OPTIONS +=    --with-pidpath=/$(NUTPIDPATH)
CONFIGURE_OPTIONS +=    --with-statepath=/$(NUTSTATEDIR)
CONFIGURE_OPTIONS +=    --with-systemdsystemunitdir=no
CONFIGURE_OPTIONS +=    --with-dev
CONFIGURE_OPTIONS +=    --with-libltdl
CONFIGURE_OPTIONS +=    --with-ssl
CONFIGURE_OPTIONS +=    --with-openssl
CONFIGURE_OPTIONS.32 +=    --with-drvpath=/$(NUTDRVDIR)
CONFIGURE_OPTIONS.32 +=    --with-cgipath=/$(NUTCGIDIR)
CONFIGURE_OPTIONS.64 +=    --with-drvpath=/$(NUTDRVDIR)/$(MACH64)
CONFIGURE_OPTIONS.64 +=    --with-cgipath=/$(NUTCGIDIR)/$(MACH64)
# No separate toggle for this yet
#CONFIGURE_OPTIONS +=    --with-nut-scanner=yes
# Minimize guesswork: these are features we can and do build and deliver in
# package manifest, so the build host must have relevant packages installed
CONFIGURE_OPTIONS +=    --with-serial=yes
CONFIGURE_OPTIONS +=    --with-usb=yes
CONFIGURE_OPTIONS +=    --with-neon=yes
CONFIGURE_OPTIONS +=    --with-avahi=yes
CONFIGURE_OPTIONS +=    --with-powerman=yes
CONFIGURE_OPTIONS +=    --with-cgi=yes
CONFIGURE_OPTIONS +=    --with-ipmi=yes
CONFIGURE_OPTIONS +=    --with-freeipmi=yes
# Likely we'll not have this backend working any time soon
CONFIGURE_OPTIONS +=    --with-linux_i2c=no
CONFIGURE_OPTIONS +=    --with-macosx_ups=no
# Note: Link with the correct ISA of net-snmp (for drivers) and gdlib (for cgi)
CONFIGURE_OPTIONS +=    --with-snmp
CONFIGURE_OPTIONS +=    --with-net-snmp-config=$(USRBINDIR)/net-snmp-config-$(BITS)
CONFIGURE_OPTIONS.32 +=    --with-gdlib-config=$(USRBINDIR)/gdlib-config
CONFIGURE_OPTIONS.64 +=    --with-gdlib-config=$(USRBINDIR64)/gdlib-config
# Note: building the numerous documents of this projects is time-consuming
# and we only need one copy. Also, we don't ship "dblatex" (needed here for
# compiling PDFs) and probably don't require "html-chunked" chapters.
CONFIGURE_OPTIONS.32 +=    --with-doc="man=yes"
CONFIGURE_OPTIONS.64 +=    --with-doc="no"
### Avoid occasionally possible hangs with chunked HTML doc, if we build it
### by using the verbosity option (as suggested by one of NUT docs Makefiles).
### Not sure if it helps with just manpage builds, but does not hurt either ;)
#CONFIGURE_OPTIONS +=    --with-doc="auto"
CONFIGURE_OPTIONS +=    ASCIIDOC_VERBOSE="-v"
CONFIGURE_ENV     +=    ASCIIDOC_VERBOSE="-v"
CONFIGURE_OPTIONS +=    $(CONFIGURE_OPTIONS.$(BITS))
build: $(BUILD_32_and_64)
$(PROTO_DIR)/$(NUTETCDIR)/README-NUT-etc.txt: files/README-NUT-etc.txt.in
    $(MKDIR) -p $(@D)
    $(GSED) $(NUTSEDSUBST) < $< > $@
    egrep '\@(NUT|MACH)' $@ >&2 && \
        echo "ERROR: Some unconverted tags remain in $@" >&2 && $(RM) $@ && exit 1 ; true
$(PROTO_DIR)/lib/svc/method/svc-nut: files/nut.in
    $(MKDIR) -p $(@D)
    $(GSED) $(NUTSEDSUBST) < $< > $@
    egrep '\@(NUT|MACH)' $@ >&2 && \
        echo "ERROR: Some unconverted tags remain in $@" >&2 && $(RM) $@ && exit 1 ; true
    chmod 755 $@
# Ensure installed configs etc. match 32-bit paths
$(INSTALL_32): $(INSTALL_64) \
  $(PROTO_DIR)/$(NUTETCDIR)/README-NUT-etc.txt \
  $(PROTO_DIR)/lib/svc/method/svc-nut
install: $(INSTALL_32_and_64)
    $(INSTALL) -m 644 $(BUILD_DIR_32)/scripts/avahi/nut.service \
        $(PROTO_DIR)/$(NUT_AVAHI_SERVICE_SAMPLE)
test: $(TEST_32_and_64)
REQUIRED_PACKAGES += library/gd
REQUIRED_PACKAGES += library/libtool/libltdl
REQUIRED_PACKAGES += library/neon
REQUIRED_PACKAGES += library/security/openssl
REQUIRED_PACKAGES += SUNWcs
REQUIRED_PACKAGES += system/library
REQUIRED_PACKAGES += system/library/g++-4-runtime
REQUIRED_PACKAGES += system/library/gcc-4-runtime
REQUIRED_PACKAGES += system/library/math
REQUIRED_PACKAGES += system/library/usb/libusb
REQUIRED_PACKAGES += system/management/freeipmi
REQUIRED_PACKAGES += system/management/powerman
REQUIRED_PACKAGES += system/management/snmp/net-snmp
components/sysutils/nut/files/README-NUT-etc.txt.in
New file
@@ -0,0 +1,67 @@
This is the directory for Network UPS Tools configuration files,
as distributed by OpenIndiana Hipster userland consolidation.
Distributed examples are provided as `@NUTETCSAMPLEDIR@/*.sample`.
Actual configuration files are loaded by programs from `@NUTETCDIR@`.
General workflow is to copy distributed samples into actual files
and modify the copies as fits your situation.
NOTE: Take care about proper ownership and access bits of configuration
files, especially for those with credentials.
The `nut.conf` file controls the default init-script activity about
this OS instance's role regarding the power device monitoring.
On a NUT server machine that directly tracks UPS states, you must
configure:
* `ups.conf` with a block for each driver configuration (required)
* `upsd.users` with a block for each set of credentials and allowed
  actions so different clients can do different things (required for
  monitoring, `upsrw` CGI and other clients)
* `upsd.conf` can customize `upsd` server settings (optional)
On a NUT client with `upsmon` for graceful shutdown (may be or not be
the same as teh NUT server machine), you must configure:
* `upsmon.conf` with a `MONITOR` line for each monitored UPS, including
  how many power-supplies of this server it feeds, and a `MINSUPPLIES`
  line to define the critical threshold (how many power-supplies should
  have stable external power conditions for the system to not start its
  graceful shutdown when UPS battery goes critical). Note that an admin
  workstation can monitor lots of devices with none (0) feeding it, just
  to aggregate notifications about state changes, etc. in one place.
  There are also other settings to configure for communication frequency,
  shutdown and notifications.
On a NUT client with `upssched` you can configure complex reactions to
change in UPS state, including a way to ignore occasional short-lived
state flip-flops. The daemon tracks the beginning of some state and sets
a user-defined delayed timer to react to the state later - unless the
state is cleared before the timeout. To use this facility, you must
configure:
* `upssched.conf` with settings for events and reactions
* `upssched-cmd` is a sample script with a `case` structure to handle events
For CGI clients you should set up the web-server of your choice accordingly
to run the binaries provided in @NUTCGIDIR@, and configure:
* `upsset.conf` contains a flag that you must set to assert that you
  have indeed configured and enabled CGI clients knowingly, and have set
  up proper web-server security (required)
* `hosts.conf` contains a list of `MONITOR`ed devices that the CGI clients
  would display and/or send commands to (required)
* `upsstats.html` and `upsstats-single.html` are templates for rendering
  the CGI web-interface regarding all known, or a specific chosen, devices.
Beside directly NUT configuration examples, this distribution may include:
* `/@NUT_AVAHI_SERVICE_SAMPLE@` with settings for
  mDNS announcement of NUT service on the Avahi zero-conf subnet.
  This sample may be imported into your Avahi installation, which is
  out of scope for NUT packaging effort at this moment.
* `@NUTUDEVDIR@` with sample `udev` configuration (not
  directly applicable to Solaris-like platforms, but can be useful
  as an information source to set up USB connections); similarly for
  an `upower-hid` sample.
** Note that this distribution delivers sime `libhid` rules for UPSes
  into `@NUTHOTPLUGDIR@/usb/`
Hope this helps,
//Jim Klimov
components/sysutils/nut/files/notifyme
New file
@@ -0,0 +1,76 @@
#!/bin/sh
# Called by upsmon when important things happen
# Env contains UPSNAME like "ups1@localhost",
# a NOTIFYTYPE like "ONLINE", and $1="My message"
# (C) 2000-2006,2016 by Jim Klimov
LANG=C
LC_ALL=C
TZ=UTC
export LANG LC_ALL TZ
[ -s /etc/nut/notifyme.conf ] && . /etc/nut/notifyme.conf
# By default, we send a message to root@localhost and a syslog event
[ -n "${MAILPROG-}" ] || MAILPROG="mail"
[ -n "${UPSMONNAMELONG-}" ] || UPSMONNAMELONG="the UPSMon-`hostname`"
[ -n "${UPSMON_SYSLOGPRIO_TROUBLE-}" ] || UPSMON_SYSLOGPRIO_TROUBLE="daemon.emerg"
[ -n "${UPSMON_SYSLOGPRIO_GOODNOW-}" ] || UPSMON_SYSLOGPRIO_GOODNOW="$UPSMON_SYSLOGPRIO_TROUBLE"
#[ -n "${UPSMON_SYSLOGPRIO_GOODNOW-}" ] || UPSMON_SYSLOGPRIO_GOODNOW="daemon.notice"
# Additionally, we can send a short SMS via email, if the admin has it set up
# SMSMAIL="sms2mail.account@mobile.operator"
[ -n "${SMSMAIL-}" ] || SMSMAIL=""
[ -n "${UPSMONNAMESMS-}" ] || UPSMONNAMESMS="UPSMon@`hostname`"
now="`date -u '%Y-%m-%d %H:%M:%S'`"
message="$1"
plea=""
[ x"$NOTIFYTYPE" != xONLINE -a x"$NOTIFYTYPE" != xCOMMOK ] && plea="
Please do something with power!
My shutdown will be clean, but...
"
# 1) Alert all consoles, syslog (and maybe email - depending on syslog daemon)
if [ -x /usr/bin/logger ]; then
    [ -n "$plea" ] && \
        SYSLOG_PRIO="$UPSMON_SYSLOGPRIO_TROUBLE" || \
        SYSLOG_PRIO="$UPSMON_SYSLOGPRIO_GOODNOW"
    /usr/bin/logger -p "$SYSLOG_PRIO" -t "upsmon.notifyme.$$" "$UPSNAME: $NOTIFYTYPE : $message (at $now)" "$plea"
fi
case "$MAILPROG" in
    "") ;;
    /*) ;;
    *) MAILPROG="`which "$MAILPROG" | head -1 | egrep '^/'`" ;;
esac
[ -n "$MAILPROG" ] || exit 0
[ -x "$MAILPROG" ] || { echo "ERROR: MAILPROG='$MAILPROG' was specified but is not executable">&2; exit 1; }
# 2) send local mail so I know when the $it has hit the fan
# If it's local power trouble in the serverroom,
# I might go fix it before it's too late :^)
${MAILPROG} root -s "UPS status change: $NOTIFYTYPE" << EOF
$UPSNAME
$now
UPS status change: $NOTIFYTYPE
$message
$plea
Sincerely, $UPSMONNAMELONG
EOF
if [ -n "${SMSMAIL-}" ]; then
    # 3) Send an SMS to the admin
    ${MAILPROG} "$SMSMAIL" -s "UPS!" << EOF
$now
$UPSNAME: $NOTIFYTYPE
$message
//$UPSMONNAMESMS
EOF
fi
components/sysutils/nut/files/nut.in
New file
@@ -0,0 +1,84 @@
#!/sbin/sh
# Trivial (better is yet to come) SMF method script to start nut services
# Adapted for OpenIndiana userland from init.d script template in NUT sources
# Adaptation copyright (C) 2016 Jim Klimov
if [ -z "$SMF_FMRI" ]; then
    echo "$0 must be called in SMF context!" &>2
    exit 1
fi
# smf(5)
. /lib/svc/share/smf_include.sh || exit
NUT_DIR="@USRDIR@"
NUT_SBIN_DIR="$NUT_DIR/sbin"
#NUT_SBIN_DIR="$NUT_DIR/sbin/@MACH64@"
NUT_RUN_DIR="/@NUTRUNDIR@"
NUTUSER="@NUTUSER@"
NUTGROUP="@NUTGROUP@"
CONFIG="/@NUTETCDIR@/nut.conf"
if [ -f "$CONFIG" ] ; then
    . "$CONFIG"
fi
ups_stop () {
    pkill -n upsmon
    pkill -n upsd
    "${NUT_SBIN_DIR}"/upsdrvctl stop > /dev/null 2>&1
}
ups_start () {
    if [ "$MODE" = "none" ];then
        echo "No NUT mode set" >&2
        exit $SMF_EXIT_ERR_CONFIG
    fi
    # Default rights inspired by NUT scripts/Solaris/postinstall.in
    mkdir -p "$NUT_RUN_DIR" && \
    chown "root:$NUTGROUP" "$NUT_RUN_DIR" && \
    chmod 770 "$NUT_RUN_DIR" \
    || exit $SMF_EXIT_ERR_FATAL
    if [ ! "$MODE" = "netclient" ];then
        "${NUT_SBIN_DIR}"/upsdrvctl start #> /dev/null 2>&1
        "${NUT_SBIN_DIR}"/upsd #> /dev/null 2>&1
    fi
    "${NUT_SBIN_DIR}"/upsmon #> /dev/null 2>&1
}
case "$1" in
'start')
    ups_start
    ;;
'stop')
    ups_stop
    ;;
'restart')
    ups_stop
    while pgrep upsd > /dev/null
    do
        sleep 1
    done
    ups_start
    ;;
'poweroff')
    "${NUT_SBIN_DIR}"/upsmon -K  >/dev/null 2>&1
    if [ $? = 0 ]; then
        echo "Shutting down the UPS ..."
        #"${NUT_SBIN_DIR}"/upsdrvctl shutdown
    fi
    ;;
*)
    echo ""
    echo "Usage: '$0' {start | stop | restart }"
    echo ""
    exit $SMF_EXIT_ERR_CONFIG
    ;;
esac
exit $?
components/sysutils/nut/files/nut.xml
New file
@@ -0,0 +1,135 @@
<?xml version="1.0"?>
<!--
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source.  A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#
-->
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<!--
#
# Copyright 2016 Jim Klimov
#
-->
<service_bundle type='manifest' name='nut:allInOne'>
    <service name='system/power/nut' type='service' version='1'>
    <!--
      Configure a default instance for the service since it doesn't
      require additional configuration intervention before it starts.
    -->
        <create_default_instance enabled='false' />
    <!--
      Wait for all local and usr filesystem to be mounted - project is
      located in /usr/sbin.
    -->
        <dependency
        name='fs-local'
        type='service'
        grouping='require_all'
        restart_on='none'>
            <service_fmri value='svc:/system/filesystem/local' />
        </dependency>
        <dependency
        name='filesystem-usr'
        grouping='require_all'
        restart_on='none'
        type='service'>
            <service_fmri
        value='svc:/system/filesystem/usr:default'/>
        </dependency>
    <!--
      Wait for syslog to be started in order to write system
      messages from the kernel. -- Not a hard requirement good for everybody.
    -->
<!--
        <dependency
        name='syslog'
        grouping='optional_all'
        restart_on='none'
        type='service'>
            <service_fmri
        value='svc:/system/system-log:default'/>
        </dependency>
-->
    <!--
      Wait for network to be started in order to reach remote hosts.
      - Not required on standalone machines using serial or USB UPSes
    -->
<!--
        <dependency
        name='network-service'
        grouping='require_all'
        restart_on='none'
        type='service'>
            <service_fmri value='svc:/network/service' />
        </dependency>
-->
    <!--
      The nut start/stop methods.
    -->
        <exec_method
        type='method'
        name='start'
        exec='/lib/svc/method/svc-nut %m'
        timeout_seconds='60'/>
        <exec_method
        type='method'
        name='stop'
        exec='/lib/svc/method/svc-nut %m'
        timeout_seconds='60' />
        <property_group name='startd' type='framework'>
        <!--
          Sub-process core dumps and external kill signals are not
          considered errors, so the service should be restarted.
            -->
            <propval name='ignore_error' type='astring'
             value='core,signal' />
        </property_group>
    <!-- Really unstable - this service should be evolved! -->
        <stability value='Unstable' />
        <template>
            <common_name>
                <loctext xml:lang='C'>
                NUT all-in-one SMF wrapper
                </loctext>
            </common_name>
            <documentation>
                <manpage title='upsdrvctl' section='8'
                manpath='/usr/share/man' />
                <manpage title='upsd' section='8'
                manpath='/usr/share/man' />
                <manpage title='upsmon' section='8'
                manpath='/usr/share/man' />
                <manpage title='ups.conf' section='5'
                manpath='/usr/share/man' />
                <manpage title='upsmon.conf' section='5'
                manpath='/usr/share/man' />
                <manpage title='upsd.conf' section='5'
                manpath='/usr/share/man' />
                <manpage title='upsd.users' section='5'
                manpath='/usr/share/man' />
            </documentation>
        </template>
    </service>
</service_bundle>
components/sysutils/nut/nut-augeas.p5m
New file
@@ -0,0 +1,42 @@
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source.  A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#
#
# Copyright 2016 Jim Klimov
#
set name=pkg.fmri value=pkg:/$(COMPONENT_FMRI)/augeas@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
set name=pkg.summary value="$(COMPONENT_SUMMARY) - NUT Augeas config-mgmt lenses"
set name=info.classification value="$(COMPONENT_CLASSIFICATION)"
set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
license $(COMPONENT_LICENSE_FILE) license='$(COMPONENT_LICENSE)'
# This binding needs Augeas to be functional, but we don't want to require
# installation of augtools if the end-user just installs the grouper package
# and really only wants NUT core, not the bindings. Vice-versa, the binding
# does not really require files from the NUT project itself.
# So: the main "nut.p5m" has a conditional dependency to install "nut-augeas"
# only if "augeas-tools" are installed; while the "nut-augeas" package simply
# requires augtools and does not depend on any of NUT packages to be present.
depend fmri=library/augeas-tools type=require
### Augeas configuration licenses for NUT
file path=usr/share/augeas/lenses/nuthostsconf.aug
file path=usr/share/augeas/lenses/nutnutconf.aug
file path=usr/share/augeas/lenses/nutupsconf.aug
file path=usr/share/augeas/lenses/nutupsdconf.aug
file path=usr/share/augeas/lenses/nutupsdusers.aug
file path=usr/share/augeas/lenses/nutupsmonconf.aug
file path=usr/share/augeas/lenses/nutupsschedconf.aug
file path=usr/share/augeas/lenses/nutupssetconf.aug
components/sysutils/nut/nut-bins.p5m
New file
@@ -0,0 +1,145 @@
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source.  A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#
#
# Copyright 2016 Jim Klimov
#
set name=pkg.fmri value=pkg:/$(COMPONENT_FMRI)/bins@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
set name=pkg.summary value="$(COMPONENT_SUMMARY) - NUT Command-line binaries and scripts"
set name=info.classification value="$(COMPONENT_CLASSIFICATION)"
set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
license $(COMPONENT_LICENSE_FILE) license='$(COMPONENT_LICENSE)'
<transform file path=usr.*/man/.+ -> default mangler.man.stability uncommitted>
depend fmri=$(COMPONENT_FMRI)-common@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) type=require
### NUT Command-line binaries and scripts (daemons, clients)
### Note: While nut-scanner can use snmp, neon/xml, ipmi and usb libs, it loads
### them truly dynamically (if available) and skips otherwise. Installing the
### NUT driver packages should pull their relevant libs by harder ELF reqs.
### Reasonably, if you don't want those UPSes (got no drivers) why scan them? :)
file path=usr/bin/$(MACH64)/nut-scanner
file path=usr/bin/$(MACH64)/upsc
file path=usr/bin/$(MACH64)/upscmd
file path=usr/bin/$(MACH64)/upslog
file path=usr/bin/$(MACH64)/upsrw
file path=usr/bin/nut-scanner
file path=usr/bin/upsc
file path=usr/bin/upscmd
file path=usr/bin/upslog
file path=usr/bin/upsrw
file path=usr/sbin/$(MACH64)/upsd
file path=usr/sbin/$(MACH64)/upsdrvctl
file path=usr/sbin/$(MACH64)/upsmon
file path=usr/sbin/$(MACH64)/upssched
file path=usr/sbin/upsd
file path=usr/sbin/upsdrvctl
file path=usr/sbin/upsmon
file path=usr/sbin/upssched
# Example notification script for UPSMON
file files/notifyme path=$(NUTDRVDIR)/notifyme preserve=renamenew
# This is an example script for handling upssched
file path=usr/bin/upssched-cmd preserve=renamenew
# Init-scripts for NUT, not perfect - but better than nothing for a start
# Note that it is practically blocked by default `nut.conf` until changed
# by administrator. We might deliver another script in its place later on.
# NUT should start generally after networking (if SNMP or NetXML is used,
# or if this box is a client to remote upsd). Ending is trickier - could
# want it to issue killpower late in shutdown, but have network to be able
# to do so (for remote UPSes). This can be tuned in XML manifest by user.
file path=lib/svc/method/svc-nut owner=bin group=bin mode=555
file files/nut.xml path=var/svc/manifest/application/nut.xml \
     restart_fmri=svc:/system/manifest-import:default
file path=usr/share/man/man5/hosts.conf.5
file path=usr/share/man/man5/nut.conf.5
file path=usr/share/man/man5/ups.conf.5
file path=usr/share/man/man5/upsd.conf.5
file path=usr/share/man/man5/upsd.users.5
file path=usr/share/man/man5/upsmon.conf.5
file path=usr/share/man/man5/upssched.conf.5
file path=usr/share/man/man8/nut-scanner.8
file path=usr/share/man/man8/upsc.8
file path=usr/share/man/man8/upscmd.8
file path=usr/share/man/man8/upsd.8
file path=usr/share/man/man8/upsdrvctl.8
file path=usr/share/man/man8/upslog.8
file path=usr/share/man/man8/upsmon.8
file path=usr/share/man/man8/upsrw.8
file path=usr/share/man/man8/upssched.8
# NUT starter examples are by convention across many distros delivered in /etc
# Default rights inspired by scripts/Solaris/postinstall.in
file $(NUTETCDIR)/nut.conf.sample path=$(NUTETCSAMPLEDIR)/nut.conf.sample \
    group=$(NUTGROUP) owner=root mode=0440
file $(NUTETCDIR)/ups.conf.sample path=$(NUTETCSAMPLEDIR)/ups.conf.sample \
    group=$(NUTGROUP) owner=root mode=0440
file $(NUTETCDIR)/upsd.conf.sample path=$(NUTETCSAMPLEDIR)/upsd.conf.sample \
    group=$(NUTGROUP) owner=root mode=0440
file $(NUTETCDIR)/upsd.users.sample path=$(NUTETCSAMPLEDIR)/upsd.users.sample \
    group=$(NUTGROUP) owner=root mode=0440
file $(NUTETCDIR)/upsmon.conf.sample path=$(NUTETCSAMPLEDIR)/upsmon.conf.sample \
    group=$(NUTGROUP) owner=root mode=0440
file $(NUTETCDIR)/upssched.conf.sample path=$(NUTETCSAMPLEDIR)/upssched.conf.sample \
    group=$(NUTGROUP) owner=root mode=0440
# We can actually deliver the sample configs as the ones to use,
# at worst they have no actual information inside and do nothing.
# Also, the daemons are disabled by default `nut.conf` contents
file $(NUTETCDIR)/nut.conf.sample path=$(NUTETCDIR)/nut.conf \
    group=$(NUTGROUP) owner=root mode=0440 preserve=true
file $(NUTETCDIR)/ups.conf.sample path=$(NUTETCDIR)/ups.conf \
    group=$(NUTGROUP) owner=root mode=0440 preserve=true
file $(NUTETCDIR)/upsd.conf.sample path=$(NUTETCDIR)/upsd.conf \
    group=$(NUTGROUP) owner=root mode=0440 preserve=true
file $(NUTETCDIR)/upsd.users.sample path=$(NUTETCDIR)/upsd.users \
    group=$(NUTGROUP) owner=root mode=0440 preserve=true
file $(NUTETCDIR)/upsmon.conf.sample path=$(NUTETCDIR)/upsmon.conf \
    group=$(NUTGROUP) owner=root mode=0440 preserve=true
file $(NUTETCDIR)/upssched.conf.sample path=$(NUTETCDIR)/upssched.conf \
    group=$(NUTGROUP) owner=root mode=0440 preserve=true
# Integration with dynamically added devices (USB mostly)
# TODO pedantic: split this off to depend on some USB/hotplug/udev package(s)?
file path=$(NUTHOTPLUGDIR)/usb/libhid.usermap preserve=renamenew
file path=$(NUTHOTPLUGDIR)/usb/libhidups preserve=renamenew
# README also suggests running `udevadm trigger --subsystem-match=usb_device`
# Maybe on another iteration this would help us fix up illumos definitions?
###TODO:IPMI### file path=$(NUTUDEVDIR)/rules.d/52-nut-ipmipsu.rules preserve=renamenew
file path=$(NUTUDEVDIR)/rules.d/62-nut-usbups.rules preserve=renamenew
# Maybe on another iteration this would help us fix up illumos definitions?
file scripts/upower/95-upower-hid.rules path=$(NUTETCSAMPLEDIR)/95-upower-hid.rules.sample
# TODO pedantic: split this off to depend on avahi package?
# Also make sure which path that would go into for actual installation?
file path=$(NUT_AVAHI_SERVICE_SAMPLE)
# TODO pedantic: split this off to depend on logrotate package?
file scripts/logrotate/nutlogd path=etc/logrotate.d/nutlogd preserve=renamenew
# TODO pedantic: split this off to depend on bash package?
file scripts/misc/nut.bash_completion path=usr/share/bash-completion/completions/nut
components/sysutils/nut/nut-cgi.p5m
New file
@@ -0,0 +1,74 @@
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source.  A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#
#
# Copyright 2016 Jim Klimov
#
set name=pkg.fmri value=pkg:/$(COMPONENT_FMRI)/cgi@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
set name=pkg.summary value="$(COMPONENT_SUMMARY) - NUT CGI clients"
set name=info.classification value="$(COMPONENT_CLASSIFICATION)"
set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
license $(COMPONENT_LICENSE_FILE) license='$(COMPONENT_LICENSE)'
<transform file path=$(NUTCGIDIR)/+ -> default mode 0555>
<transform dir path=$(NUTCGIDIR) -> set group bin>
<transform file path=usr.*/man/.+ -> default mangler.man.stability uncommitted>
depend fmri=$(COMPONENT_FMRI)-common@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) type=require
### NUT CGI clients, require libgd
file path=$(NUTCGIDIR)/$(MACH64)/upsimage.cgi
file path=$(NUTCGIDIR)/$(MACH64)/upsset.cgi
file path=$(NUTCGIDIR)/$(MACH64)/upsstats.cgi
file path=$(NUTCGIDIR)/upsimage.cgi
file path=$(NUTCGIDIR)/upsset.cgi
file path=$(NUTCGIDIR)/upsstats.cgi
file path=usr/share/man/man5/upsset.conf.5
file path=usr/share/man/man5/upsstats.html.5
file path=usr/share/man/man8/upsimage.cgi.8
file path=usr/share/man/man8/upsset.cgi.8
file path=usr/share/man/man8/upsstats.cgi.8
# Default rights inspired by scripts/Solaris/postinstall.in
file $(NUTETCDIR)/hosts.conf.sample \
    path=$(NUTETCSAMPLEDIR)/hosts.conf.sample \
    group=$(NUTGROUP) owner=root mode=0440
file $(NUTETCDIR)/upsset.conf.sample \
    path=$(NUTETCSAMPLEDIR)/upsset.conf.sample \
    group=$(NUTGROUP) owner=root mode=0440
file $(NUTETCDIR)/upsstats-single.html.sample \
    path=$(NUTETCSAMPLEDIR)/upsstats-single.html.sample \
    group=$(NUTGROUP) owner=root mode=0440
file $(NUTETCDIR)/upsstats.html.sample \
    path=$(NUTETCSAMPLEDIR)/upsstats.html.sample \
    group=$(NUTGROUP) owner=root mode=0440
# We can actually deliver the sample configs as the ones to use,
# at worst they have no actual information inside and do nothing.
# Also, the CGIs are disabled by default `upsset.conf` contents
file $(NUTETCDIR)/hosts.conf.sample \
    path=$(NUTETCDIR)/hosts.conf \
    group=$(NUTGROUP) owner=root mode=0440 preserve=true
file $(NUTETCDIR)/upsset.conf.sample \
    path=$(NUTETCDIR)/upsset.conf \
    group=$(NUTGROUP) owner=root mode=0440 preserve=true
file $(NUTETCDIR)/upsstats-single.html.sample \
    path=$(NUTETCDIR)/upsstats-single.html \
    group=$(NUTGROUP) owner=root mode=0440 preserve=true
file $(NUTETCDIR)/upsstats.html.sample \
    path=$(NUTETCDIR)/upsstats.html \
    group=$(NUTGROUP) owner=root mode=0440 preserve=true
components/sysutils/nut/nut-common.p5m
New file
@@ -0,0 +1,48 @@
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
# Copyright (c) 2016 Jim Klimov. All rights reserved.
#
set name=pkg.fmri \
    value=pkg:/$(COMPONENT_FMRI)-common@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
set name=pkg.summary value="$(COMPONENT_SUMMARY) (Base accounts and dirs)"
set name=info.classification value="$(COMPONENT_CLASSIFICATION)"
set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
license $(COMPONENT_LICENSE_FILE) license='$(COMPONENT_LICENSE)'
# Ensure the UID exists till the end, until after the main packages are removed
# and in particular do not move databases and logs into lost+found on uninstall
# Note the locked user password is NL (not NP) because it has to manage crontab
# Default rights inspired by scripts/Solaris/postinstall.in
group groupname=$(NUTGROUP) gid=77
user ftpuser=false gcos-field="Network UPS Tools Reserved UID" \
    group=$(NUTGROUP) group-list=root \
    password=NL username=$(NUTUSER) uid=77
# These directories can hold some content generated or downloaded at runtime
# and can become lost+found when you un/re-install the core packages (if these
# pkg actions are delivered there instead)
dir group=$(NUTGROUP) owner=root mode=0775 path=$(NUTETCDIR)
dir group=$(NUTGROUP) owner=root mode=0770 path=$(NUTSTATEDIR)
file path=$(NUTETCDIR)/README-NUT-etc.txt owner=root group=bin
components/sysutils/nut/nut-devtools.p5m
New file
@@ -0,0 +1,35 @@
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source.  A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#
#
# Copyright 2016 Jim Klimov
#
set name=pkg.fmri value=pkg:/$(COMPONENT_FMRI)/devtools@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
set name=pkg.summary value="$(COMPONENT_SUMMARY) - NUT DDL development helper tools"
set name=info.classification value="$(COMPONENT_CLASSIFICATION)"
set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
license $(COMPONENT_LICENSE_FILE) license='$(COMPONENT_LICENSE)'
<transform file path=usr.*/man/.+ -> default mangler.man.stability uncommitted>
### NUT Tools for project development and debugging
file tools/nut-recorder.sh path=usr/bin/nut-recorder
file path=usr/share/man/man8/nut-recorder.8
file tools/nut-ddl-dump.sh path=usr/bin/nut-ddl-dump
### These only seem to make sense in the source tree
#file tools/nut-snmpinfo.py path=$(NUTUSRDIR)/bin/nut-snmpinfo.py
#file tools/nut-usbinfo.pl path=$(NUTUSRDIR)/bin/nut-usbinfo.pl
components/sysutils/nut/nut-driver-ipmi.p5m
New file
@@ -0,0 +1,33 @@
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source.  A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#
#
# Copyright 2016 Jim Klimov
#
set name=pkg.fmri value=pkg:/$(COMPONENT_FMRI)/drivers/ipmi@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
set name=pkg.summary value="$(COMPONENT_SUMMARY) - NUT drivers: IPMI"
set name=info.classification value="$(COMPONENT_CLASSIFICATION)"
set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
license $(COMPONENT_LICENSE_FILE) license='$(COMPONENT_LICENSE)'
<transform file path=$(NUTDRVDIR)/+ -> default mode 0555>
<transform dir path=$(NUTDRVDIR) -> set group bin>
<transform file path=usr.*/man/.+ -> default mangler.man.stability uncommitted>
### NUT DRIVERS : IPMI access to (blade) servers as sort of PDUs for
### the servers and particularly blades (GNU FreeIPMI package needed)
file path=$(NUTDRVDIR)/$(MACH64)/nut-ipmipsu
file path=$(NUTDRVDIR)/nut-ipmipsu
file path=usr/share/man/man8/nut-ipmipsu.8
components/sysutils/nut/nut-driver-netxml.p5m
New file
@@ -0,0 +1,32 @@
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source.  A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#
#
# Copyright 2016 Jim Klimov
#
set name=pkg.fmri value=pkg:/$(COMPONENT_FMRI)/drivers/netxml@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
set name=pkg.summary value="$(COMPONENT_SUMMARY) - NUT drivers: NetXML"
set name=info.classification value="$(COMPONENT_CLASSIFICATION)"
set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
license $(COMPONENT_LICENSE_FILE) license='$(COMPONENT_LICENSE)'
<transform file path=$(NUTDRVDIR)/+ -> default mode 0555>
<transform dir path=$(NUTDRVDIR) -> set group bin>
<transform file path=usr.*/man/.+ -> default mangler.man.stability uncommitted>
### NUT DRIVERS : HTTP/XML (extra libneon, ssl, zip, xml, ... needed)
file path=$(NUTDRVDIR)/$(MACH64)/netxml-ups
file path=$(NUTDRVDIR)/netxml-ups
file path=usr/share/man/man8/netxml-ups.8
components/sysutils/nut/nut-driver-powerman.p5m
New file
@@ -0,0 +1,32 @@
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source.  A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#
#
# Copyright 2016 Jim Klimov
#
set name=pkg.fmri value=pkg:/$(COMPONENT_FMRI)/drivers/powerman@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
set name=pkg.summary value="$(COMPONENT_SUMMARY) - NUT drivers: LLNL Powerman"
set name=info.classification value="$(COMPONENT_CLASSIFICATION)"
set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
license $(COMPONENT_LICENSE_FILE) license='$(COMPONENT_LICENSE)'
<transform file path=$(NUTDRVDIR)/+ -> default mode 0555>
<transform dir path=$(NUTDRVDIR) -> set group bin>
<transform file path=usr.*/man/.+ -> default mangler.man.stability uncommitted>
### NUT DRIVERS : POWERMAN (extra LLNL libpowerman needed)
file path=$(NUTDRVDIR)/$(MACH64)/powerman-pdu
file path=$(NUTDRVDIR)/powerman-pdu
file path=usr/share/man/man8/powerman-pdu.8
components/sysutils/nut/nut-driver-serial.p5m
New file
@@ -0,0 +1,148 @@
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source.  A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#
#
# Copyright 2016 Jim Klimov
#
set name=pkg.fmri value=pkg:/$(COMPONENT_FMRI)/drivers/serial@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
set name=pkg.summary value="$(COMPONENT_SUMMARY) - NUT drivers: serial and simple networking"
set name=info.classification value="$(COMPONENT_CLASSIFICATION)"
set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
license $(COMPONENT_LICENSE_FILE) license='$(COMPONENT_LICENSE)'
<transform file path=$(NUTDRVDIR)/+ -> default mode 0555>
<transform dir path=$(NUTDRVDIR) -> set group bin>
<transform file path=usr.*/man/.+ -> default mangler.man.stability uncommitted>
### NUT DRIVERS : Serial or simple networked (no/few extra libs needed)
# Note: apcupsd-ups is a network client to apcupsd project, but has
# no special runtime dependencies (just common libsocket, libnsl...)
file path=$(NUTDRVDIR)/$(MACH64)/apcupsd-ups
file path=$(NUTDRVDIR)/apcupsd-ups
file path=$(NUTDRVDIR)/$(MACH64)/al175
file path=$(NUTDRVDIR)/$(MACH64)/apcsmart
file path=$(NUTDRVDIR)/$(MACH64)/apcsmart-old
file path=$(NUTDRVDIR)/$(MACH64)/bcmxcp
file path=$(NUTDRVDIR)/$(MACH64)/belkin
file path=$(NUTDRVDIR)/$(MACH64)/belkinunv
file path=$(NUTDRVDIR)/$(MACH64)/bestfcom
file path=$(NUTDRVDIR)/$(MACH64)/bestfortress
file path=$(NUTDRVDIR)/$(MACH64)/bestuferrups
file path=$(NUTDRVDIR)/$(MACH64)/bestups
file path=$(NUTDRVDIR)/$(MACH64)/blazer_ser
file path=$(NUTDRVDIR)/$(MACH64)/etapro
file path=$(NUTDRVDIR)/$(MACH64)/everups
file path=$(NUTDRVDIR)/$(MACH64)/gamatronic
file path=$(NUTDRVDIR)/$(MACH64)/genericups
file path=$(NUTDRVDIR)/$(MACH64)/isbmex
file path=$(NUTDRVDIR)/$(MACH64)/ivtscd
file path=$(NUTDRVDIR)/$(MACH64)/liebert
file path=$(NUTDRVDIR)/$(MACH64)/liebert-esp2
file path=$(NUTDRVDIR)/$(MACH64)/masterguard
file path=$(NUTDRVDIR)/$(MACH64)/metasys
file path=$(NUTDRVDIR)/$(MACH64)/mge-shut
file path=$(NUTDRVDIR)/$(MACH64)/mge-utalk
file path=$(NUTDRVDIR)/$(MACH64)/microdowell
file path=$(NUTDRVDIR)/$(MACH64)/oldmge-shut
file path=$(NUTDRVDIR)/$(MACH64)/oneac
file path=$(NUTDRVDIR)/$(MACH64)/optiups
file path=$(NUTDRVDIR)/$(MACH64)/powercom
file path=$(NUTDRVDIR)/$(MACH64)/powerpanel
file path=$(NUTDRVDIR)/$(MACH64)/rhino
file path=$(NUTDRVDIR)/$(MACH64)/riello_ser
file path=$(NUTDRVDIR)/$(MACH64)/safenet
file path=$(NUTDRVDIR)/$(MACH64)/solis
file path=$(NUTDRVDIR)/$(MACH64)/tripplite
file path=$(NUTDRVDIR)/$(MACH64)/tripplitesu
file path=$(NUTDRVDIR)/$(MACH64)/upscode2
file path=$(NUTDRVDIR)/$(MACH64)/victronups
file path=$(NUTDRVDIR)/al175
file path=$(NUTDRVDIR)/apcsmart
file path=$(NUTDRVDIR)/apcsmart-old
file path=$(NUTDRVDIR)/bcmxcp
file path=$(NUTDRVDIR)/belkin
file path=$(NUTDRVDIR)/belkinunv
file path=$(NUTDRVDIR)/bestfcom
file path=$(NUTDRVDIR)/bestfortress
file path=$(NUTDRVDIR)/bestuferrups
file path=$(NUTDRVDIR)/bestups
file path=$(NUTDRVDIR)/blazer_ser
file path=$(NUTDRVDIR)/etapro
file path=$(NUTDRVDIR)/everups
file path=$(NUTDRVDIR)/gamatronic
file path=$(NUTDRVDIR)/genericups
file path=$(NUTDRVDIR)/isbmex
file path=$(NUTDRVDIR)/ivtscd
file path=$(NUTDRVDIR)/liebert
file path=$(NUTDRVDIR)/liebert-esp2
file path=$(NUTDRVDIR)/masterguard
file path=$(NUTDRVDIR)/metasys
file path=$(NUTDRVDIR)/mge-shut
file path=$(NUTDRVDIR)/mge-utalk
file path=$(NUTDRVDIR)/microdowell
file path=$(NUTDRVDIR)/oldmge-shut
file path=$(NUTDRVDIR)/oneac
file path=$(NUTDRVDIR)/optiups
file path=$(NUTDRVDIR)/powercom
file path=$(NUTDRVDIR)/powerpanel
file path=$(NUTDRVDIR)/rhino
file path=$(NUTDRVDIR)/riello_ser
file path=$(NUTDRVDIR)/safenet
file path=$(NUTDRVDIR)/solis
file path=$(NUTDRVDIR)/tripplite
file path=$(NUTDRVDIR)/tripplitesu
file path=$(NUTDRVDIR)/upscode2
file path=$(NUTDRVDIR)/victronups
file path=usr/share/man/man8/al175.8
file path=usr/share/man/man8/apcsmart-old.8
file path=usr/share/man/man8/apcsmart.8
file path=usr/share/man/man8/apcupsd-ups.8
file path=usr/share/man/man8/bcmxcp.8
file path=usr/share/man/man8/belkin.8
file path=usr/share/man/man8/belkinunv.8
file path=usr/share/man/man8/bestfcom.8
file path=usr/share/man/man8/bestfortress.8
file path=usr/share/man/man8/bestuferrups.8
file path=usr/share/man/man8/bestups.8
file path=usr/share/man/man8/blazer_ser.8
file path=usr/share/man/man8/etapro.8
file path=usr/share/man/man8/everups.8
file path=usr/share/man/man8/gamatronic.8
file path=usr/share/man/man8/genericups.8
file path=usr/share/man/man8/isbmex.8
file path=usr/share/man/man8/ivtscd.8
file path=usr/share/man/man8/liebert-esp2.8
file path=usr/share/man/man8/liebert.8
file path=usr/share/man/man8/masterguard.8
file path=usr/share/man/man8/metasys.8
file path=usr/share/man/man8/mge-shut.8
file path=usr/share/man/man8/mge-utalk.8
file path=usr/share/man/man8/microdowell.8
file path=usr/share/man/man8/nutupsdrv.8
file path=usr/share/man/man8/oneac.8
file path=usr/share/man/man8/optiups.8
file path=usr/share/man/man8/powercom.8
file path=usr/share/man/man8/powerpanel.8
file path=usr/share/man/man8/rhino.8
file path=usr/share/man/man8/riello_ser.8
file path=usr/share/man/man8/safenet.8
file path=usr/share/man/man8/solis.8
file path=usr/share/man/man8/tripplite.8
file path=usr/share/man/man8/tripplitesu.8
file path=usr/share/man/man8/upscode2.8
file path=usr/share/man/man8/victronups.8
components/sysutils/nut/nut-driver-snmp.p5m
New file
@@ -0,0 +1,32 @@
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source.  A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#
#
# Copyright 2016 Jim Klimov
#
set name=pkg.fmri value=pkg:/$(COMPONENT_FMRI)/drivers/snmp@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
set name=pkg.summary value="$(COMPONENT_SUMMARY) - NUT drivers: SNMP"
set name=info.classification value="$(COMPONENT_CLASSIFICATION)"
set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
license $(COMPONENT_LICENSE_FILE) license='$(COMPONENT_LICENSE)'
<transform file path=$(NUTDRVDIR)/+ -> default mode 0555>
<transform dir path=$(NUTDRVDIR) -> set group bin>
<transform file path=usr.*/man/.+ -> default mangler.man.stability uncommitted>
### NUT DRIVERS : SNMP (extra libnetsnmp, crypto, ... needed)
file path=$(NUTDRVDIR)/$(MACH64)/snmp-ups
file path=$(NUTDRVDIR)/snmp-ups
file path=usr/share/man/man8/snmp-ups.8
components/sysutils/nut/nut-driver-usb.p5m
New file
@@ -0,0 +1,55 @@
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source.  A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#
#
# Copyright 2016 Jim Klimov
#
set name=pkg.fmri value=pkg:/$(COMPONENT_FMRI)/drivers/usb@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
set name=pkg.summary value="$(COMPONENT_SUMMARY) - NUT drivers: USB"
set name=info.classification value="$(COMPONENT_CLASSIFICATION)"
set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
license $(COMPONENT_LICENSE_FILE) license='$(COMPONENT_LICENSE)'
<transform file path=$(NUTDRVDIR)/+ -> default mode 0555>
<transform dir path=$(NUTDRVDIR) -> set group bin>
<transform file path=usr.*/man/.+ -> default mangler.man.stability uncommitted>
### NUT DRIVERS : USB (extra libusb needed)
file path=$(NUTDRVDIR)/$(MACH64)/bcmxcp_usb
file path=$(NUTDRVDIR)/$(MACH64)/blazer_usb
file path=$(NUTDRVDIR)/$(MACH64)/nutdrv_atcl_usb
file path=$(NUTDRVDIR)/$(MACH64)/nutdrv_qx
file path=$(NUTDRVDIR)/$(MACH64)/richcomm_usb
file path=$(NUTDRVDIR)/$(MACH64)/riello_usb
file path=$(NUTDRVDIR)/$(MACH64)/tripplite_usb
file path=$(NUTDRVDIR)/$(MACH64)/usbhid-ups
file path=$(NUTDRVDIR)/bcmxcp_usb
file path=$(NUTDRVDIR)/blazer_usb
file path=$(NUTDRVDIR)/nutdrv_atcl_usb
file path=$(NUTDRVDIR)/nutdrv_qx
file path=$(NUTDRVDIR)/richcomm_usb
file path=$(NUTDRVDIR)/riello_usb
file path=$(NUTDRVDIR)/tripplite_usb
file path=$(NUTDRVDIR)/usbhid-ups
file path=usr/share/man/man8/bcmxcp_usb.8
file path=usr/share/man/man8/blazer_usb.8
file path=usr/share/man/man8/nutdrv_atcl_usb.8
file path=usr/share/man/man8/nutdrv_qx.8
file path=usr/share/man/man8/richcomm_usb.8
file path=usr/share/man/man8/riello_usb.8
file path=usr/share/man/man8/tripplite_usb.8
file path=usr/share/man/man8/usbhid-ups.8
components/sysutils/nut/nut-driver-virtual.p5m
New file
@@ -0,0 +1,41 @@
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source.  A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#
#
# Copyright 2016 Jim Klimov
#
set name=pkg.fmri value=pkg:/$(COMPONENT_FMRI)/drivers/virtual@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
set name=pkg.summary value="$(COMPONENT_SUMMARY) - NUT drivers: virtual"
set name=info.classification value="$(COMPONENT_CLASSIFICATION)"
set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
license $(COMPONENT_LICENSE_FILE) license='$(COMPONENT_LICENSE)'
<transform file path=$(NUTDRVDIR)/+ -> default mode 0555>
<transform dir path=$(NUTDRVDIR) -> set group bin>
<transform file path=usr.*/man/.+ -> default mangler.man.stability uncommitted>
### NUT DRIVERS : virtual (software to emulate or regroup real power hardware)
file path=$(NUTDRVDIR)/$(MACH64)/clone
file path=$(NUTDRVDIR)/$(MACH64)/clone-outlet
file path=$(NUTDRVDIR)/$(MACH64)/dummy-ups
file path=$(NUTDRVDIR)/clone
file path=$(NUTDRVDIR)/clone-outlet
file path=$(NUTDRVDIR)/dummy-ups
file path=usr/share/man/man8/clone.8
file path=usr/share/man/man8/dummy-ups.8
file data/evolution500.seq path=$(NUTETCSAMPLEDIR)/evolution500.seq.dummy-ups.sample
file data/epdu-managed.dev path=$(NUTETCSAMPLEDIR)/epdu-managed.dev.dummy-ups.sample
components/sysutils/nut/nut-drivers.p5m
New file
@@ -0,0 +1,31 @@
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source.  A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#
#
# Copyright 2016 Jim Klimov
#
set name=pkg.fmri value=pkg:/$(COMPONENT_FMRI)/drivers@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
set name=pkg.summary value="$(COMPONENT_SUMMARY) - Groups all types of NUT drivers"
set name=info.classification value="$(COMPONENT_CLASSIFICATION)"
set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
license $(COMPONENT_LICENSE_FILE) license='$(COMPONENT_LICENSE)'
depend fmri=$(COMPONENT_FMRI)/drivers/serial@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) type=require
depend fmri=$(COMPONENT_FMRI)/drivers/usb@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) type=require
depend fmri=$(COMPONENT_FMRI)/drivers/snmp@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) type=require
depend fmri=$(COMPONENT_FMRI)/drivers/netxml@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) type=require
depend fmri=$(COMPONENT_FMRI)/drivers/ipmi@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) type=require
depend fmri=$(COMPONENT_FMRI)/drivers/powerman@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) type=require
depend fmri=$(COMPONENT_FMRI)/drivers/virtual@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) type=require
components/sysutils/nut/nut-libs.p5m
New file
@@ -0,0 +1,133 @@
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source.  A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#
#
# Copyright 2016 Jim Klimov
#
set name=pkg.fmri value=pkg:/$(COMPONENT_FMRI)/libs@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
set name=pkg.summary value="$(COMPONENT_SUMMARY) - headers, libraries and their manpages"
set name=info.classification value="$(COMPONENT_CLASSIFICATION)"
set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
license $(COMPONENT_LICENSE_FILE) license='$(COMPONENT_LICENSE)'
<transform file path=usr.*/man/.+ -> default mangler.man.stability uncommitted>
### NUT Development files - headers, libraries and their manpages
file path=usr/include/nut-scan.h
file path=usr/include/nutclient.h
file path=usr/include/nutscan-device.h
file path=usr/include/nutscan-init.h
file path=usr/include/nutscan-ip.h
file path=usr/include/parseconf.h
file path=usr/include/upsclient.h
file path=usr/lib/$(MACH64)/libnutclient.so.0.0.0
link path=usr/lib/$(MACH64)/libnutclient.so target=libnutclient.so.0.0.0
link path=usr/lib/$(MACH64)/libnutclient.so.0 target=libnutclient.so.0.0.0
file path=usr/lib/$(MACH64)/libnutscan.so.1.0.0
link path=usr/lib/$(MACH64)/libnutscan.so target=libnutscan.so.1.0.0
link path=usr/lib/$(MACH64)/libnutscan.so.1 target=libnutscan.so.1.0.0
file path=usr/lib/$(MACH64)/libupsclient.so.4.0.0
link path=usr/lib/$(MACH64)/libupsclient.so target=libupsclient.so.4.0.0
link path=usr/lib/$(MACH64)/libupsclient.so.4 target=libupsclient.so.4.0.0
file path=usr/lib/$(MACH64)/pkgconfig/libnutclient.pc
file path=usr/lib/$(MACH64)/pkgconfig/libnutscan.pc
file path=usr/lib/$(MACH64)/pkgconfig/libupsclient.pc
file path=usr/lib/libnutclient.so.0.0.0
link path=usr/lib/libnutclient.so target=libnutclient.so.0.0.0
link path=usr/lib/libnutclient.so.0 target=libnutclient.so.0.0.0
file path=usr/lib/libnutscan.so.1.0.0
link path=usr/lib/libnutscan.so target=libnutscan.so.1.0.0
link path=usr/lib/libnutscan.so.1 target=libnutscan.so.1.0.0
file path=usr/lib/libupsclient.so.4.0.0
link path=usr/lib/libupsclient.so target=libupsclient.so.4.0.0
link path=usr/lib/libupsclient.so.4 target=libupsclient.so.4.0.0
file path=usr/lib/pkgconfig/libnutclient.pc
file path=usr/lib/pkgconfig/libnutscan.pc
file path=usr/lib/pkgconfig/libupsclient.pc
file path=usr/share/man/man3/libnutclient.3
file path=usr/share/man/man3/libnutclient_commands.3
file path=usr/share/man/man3/libnutclient_devices.3
file path=usr/share/man/man3/libnutclient_general.3
file path=usr/share/man/man3/libnutclient_misc.3
file path=usr/share/man/man3/libnutclient_tcp.3
file path=usr/share/man/man3/libnutclient_variables.3
file path=usr/share/man/man3/nutclient_authenticate.3
file path=usr/share/man/man3/nutclient_destroy.3
file path=usr/share/man/man3/nutclient_device_forced_shutdown.3
file path=usr/share/man/man3/nutclient_device_login.3
file path=usr/share/man/man3/nutclient_device_master.3
file path=usr/share/man/man3/nutclient_execute_device_command.3
file path=usr/share/man/man3/nutclient_get_device_command_description.3
file path=usr/share/man/man3/nutclient_get_device_commands.3
file path=usr/share/man/man3/nutclient_get_device_description.3
file path=usr/share/man/man3/nutclient_get_device_num_logins.3
file path=usr/share/man/man3/nutclient_get_device_rw_variables.3
file path=usr/share/man/man3/nutclient_get_device_variable_description.3
file path=usr/share/man/man3/nutclient_get_device_variable_values.3
file path=usr/share/man/man3/nutclient_get_device_variables.3
file path=usr/share/man/man3/nutclient_get_devices.3
file path=usr/share/man/man3/nutclient_has_device.3
file path=usr/share/man/man3/nutclient_has_device_command.3
file path=usr/share/man/man3/nutclient_has_device_variable.3
file path=usr/share/man/man3/nutclient_logout.3
file path=usr/share/man/man3/nutclient_set_device_variable_value.3
file path=usr/share/man/man3/nutclient_set_device_variable_values.3
file path=usr/share/man/man3/nutclient_tcp_create_client.3
file path=usr/share/man/man3/nutclient_tcp_disconnect.3
file path=usr/share/man/man3/nutclient_tcp_get_timeout.3
file path=usr/share/man/man3/nutclient_tcp_is_connected.3
file path=usr/share/man/man3/nutclient_tcp_reconnect.3
file path=usr/share/man/man3/nutclient_tcp_set_timeout.3
file path=usr/share/man/man3/nutscan.3
file path=usr/share/man/man3/nutscan_add_device_to_device.3
file path=usr/share/man/man3/nutscan_add_option_to_device.3
file path=usr/share/man/man3/nutscan_cidr_to_ip.3
file path=usr/share/man/man3/nutscan_display_parsable.3
file path=usr/share/man/man3/nutscan_display_ups_conf.3
file path=usr/share/man/man3/nutscan_free_device.3
file path=usr/share/man/man3/nutscan_get_serial_ports_list.3
file path=usr/share/man/man3/nutscan_init.3
file path=usr/share/man/man3/nutscan_new_device.3
file path=usr/share/man/man3/nutscan_scan_avahi.3
file path=usr/share/man/man3/nutscan_scan_eaton_serial.3
file path=usr/share/man/man3/nutscan_scan_ipmi.3
file path=usr/share/man/man3/nutscan_scan_nut.3
file path=usr/share/man/man3/nutscan_scan_snmp.3
file path=usr/share/man/man3/nutscan_scan_usb.3
file path=usr/share/man/man3/nutscan_scan_xml_http.3
file path=usr/share/man/man3/upscli_add_host_cert.3
file path=usr/share/man/man3/upscli_cleanup.3
file path=usr/share/man/man3/upscli_connect.3
file path=usr/share/man/man3/upscli_disconnect.3
file path=usr/share/man/man3/upscli_fd.3
file path=usr/share/man/man3/upscli_get.3
file path=usr/share/man/man3/upscli_init.3
file path=usr/share/man/man3/upscli_list_next.3
file path=usr/share/man/man3/upscli_list_start.3
file path=usr/share/man/man3/upscli_readline.3
file path=usr/share/man/man3/upscli_sendline.3
file path=usr/share/man/man3/upscli_splitaddr.3
file path=usr/share/man/man3/upscli_splitname.3
file path=usr/share/man/man3/upscli_ssl.3
file path=usr/share/man/man3/upscli_strerror.3
file path=usr/share/man/man3/upscli_upserror.3
file path=usr/share/man/man3/upsclient.3
# Some mapping files
file path=$(NUTSHAREDIR)/cmdvartab
file path=$(NUTSHAREDIR)/driver.list
components/sysutils/nut/nut.p5m
New file
@@ -0,0 +1,37 @@
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source.  A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#
#
# Copyright 2016 Jim Klimov
#
set name=pkg.fmri value=pkg:/$(COMPONENT_FMRI)@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
set name=pkg.summary value="$(COMPONENT_SUMMARY) - Groups all of NUT sub-packages"
set name=info.classification value="$(COMPONENT_CLASSIFICATION)"
set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
license $(COMPONENT_LICENSE_FILE) license='$(COMPONENT_LICENSE)'
# For the core functionality we need libs, bins and drivers
depend fmri=$(COMPONENT_FMRI)/libs@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) type=require
depend fmri=$(COMPONENT_FMRI)/bins@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) type=require
depend fmri=$(COMPONENT_FMRI)/drivers@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) type=require
# The following packages are optional - if installed, bind them to common version numbers
depend fmri=$(COMPONENT_FMRI)/devtools@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) type=optional
# TOTHINK: This might depend (type=conditional) on some http-server package with CGI support?
depend fmri=$(COMPONENT_FMRI)/cgi@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) type=optional
# If augtools are installed, then NUT packaging also requires its lenses to be installed
depend fmri=$(COMPONENT_FMRI)/augeas@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) type=conditional predicate=library/augeas-tools
components/sysutils/nut/patches/01-nut-configure-withDocsAuto.patch
New file
@@ -0,0 +1,71 @@
Fix merged in upstream so this patch should not be needed after nut-2.7.5 or so.
diff --git a/configure.ac b/configure.ac
index e16cf86..3c59b4b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -630,10 +630,13 @@ dnl is set to 'no', we may still want to build some doc targets manually
 NUT_CHECK_ASCIIDOC
 case "${nut_with_doc}" in
-    yes|all|auto)
+    yes|all)
         nut_doc_build_list="html-single html-chunked pdf"
         ;;
-    no)
+    auto)
+        nut_doc_build_list="html-single=auto html-chunked=auto pdf=auto"
+        ;;
+    no|"")
         nut_doc_build_list=""
         ;;
     *)
@@ -643,36 +646,39 @@ esac
 for nut_doc_build_target in ${nut_doc_build_list}; do
     case "${nut_doc_build_target}" in
-    html-single)
+    html-single*)
         AC_MSG_CHECKING([if asciidoc version can build ${nut_doc_build_target} (minimum required 8.6.3)])
         AX_COMPARE_VERSION([${ASCIIDOC_VERSION}], [ge], [8.6.3], [
             AC_MSG_RESULT(yes)
-            DOC_BUILD_LIST="${DOC_BUILD_LIST} ${nut_doc_build_target}"
+            DOC_BUILD_LIST="${DOC_BUILD_LIST} `basename ${nut_doc_build_target} =auto`"
         ], [
+            case "${nut_doc_build_target}" in *=auto) ;; *) AC_MSG_ERROR([Unable to build ${nut_doc_build_target} documentation which you requested]) ;; esac
             AC_MSG_RESULT(no)
-            DOC_NOBUILD_LIST="${DOC_NOBUILD_LIST} ${nut_doc_build_target}"
+            DOC_NOBUILD_LIST="${DOC_NOBUILD_LIST} `basename ${nut_doc_build_target} =auto`"
         ])
         ;;
-    html-chunked)
+    html-chunked*)
         AC_MSG_CHECKING([if a2x version can build ${nut_doc_build_target} (minimum required 8.6.3)])
         AX_COMPARE_VERSION([${A2X_VERSION}], [ge], [8.6.3], [
             AC_MSG_RESULT(yes)
-            DOC_BUILD_LIST="${DOC_BUILD_LIST} ${nut_doc_build_target}"
+            DOC_BUILD_LIST="${DOC_BUILD_LIST} `basename ${nut_doc_build_target} =auto`"
         ], [
+            case "${nut_doc_build_target}" in *=auto) ;; *) AC_MSG_ERROR([Unable to build ${nut_doc_build_target} documentation which you requested]) ;; esac
             AC_MSG_RESULT(no)
-            DOC_NOBUILD_LIST="${DOC_NOBUILD_LIST} ${nut_doc_build_target}"
+            DOC_NOBUILD_LIST="${DOC_NOBUILD_LIST} `basename ${nut_doc_build_target} =auto`"
         ])
         ;;
-    pdf)
+    pdf*)
         AC_MSG_CHECKING([if dblatex version can build ${nut_doc_build_target} (minimum required 0.2.5)])
         AX_COMPARE_VERSION([${DBLATEX_VERSION}], [ge], [0.2.5], [
             AC_MSG_RESULT(yes)
-            DOC_BUILD_LIST="${DOC_BUILD_LIST} ${nut_doc_build_target}"
+            DOC_BUILD_LIST="${DOC_BUILD_LIST} `basename ${nut_doc_build_target} =auto`"
         ], [
+            case "${nut_doc_build_target}" in *=auto) ;; *) AC_MSG_ERROR([Unable to build ${nut_doc_build_target} documentation which you requested]) ;; esac
             AC_MSG_RESULT(no)
-            DOC_NOBUILD_LIST="${DOC_NOBUILD_LIST} ${nut_doc_build_target}"
+            DOC_NOBUILD_LIST="${DOC_NOBUILD_LIST} `basename ${nut_doc_build_target} =auto`"
         ])
         ;;
     esac
components/sysutils/nut/patches/02-nut-configure-netsnmp-arch.patch
New file
@@ -0,0 +1,53 @@
Fix posted upstream so this patch should not be needed after nut-2.7.5 or so.
diff --git a/m4/nut_check_libnetsnmp.m4 b/m4/nut_check_libnetsnmp.m4
index e1c1426..48055f0 100644
--- a/m4/nut_check_libnetsnmp.m4
+++ b/m4/nut_check_libnetsnmp.m4
@@ -13,9 +13,26 @@ if test -z "${nut_have_libnetsnmp_seen}"; then
     CFLAGS_ORIG="${CFLAGS}"
     LIBS_ORIG="${LIBS}"
+    dnl By default seek in PATH
+    NET_SNMP_CONFIG=net-snmp-config
+    AC_ARG_WITH(net-snmp-config,
+        AS_HELP_STRING([@<:@--with-net-snmp-config=/path/to/net-snmp-config@:>@],
+            [path to program that reports Net-SNMP configuration]),
+    [
+        case "${withval}" in
+        "") ;;
+        yes|no)
+            AC_MSG_ERROR(invalid option --with(out)-net-snmp-config - see docs/configure.txt)
+            ;;
+        *)
+            NET_SNMP_CONFIG="${withval}"
+            ;;
+        esac
+    ])
+
     dnl See which version of the Net-SNMP library (if any) is installed
-    AC_MSG_CHECKING(for Net-SNMP version via net-snmp-config)
-    SNMP_VERSION=`net-snmp-config --version 2>/dev/null`
+    AC_MSG_CHECKING(for Net-SNMP version via ${NET_SNMP_CONFIG})
+    SNMP_VERSION=`${NET_SNMP_CONFIG} --version 2>/dev/null`
     if test "$?" != "0" -o -z "${SNMP_VERSION}"; then
         SNMP_VERSION="none"
     fi
@@ -33,7 +51,7 @@ if test -z "${nut_have_libnetsnmp_seen}"; then
             CFLAGS="${withval}"
             ;;
         esac
-    ], [CFLAGS="`net-snmp-config --base-cflags 2>/dev/null`"])
+    ], [CFLAGS="`${NET_SNMP_CONFIG} --base-cflags 2>/dev/null`"])
     AC_MSG_RESULT([${CFLAGS}])
     AC_MSG_CHECKING(for Net-SNMP libs)
@@ -48,7 +66,7 @@ if test -z "${nut_have_libnetsnmp_seen}"; then
             LIBS="${withval}"
             ;;
         esac
-    ], [LIBS="`net-snmp-config --libs 2>/dev/null`"])
+    ], [LIBS="`${NET_SNMP_CONFIG} --libs 2>/dev/null`"])
     AC_MSG_RESULT([${LIBS}])
     dnl Check if the Net-SNMP library is usable
components/sysutils/nut/patches/03-nut-configure-gdlib-arch.patch
New file
@@ -0,0 +1,52 @@
Fix posted upstream so this patch should not be needed after nut-2.7.5 or so.
diff --git a/m4/nut_check_libgd.m4 b/m4/nut_check_libgd.m4
index 01cc882..73f4da7 100644
--- a/m4/nut_check_libgd.m4
+++ b/m4/nut_check_libgd.m4
@@ -19,8 +19,25 @@ if test -z "${nut_have_libgd_seen}"; then
     LDFLAGS="-L/usr/X11R6/lib"
     LIBS="-lgd -lpng -lz -ljpeg -lfreetype -lm -lXpm -lX11"
-    AC_MSG_CHECKING(for gd version via gdlib-config)
-    GD_VERSION=`gdlib-config --version 2>/dev/null`
+    dnl By default seek in PATH
+    GDLIB_CONFIG=gdlib-config
+    AC_ARG_WITH(gdlib-config,
+        AS_HELP_STRING([@<:@--with-gdlib-config=/path/to/gdlib-config@:>@],
+            [path to program that reports GDLIB configuration]),
+    [
+        case "${withval}" in
+        "") ;;
+        yes|no)
+            AC_MSG_ERROR(invalid option --with(out)-gdlib-config - see docs/configure.txt)
+            ;;
+        *)
+            GDLIB_CONFIG="${withval}"
+            ;;
+        esac
+    ])
+
+    AC_MSG_CHECKING(for gd version via ${GDLIB_CONFIG})
+    GD_VERSION=`${GDLIB_CONFIG} --version 2>/dev/null`
     if test "$?" != "0" -o -z "${GD_VERSION}"; then
         GD_VERSION="none"
     fi
@@ -30,13 +47,13 @@ if test -z "${nut_have_libgd_seen}"; then
     none)
         ;;
     2.0.5 | 2.0.6 | 2.0.7)
-        AC_MSG_WARN([[gd ${GD_VERSION} detected, unable to use gdlib-config script]])
+        AC_MSG_WARN([[gd ${GD_VERSION} detected, unable to use ${GDLIB_CONFIG} script]])
         AC_MSG_WARN([[If gd detection fails, upgrade gd or use --with-gd-includes and --with-gd-libs]])
         ;;
     *)
-        CFLAGS="`gdlib-config --includes 2>/dev/null`"
-        LDFLAGS="`gdlib-config --ldflags 2>/dev/null`"
-        LIBS="`gdlib-config --libs 2>/dev/null`"
+        CFLAGS="`${GDLIB_CONFIG} --includes 2>/dev/null`"
+        LDFLAGS="`${GDLIB_CONFIG} --ldflags 2>/dev/null`"
+        LIBS="`${GDLIB_CONFIG} --libs 2>/dev/null`"
         ;;
     esac
components/sysutils/nut/patches/04-nut-WITH_MANS.patch
New file
@@ -0,0 +1,526 @@
Allow selective not-building of manpages as extension of --with-doc=... syntax.
Fix posted upstream so this patch should not be needed after nut-2.7.5 or so.
diff --git a/configure.ac b/configure.ac
index e16cf86..2e3c461 100644
--- a/configure.ac
+++ b/configure.ac
@@ -254,7 +254,7 @@ dnl they are listed near the top by "./configure --help"
 NUT_ARG_WITH([dev], [build and install the development files], [no])
 NUT_ARG_WITH([serial], [build and install serial drivers], [yes])
 NUT_ARG_WITH([usb], [build and install USB drivers], [auto])
-NUT_ARG_WITH([doc], [build and install documentation], [no])
+NUT_ARG_WITH([doc], [build and install documentation], [man=yes])
 NUT_ARG_WITH([avahi], [build and install Avahi support], [auto])
 dnl ----------------------------------------------------------------------
@@ -629,4 +629,54 @@ dnl Always check for AsciiDoc prerequisites, since even if --with-doc
 dnl is set to 'no', we may still want to build some doc targets manually
 NUT_CHECK_ASCIIDOC
+
+AC_MSG_CHECKING([if asciidoc version can build manpages (minimum required 8.6.3)])
+AX_COMPARE_VERSION([${ASCIIDOC_VERSION}], [ge], [8.6.3], [
+    AC_MSG_RESULT(yes)
+    nut_have_asciidoc="yes"
+], [
+    AC_MSG_RESULT(no)
+    nut_have_asciidoc="no"
+])
+
+AC_MSG_CHECKING([if a2x version can build manpages (minimum required 8.6.3)])
+AX_COMPARE_VERSION([${A2X_VERSION}], [ge], [8.6.3], [
+    AC_MSG_RESULT(yes)
+], [
+    AC_MSG_RESULT(no)
+    nut_have_asciidoc="no"
+])
+
+dnl TODO: test for docbook-xsl files (maybe build a test man page?)
+dnl https://github.com/networkupstools/nut/issues/162
+AC_MSG_CHECKING([if xsltproc is present (mandatory for man page regeneration)])
+if test -n "${XSLTPROC}"; then
+  AC_MSG_RESULT(yes)
+else
+  AC_MSG_RESULT(no)
+  nut_have_asciidoc="no"
+fi
+
+AC_MSG_CHECKING([if xmllint is present (mandatory for man page regeneration)])
+if test -n "${XMLLINT}"; then
+  AC_MSG_RESULT(yes)
+else
+  AC_MSG_RESULT(no)
+  nut_have_asciidoc="no"
+fi
+
+AC_MSG_CHECKING([if source-highlight is present (preferable for documentation generation)])
+if test -n "${SOURCE_HIGHLIGHT}"; then
+  AC_MSG_RESULT(yes)
+else
+  AC_MSG_RESULT(no)
+fi
+
+NUT_REPORT_FEATURE([build and install documentation], [${nut_with_doc}], [],
+                    [WITH_ASCIIDOC], [Define to enable Asciidoc support])
+
+dnl Notes: we also keep HAVE_ASCIIDOC for implicit targets, such as manpage
+dnl building
+AM_CONDITIONAL([HAVE_ASCIIDOC], [test "${nut_have_asciidoc}" = "yes"])
+
 case "${nut_with_doc}" in
@@ -632,15 +632,21 @@ dnl Always check for AsciiDoc prerequisites, since even if --with-doc
 case "${nut_with_doc}" in
     yes|all)
-        nut_doc_build_list="html-single html-chunked pdf"
+        nut_doc_build_list="man html-single html-chunked pdf"
         ;;
     auto)
-        nut_doc_build_list="html-single=auto html-chunked=auto pdf=auto"
+        nut_doc_build_list="man=auto html-single=auto html-chunked=auto pdf=auto"
         ;;
-    no|"")
+    no)
         nut_doc_build_list=""
         ;;
+dnl If user passed --with-doc='' they they want nothing, right?
+    "")
+        nut_doc_build_list=""
+        AC_MSG_NOTICE([Got explicit empty list of document formats to build; nothing will be generated])
+        ;;
     *)
         nut_doc_build_list="`echo ${nut_with_doc} | sed 's/,/ /g'`"
+        AC_MSG_NOTICE([Got explicit list of document formats to build or not: ${nut_doc_build_list}; formats not listed will be silently skipped])
         ;;
 esac
@@ -644,43 +700,93 @@
         ;;
 esac
-for nut_doc_build_target in ${nut_doc_build_list}; do
+dnl Note: Do not cover ${nut_doc_build_list} in braces or quotes here,
+dnl to ensure that it is processed as several space-separated tokens
+for nut_doc_build_target in $nut_doc_build_list; do
     case "${nut_doc_build_target}" in
+    *=*=*) AC_MSG_ERROR([Invalid documentation format option: ${nut_doc_build_target}]) ;;
+    *=*)
+        nut_doc_build_target_base="`echo "${nut_doc_build_target}" | sed 's,=.*$,,'`"
+        nut_doc_build_target_flag="`echo "${nut_doc_build_target}" | sed 's,^.*=,,'`"
+        ;;
+    *)
+        nut_doc_build_target_base="${nut_doc_build_target}"
+        nut_doc_build_target_flag="yes"
+        ;;
+    esac
+    case "${nut_doc_build_target_flag}" in
+    yes|no|auto|skip) ;;
+    "") nut_doc_build_target_flag="yes" ;;
+    *)  AC_MSG_ERROR([Invalid documentation format option: ${nut_doc_build_target}]) ;;
+    esac
+    AC_MSG_CHECKING([desire and ability to build ${nut_doc_build_target_base} documentation])
+    AC_MSG_RESULT([${nut_doc_build_target_flag}])
+
+    case "${nut_doc_build_target}" in
+    *=no|*=skip)
+        DOC_SKIPBUILD_LIST="${DOC_SKIPBUILD_LIST} ${nut_doc_build_target_base}"
+        ;;
+
+dnl Notes: Document options below assume either no flag value (which
+dnl by default means "yes"), "yes" which is a requirement, or "auto"
+dnl to detect if we can build the wanted documentation format and yet
+dnl not fail if we have no tools to generate it.
     html-single*)
-        AC_MSG_CHECKING([if asciidoc version can build ${nut_doc_build_target} (minimum required 8.6.3)])
+        AC_MSG_CHECKING([if asciidoc version can build ${nut_doc_build_target_base} (minimum required 8.6.3)])
         AX_COMPARE_VERSION([${ASCIIDOC_VERSION}], [ge], [8.6.3], [
             AC_MSG_RESULT(yes)
-            DOC_BUILD_LIST="${DOC_BUILD_LIST} `basename ${nut_doc_build_target} =auto`"
+            DOC_BUILD_LIST="${DOC_BUILD_LIST} ${nut_doc_build_target_base}"
         ], [
-            case "${nut_doc_build_target}" in *=auto) ;; *) AC_MSG_ERROR([Unable to build ${nut_doc_build_target} documentation which you requested]) ;; esac
             AC_MSG_RESULT(no)
-            DOC_NOBUILD_LIST="${DOC_NOBUILD_LIST} `basename ${nut_doc_build_target} =auto`"
+            if test "${nut_doc_build_target}" = "yes" ; then
+                AC_MSG_ERROR([Unable to build ${nut_doc_build_target_base} documentation which you requested])
+            fi
+            DOC_CANNOTBUILD_LIST="${DOC_CANNOTBUILD_LIST} ${nut_doc_build_target_base}"
         ])
         ;;
     html-chunked*)
-        AC_MSG_CHECKING([if a2x version can build ${nut_doc_build_target} (minimum required 8.6.3)])
+        AC_MSG_CHECKING([if a2x version can build ${nut_doc_build_target_base} (minimum required 8.6.3)])
         AX_COMPARE_VERSION([${A2X_VERSION}], [ge], [8.6.3], [
             AC_MSG_RESULT(yes)
-            DOC_BUILD_LIST="${DOC_BUILD_LIST} `basename ${nut_doc_build_target} =auto`"
+            DOC_BUILD_LIST="${DOC_BUILD_LIST} ${nut_doc_build_target_base}"
         ], [
-            case "${nut_doc_build_target}" in *=auto) ;; *) AC_MSG_ERROR([Unable to build ${nut_doc_build_target} documentation which you requested]) ;; esac
             AC_MSG_RESULT(no)
-            DOC_NOBUILD_LIST="${DOC_NOBUILD_LIST} `basename ${nut_doc_build_target} =auto`"
+            if test "${nut_doc_build_target}" = "yes" ; then
+                AC_MSG_ERROR([Unable to build ${nut_doc_build_target_base} documentation which you requested])
+            fi
+            DOC_CANNOTBUILD_LIST="${DOC_CANNOTBUILD_LIST} ${nut_doc_build_target_base}"
         ])
         ;;
     pdf*)
-        AC_MSG_CHECKING([if dblatex version can build ${nut_doc_build_target} (minimum required 0.2.5)])
+        AC_MSG_CHECKING([if dblatex version can build ${nut_doc_build_target_base} (minimum required 0.2.5)])
         AX_COMPARE_VERSION([${DBLATEX_VERSION}], [ge], [0.2.5], [
             AC_MSG_RESULT(yes)
-            DOC_BUILD_LIST="${DOC_BUILD_LIST} `basename ${nut_doc_build_target} =auto`"
+            DOC_BUILD_LIST="${DOC_BUILD_LIST} ${nut_doc_build_target_base}"
         ], [
-            case "${nut_doc_build_target}" in *=auto) ;; *) AC_MSG_ERROR([Unable to build ${nut_doc_build_target} documentation which you requested]) ;; esac
             AC_MSG_RESULT(no)
-            DOC_NOBUILD_LIST="${DOC_NOBUILD_LIST} `basename ${nut_doc_build_target} =auto`"
+            if test "${nut_doc_build_target}" = "yes" ; then
+                AC_MSG_ERROR([Unable to build ${nut_doc_build_target_base} documentation which you requested])
+            fi
+            DOC_CANNOTBUILD_LIST="${DOC_CANNOTBUILD_LIST} ${nut_doc_build_target_base}"
         ])
         ;;
+    man*)
+        AC_MSG_CHECKING([if we can build ${nut_doc_build_target_base}])
+        if test "${nut_have_asciidoc}" = yes ; then
+            AC_MSG_RESULT(yes)
+            DOC_BUILD_LIST="${DOC_BUILD_LIST} ${nut_doc_build_target_base}"
+        else
+            AC_MSG_RESULT(no)
+            if test "${nut_doc_build_target}" = "yes" ; then
+                AC_MSG_ERROR([Unable to build ${nut_doc_build_target_base} documentation which you requested])
+            fi
+            DOC_CANNOTBUILD_LIST="${DOC_CANNOTBUILD_LIST} ${nut_doc_build_target_base}"
+        fi
+        ;;
+
+    *) AC_MSG_ERROR([--with-doc option refers to unknown documentation format: $nut_doc_build_target]) ;;
     esac
 done
@@ -691,70 +806,34 @@ auto)
     else
         nut_with_doc="no"
     fi
-    ;;
+    ;;
 no)
     ;;
 *)
-    if test -z "${DOC_NOBUILD_LIST}"; then
+    if test -n "${DOC_CANNOTBUILD_LIST}"; then
+        AC_MSG_ERROR([Unable to build${DOC_CANNOTBUILD_LIST} documentation (check for 'no' results above)])
+    fi
+
+    if test -n "${DOC_SKIPBUILD_LIST}"; then
+        AC_MSG_NOTICE([Skipping build of${DOC_SKIPBUILD_LIST} documentation (check for 'skip' results above)])
+    fi
+
+    if test -n "${DOC_BUILD_LIST}"; then
         nut_with_doc="yes"
     else
-        AC_MSG_ERROR(["Unable to build ${DOC_NOBUILD_LIST} documentation (check for 'no' results above)"])
+        nut_with_doc="no"
     fi
     ;;
 esac
-AC_MSG_CHECKING([if asciidoc version can build manpages (minimum required 8.6.3)])
-AX_COMPARE_VERSION([${ASCIIDOC_VERSION}], [ge], [8.6.3], [
-    AC_MSG_RESULT(yes)
-    nut_have_asciidoc="yes"
-], [
-    AC_MSG_RESULT(no)
-    nut_have_asciidoc="no"
-])
-
-AC_MSG_CHECKING([if a2x version can build manpages (minimum required 8.6.3)])
-AX_COMPARE_VERSION([${A2X_VERSION}], [ge], [8.6.3], [
-    AC_MSG_RESULT(yes)
-], [
-    AC_MSG_RESULT(no)
-    nut_have_asciidoc="no"
-])
-
-dnl TODO: test for docbook-xsl files (maybe build a test man page?)
-dnl https://github.com/networkupstools/nut/issues/162
-AC_MSG_CHECKING([if xsltproc is present (mandatory for man page regeneration)])
-if test -n "${XSLTPROC}"; then
-  AC_MSG_RESULT(yes)
-else
-  AC_MSG_RESULT(no)
-  nut_have_asciidoc="no"
-fi
-
-AC_MSG_CHECKING([if xmllint is present (mandatory for man page regeneration)])
-if test -n "${XMLLINT}"; then
-  AC_MSG_RESULT(yes)
-else
-  AC_MSG_RESULT(no)
-  nut_have_asciidoc="no"
-fi
+NUT_REPORT_FEATURE([build specific documentation format(s)], [${nut_with_doc}], [${DOC_BUILD_LIST}],
+                    [WITH_DOCS], [Define to enable overall documentation generation])
-AC_MSG_CHECKING([if source-highlight is present (preferable for documentation generation)])
-if test -n "${SOURCE_HIGHLIGHT}"; then
-  AC_MSG_RESULT(yes)
-else
-  AC_MSG_RESULT(no)
-fi
-
-NUT_REPORT_FEATURE([build and install documentation], [${nut_with_doc}], [],
-                    [WITH_ASCIIDOC], [Define to enable Asciidoc support])
-
-dnl Notes: we also keep HAVE_ASCIIDOC for implicit targets, such as manpage
-dnl building
-AM_CONDITIONAL([HAVE_ASCIIDOC], [test "${nut_have_asciidoc}" = "yes"])
-
-if test "${nut_with_doc}" = "yes"; then
-    NUT_REPORT([only build specific documentation format], [${DOC_BUILD_LIST}])
+WITH_MANS=no
+if echo "${DOC_BUILD_LIST}" | grep -w "man" >/dev/null ; then
+    WITH_MANS=yes
 fi
+AM_CONDITIONAL(WITH_MANS, test "${WITH_MANS}" = "yes")
 dnl ----------------------------------------------------------------------
 dnl checks related to --with-dev
@@ -999,17 +1078,22 @@ if test "${DRIVER_BUILD_LIST}" != "all"; then
 fi
 AC_MSG_CHECKING(which driver man pages to install)
-if test "${DRIVER_BUILD_LIST}" = "all"; then
-    DRIVER_MAN_LIST=all
-    AC_MSG_RESULT(all available)
+if test "${WITH_MANS}" = "yes"; then
+    if test "${DRIVER_BUILD_LIST}" = "all"; then
+        DRIVER_MAN_LIST=all
+        AC_MSG_RESULT(all available)
+    else
+        DRIVER_MAN_LIST=""
+        for i in ${DRIVER_BUILD_LIST}; do
+            if test -f ${srcdir}/docs/man/$i.8; then
+                DRIVER_MAN_LIST="${DRIVER_MAN_LIST} $i.8"
+            fi
+        done
+        AC_MSG_RESULT(${DRIVER_MAN_LIST})
+    fi
 else
     DRIVER_MAN_LIST=""
-    for i in ${DRIVER_BUILD_LIST}; do
-        if test -f ${srcdir}/docs/man/$i.8; then
-            DRIVER_MAN_LIST="${DRIVER_MAN_LIST} $i.8"
-        fi
-    done
-    AC_MSG_RESULT(${DRIVER_MAN_LIST})
+    AC_MSG_RESULT([none (manpages disabled)])
 fi
 AC_MSG_CHECKING(whether to strip debug symbols)
diff --git a/docs/man/Makefile.am b/docs/man/Makefile.am
index e793657..c83bd6c 100644
--- a/docs/man/Makefile.am
+++ b/docs/man/Makefile.am
@@ -21,6 +21,7 @@ SRC_CONF_PAGES = \
     upsmon.conf.txt \
     upssched.conf.txt
+if WITH_MANS
 MAN_CONF_PAGES = \
     nut.conf.5 \
     ups.conf.5 \
@@ -28,6 +29,7 @@ MAN_CONF_PAGES = \
     upsd.users.5 \
     upsmon.conf.5 \
     upssched.conf.5
+endif
 man5_MANS = $(MAN_CONF_PAGES)
@@ -50,6 +52,7 @@ SRC_CLIENT_PAGES = \
     upsrw.txt \
     upssched.txt
+if WITH_MANS
 MAN_CLIENT_PAGES = \
     nutupsdrv.8 \
     upsc.8 \
@@ -60,6 +63,7 @@ MAN_CLIENT_PAGES = \
     upsmon.8 \
     upsrw.8 \
     upssched.8
+endif
 man8_MANS = $(MAN_CLIENT_PAGES)
@@ -76,7 +80,9 @@ HTML_CLIENT_MANS = \
 SRC_TOOL_PAGES = nut-scanner.txt nut-recorder.txt
+if WITH_MANS
 MAN_TOOL_PAGES = nut-scanner.8 nut-recorder.8
+endif
 man8_MANS += $(MAN_TOOL_PAGES)
@@ -91,6 +97,7 @@ SRC_CGI_PAGES = \
     upsstats.cgi.txt \
     upsimage.cgi.txt
+if WITH_MANS
 MAN5_CGI_PAGES = \
     hosts.conf.5 \
     upsset.conf.5 \
@@ -100,6 +107,7 @@ MAN8_CGI_PAGES = \
     upsset.cgi.8 \
     upsstats.cgi.8 \
     upsimage.cgi.8
+endif
 if WITH_CGI
  man5_MANS += $(MAN5_CGI_PAGES)
@@ -162,6 +170,7 @@ SRC_DEV_PAGES = \
     libupsclient-config.txt \
     skel.txt
+if WITH_MANS
 # NOTE: nutclient_*.3 has no source counterpart (libnutclient_*.txt)
 MAN3_DEV_PAGES = \
     upsclient.3 \
@@ -235,6 +244,7 @@ MAN3_DEV_PAGES = \
 MAN1_DEV_PAGES = \
     libupsclient-config.1
+endif
 if WITH_DEV
  man3_MANS = $(MAN3_DEV_PAGES)
@@ -343,6 +353,7 @@ SRC_SERIAL_PAGES = \
     victronups.txt    \
     apcupsd-ups.txt
+if WITH_MANS
 MAN_SERIAL_PAGES = \
     al175.8    \
     apcsmart.8    \
@@ -384,6 +395,7 @@ MAN_SERIAL_PAGES = \
     upscode2.8    \
     victronups.8    \
     apcupsd-ups.8
+endif
 if WITH_SERIAL
   man8_MANS +=  $(MAN_SERIAL_PAGES)
@@ -433,7 +445,9 @@ HTML_SERIAL_MANS = \
 # (--with-snmp)
 SRC_SNMP_PAGES = snmp-ups.txt
+if WITH_MANS
 MAN_SNMP_PAGES = snmp-ups.8
+endif
 if WITH_SNMP
   man8_MANS += $(MAN_SNMP_PAGES)
@@ -453,6 +467,7 @@ SRC_USB_LIBUSB_PAGES = \
     tripplite_usb.txt \
     usbhid-ups.txt
+if WITH_MANS
 MAN_USB_LIBUSB_PAGES = \
     bcmxcp_usb.8 \
     blazer_usb.8 \
@@ -462,6 +477,7 @@ MAN_USB_LIBUSB_PAGES = \
     riello_usb.8    \
     tripplite_usb.8 \
     usbhid-ups.8
+endif
 if WITH_USB
  man8_MANS += $(MAN_USB_LIBUSB_PAGES)
@@ -479,7 +495,9 @@ HTML_USB_LIBUSB_MANS = \
 # (--with-neon)
 SRC_NETXML_PAGES = netxml-ups.txt
+if WITH_MANS
 MAN_NETXML_PAGES = netxml-ups.8
+endif
 if WITH_NEON
    man8_MANS += $(MAN_NETXML_PAGES)
@@ -489,7 +507,9 @@ HTML_NETXML_MANS = netxml-ups.html
 # (--with-powerman)
 SRC_POWERMAN_PAGES = powerman-pdu.txt
+if WITH_MANS
 MAN_POWERMAN_PAGES = powerman-pdu.8
+endif
 if WITH_LIBPOWERMAN
    man8_MANS += $(MAN_POWERMAN_PAGES)
@@ -499,7 +519,9 @@ HTML_POWERMAN_MANS = powerman-pdu.html
 # (--with-ipmi)
 SRC_IPMIPSU_PAGES = nut-ipmipsu.txt
+if WITH_MANS
 MAN_IPMIPSU_PAGES = nut-ipmipsu.8
+endif
 if WITH_IPMI
    man8_MANS += $(MAN_IPMIPSU_PAGES)
@@ -508,7 +530,9 @@ endif
 HTML_IPMIPSU_MANS = nut-ipmipsu.html
 SRC_MACOSX_PAGES = macosx-ups.txt
+if WITH_MANS
 MAN_MACOSX_PAGES = macosx-ups.8
+endif
 if WITH_MACOSX
    man8_MANS += $(MAN_MACOSX_PAGES)
@@ -517,7 +541,9 @@ endif
 HTML_MACOSX_MANS = macosx-ups.html
 SRC_LINUX_I2C_PAGES = asem.txt
+if WITH_MANS
 MAN_LINUX_I2C_PAGES = asem.8
+endif
 if WITH_LINUX_I2C
    man8_MANS += $(LINUX_I2C_PAGES)
@@ -528,7 +554,9 @@ HTML_LINUX_I2C_MANS = asem.html
 # SOME_DRIVERS
 endif
-MAN_MANS = \
+MAN_MANS =
+if WITH_MANS
+MAN_MANS += \
     $(MAN_CONF_PAGES) \
     $(MAN_CLIENT_PAGES) \
     $(MAN_TOOL_PAGES) \
@@ -544,6 +572,7 @@ MAN_MANS = \
     $(MAN_IPMIPSU_PAGES) \
     $(MAN_MACOSX_PAGES) \
     $(MAN_LINUX_I2C_PAGES)
+endif
 # distribute everything, even those not installed by default
 # Note that 'dist' target requires AsciiDoc!
@@ -564,6 +593,13 @@ EXTRA_DIST = \
     $(MAN_MANS) \
     asciidoc.conf
+if ! WITH_MANS
+# Cause "make dist" to fail
+EXTRA_DIST += dist
+dist:
+    @echo "ERROR: Manpage building was disabled by configure script, and these pages are required for our proper 'make dist'" >&2 ; false
+endif
+
 HTML_MANS = \
     $(HTML_CONF_MANS) \
     $(HTML_CLIENT_MANS) \
components/sysutils/nut/patches/05-nut-quiesce-systemd.patch
New file
@@ -0,0 +1,23 @@
Do not complain about missing systemd stuff if we even do ask to not use it.
Fix posted upstream so this patch should not be needed after nut-2.7.5 or so.
diff --git a/configure.ac b/configure.ac
index e16cf86..2e3c461 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1127,13 +1130,13 @@ fi
 AM_CONDITIONAL(WITH_PKG_CONFIG, test -n "${pkgconfigdir}")
 PKG_PROG_PKG_CONFIG
-systemdsystemunitdir=`$PKG_CONFIG --variable=systemdsystemunitdir systemd`
 AC_MSG_CHECKING(whether to install systemd files)
 AC_ARG_WITH([systemdsystemunitdir],
     AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files (auto)]),
 [
     case "${withval}" in
-    yes|auto)
+    yes|auto|"")
+        systemdsystemunitdir=`$PKG_CONFIG --variable=systemdsystemunitdir systemd`
         ;;
     no)
         systemdsystemunitdir=""
components/sysutils/nut/patches/06-nut-augeas-inst-dir.patch
New file
@@ -0,0 +1,97 @@
Allow "make install" to properly deliver the augeas lenses files, if configured.
Fix posted upstream so this patch should not be needed after nut-2.7.5 or so.
diff -Naur nut-2.7.4/configure.ac nut-2.7.4-auginst/configure.ac
--- nut-2.7.4/configure.ac    2016-05-02 19:07:03.924039136 +0200
+++ nut-2.7.4-auginst/configure.ac    2016-05-03 10:14:10.192735403 +0200
@@ -67,6 +67,10 @@
 driverexecdir='${exec_prefix}/bin'
 htmldir='${prefix}/html'
 pkgconfigdir='${libdir}/pkgconfig'
+auglensdir='/usr/share/augeas/lenses'
+if test ! -d "${auglensdir}"; then
+   auglensdir=''
+fi
 hotplugdir='/etc/hotplug'
 if test ! -d "${hotplugdir}"; then
    hotplugdir=''
@@ -1154,6 +1158,34 @@
 fi
 AM_CONDITIONAL(HAVE_SYSTEMD, test "$systemdsystemunitdir" != "")
+AC_MSG_CHECKING(whether to install Augeas configuration-management lenses)
+AC_ARG_WITH(augeas-lenses-dir,
+    AS_HELP_STRING([--with-augeas-lenses-dir=PATH], [where to install Augeas configuration-management lenses (/usr/share/augeas/lenses)]),
+[
+    case "${withval}" in
+    yes)
+        if test -z "${auglensdir}"; then
+            AC_MSG_RESULT(no)
+            AC_MSG_ERROR(["augeas lenses directory requested but not found"])
+        fi
+        ;;
+    auto)
+        ;;
+    no)
+        auglensdir=""
+        ;;
+    *)
+        auglensdir="${withval}"
+        ;;
+    esac
+], [])
+if test -n "${auglensdir}"; then
+    AC_MSG_RESULT(using ${auglensdir})
+else
+    AC_MSG_RESULT(no)
+fi
+AM_CONDITIONAL(WITH_AUGLENS, test -n "${auglensdir}")
+
 AC_MSG_CHECKING(whether to install hotplug rules)
 AC_ARG_WITH(hotplug-dir,
     AS_HELP_STRING([--with-hotplug-dir=PATH], [where to install hotplug rules (/etc/hotplug)]),
@@ -1343,6 +1375,7 @@
 AC_SUBST(pkgconfigdir)
 AC_SUBST(systemdsystemunitdir)
 AC_SUBST(systemdsystemshutdowndir)
+AC_SUBST(auglensdir)
 AC_SUBST(hotplugdir)
 AC_SUBST(udevdir)
diff -Naur nut-2.7.4/Makefile.am nut-2.7.4-auginst/Makefile.am
--- nut-2.7.4/Makefile.am    2016-03-09 14:24:11.000000000 +0100
+++ nut-2.7.4-auginst/Makefile.am    2016-05-03 10:17:53.804392904 +0200
@@ -14,14 +14,15 @@
 # ----------------------------------------------------------------------
 # flags to pass to ./configure when calling "make distcheck" and "make
 # distcheck-light". Try to check as many features as possible! Also
-# need to give hotplug-dir and udev-dir, so that staged install does
-# not fail.
+# need to give augeas-lenses-dir, hotplug-dir and udev-dir, so that
+# staged install does not fail.
 DISTCHECK_FLAGS = --with-all --with-ssl --with-doc=auto
 DISTCHECK_LIGHT_FLAGS = --with-all=auto --with-ssl=auto --with-doc=auto
 DISTCHECK_CONFIGURE_FLAGS = ${DISTCHECK_FLAGS}        \
  --with-systemdsystemunitdir='$${prefix}/lib/systemd/system' \
+ --with-augeas-lenses-dir='$${prefix}/usr/share/augeas/lenses'        \
  --with-hotplug-dir='$${prefix}/etc/hotplug'        \
  --with-udev-dir='$${prefix}/etc/udev'            \
  --with-devd-dir='$${prefix}/etc/devd'
diff -Naur nut-2.7.4/scripts/augeas/Makefile.am nut-2.7.4-auginst/scripts/augeas/Makefile.am
--- nut-2.7.4/scripts/augeas/Makefile.am    2016-05-03 10:22:23.738243382 +0200
+++ nut-2.7.4-auginst/scripts/augeas/Makefile.am    2016-03-09 14:24:11.000000000 +0100
@@ -14,3 +14,12 @@
         echo "Skipping Augeas ups.conf lens regeneration."; \
         echo "----------------------------------------------------------------------"; \
     fi
+
+if WITH_AUGLENS
+# Now "make install" should cover delivery of Augeas lenses...
+# The "auglensdir" value should be set up by configure
+# The *.aug files are generated by rule above or by autogen.sh and/or configure
+ auglens_DATA = \
+    nuthostsconf.aug  nutupsconf.aug   nutupsdusers.aug   nutupsschedconf.aug \
+    nutnutconf.aug    nutupsdconf.aug  nutupsmonconf.aug  nutupssetconf.aug
+endif