#
# 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-2023 Jim Klimov
#

set name=pkg.fmri value=pkg:/$(COMPONENT_FMRI)/clients@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
set name=pkg.human-version value=$(HUMAN_VERSION)
set name=pkg.summary value="$(COMPONENT_SUMMARY) - NUT command-line and daemon 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=usr/lib/nut/bin/(.+) -> default mode 0555>
<transform dir path=usr/lib/nut/bin -> set group bin>
<transform file path=usr/share/nut/solaris-smf/method/(.+) -> default mode 0555>
<transform dir path=usr/share/nut/solaris-smf/method -> set group bin>
<transform file path=usr.*/man/.+ -> default mangler.man.stability uncommitted>
<transform file path=usr/share/man/man1/(.+) -> set action.hash usr/share/man/man1/%<1> >
<transform file path=usr/share/man/man1m/(.+) -> set action.hash usr/share/man/man1m/%<1> >

dir path=usr/lib/nut/bin group=bin

depend fmri=$(COMPONENT_FMRI)/common@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) type=require
depend fmri=library/security/openssl-31 type=require

### NUT Command-line binaries and scripts (upsmon daemon, other clients)
file path=usr/bin/upsc
file path=usr/bin/upscmd
file path=usr/bin/upslog
file path=usr/bin/upsrw

file path=usr/sbin/upsmon
file path=usr/sbin/upssched

# Example notification script for UPSMON
file files/notifyme path=usr/lib/nut/bin/notifyme mode=0755 preserve=renamenew

# This is an example script for handling upssched
file path=usr/bin/upssched-cmd preserve=renamenew

# Services for monitoring client (generally does not have to be present
# and running on the same system as a data server and drivers).
file path=usr/share/nut/solaris-smf/method/svc-nut-monitor
file path=usr/share/nut/solaris-smf/manifest/nut-monitor.xml
link path=lib/svc/manifest/system/power/nut-monitor.xml \
    target=../../../../../usr/share/nut/solaris-smf/manifest/nut-monitor.xml \
    restart_fmri=svc:/system/manifest-import:default

file path=usr/share/man/man5/upsmon.conf.5
file path=usr/share/man/man5/upssched.conf.5

file path=usr/share/man/man1m/upsc.1m
file path=usr/share/man/man1m/upscmd.1m
file path=usr/share/man/man1m/upslog.1m
file path=usr/share/man/man1m/upsmon.1m
file path=usr/share/man/man1m/upsrw.1m
file path=usr/share/man/man1m/upssched.1m

# We deliver the sample configs as the ones to use,
# at worst they have no actual information inside and do nothing.
file etc/nut/upsmon.conf.sample path=etc/nut/upsmon.conf \
    group=nut owner=root mode=0640 preserve=true
file etc/nut/upssched.conf.sample path=etc/nut/upssched.conf \
    group=nut owner=root mode=0640 preserve=true