#
# 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 2023 Andreas Wacknitz
#

set name=pkg.fmri value=pkg:/$(COMPONENT_FMRI)@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
set name=pkg.human-version value=$(HUMAN_VERSION)
set name=pkg.summary value="$(COMPONENT_SUMMARY)"
set name=pkg.description value="$(COMPONENT_DESCRIPTION)"
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)'

group groupname=chrony gid=23
user ftpuser=false username=chrony uid=23 group=chrony \
    gcos-field="chrony user" \
    home-dir=/var/lib/chrony password=NP

<transform dir path=var/lib/chrony$ -> set owner chrony>
<transform dir path=var/lib/chrony$ -> set group chrony>

# Restart chrony on binary change
<transform file path=usr/sbin/chronyd$ -> \
    set restart_fmri svc:/network/chrony:default>

# Install files
file files/chrony.xml path=lib/svc/manifest/network/chrony.xml
file files/chrony.conf path=etc/inet/chrony.conf owner=root group=chrony \
    mode=0644 overlay=allow preserve=renamenew
file files/chrony.keys path=etc/inet/chrony.keys owner=root group=chrony \
    mode=0640 overlay=allow preserve=renamenew

file path=usr/bin/chronyc
file path=usr/sbin/chronyd
file path=usr/share/man/man1/chronyc.1
file path=usr/share/man/man5/chrony.conf.5
file path=usr/share/man/man8/chronyd.8