#
# 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 2020, 2021, 2022, 2023 David Stes
#


set name=pkg.fmri value=pkg:/runtime/smalltalk/squeak-nodisplay@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
set name=pkg.summary value="$(COMPONENT_SUMMARY)"
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)
set name=pkg.human-version value=$(HUMAN_VERSION)

license squeak.license license='MIT'
license $(COMPONENT_LICENSE_FILE) license='$(COMPONENT_LICENSE)'

# 32-bit objects in 64-bit multiarch build are rejected by lint
# since 2023 version 4.20.6 we only deliver 64bit binaries
<transform file path=usr/lib/squeak/$(COMPONENT_VERSION)-$(SVN_REV)_64bit/* -> set pkg.linted.userland.action001.2 true>

# since 2023 version 4.20.6 32bit do not provide 32bit binaries
file inisqueak4 path=usr/bin/inisqueak4
file squeak.ips path=usr/bin/squeak4
file usr/lib/squeak/$(COMPONENT_VERSION)-$(SVN_REV)_64bit/ckformat path=usr/lib/amd64/squeak/$(COMPONENT_VERSION)-$(SVN_REV)/ckformat mode=0555
file usr/lib/squeak/$(COMPONENT_VERSION)-$(SVN_REV)_64bit/squeakvm64 path=usr/lib/amd64/squeak/$(COMPONENT_VERSION)-$(SVN_REV)/squeakvm64 mode=0555

file usr/share/man/man1/squeak.1 path=usr/share/man/man1/squeak4.1

# the squeak script uses test -L (test for symbolic link) - use hardlink

hardlink path=usr/bin/squeak target=squeak4 mediator=squeak \
    mediator-version=4
hardlink path=usr/bin/inisqueak target=inisqueak4 mediator=squeak \
    mediator-version=4
hardlink path=usr/share/man/man1/squeak.1 target=squeak4.1 mediator=squeak \
    mediator-version=4