#!/bin/sh
#
# COPYRIGHT (c) 2025 The Fellowship of SML/NJ (https://smlnj.org)
# All rights reserved.
#
# post-upgrade script for 64-bit macOS installs
#
# usage:
#
#	postupgrade <pkg-path> <dst-path> <dst-vol> <root-dir>
#
# where
#
#	<pkg-path>	Full path to the installation package the Installer application
#			is processing. For example: /Volumes/Users/jhr/Desktop/smlnj-amd64.pkg
#
#	<dst-path>	Full path to the installation destination. For example: /usr/local/smlnj
#
#	<dst-vol>	Installation volume (or mount point) to receive the payload.
#
#	<root-dir>	The root directory for the system
#

# the directory where the scripts live
#
SCRIPTDIR=`pwd`

# switch to the installation destination
#
DST="$2"
cd "$DST" || exit 1

./build.sh -nolib

"$SCRIPTDIR/copy-doc" "$DST" || exit 1

exit 0
