dotnet-installer/packaging/osx/package-osx.sh
Zlatko Knezevic 5ea34f66ec Fixing the name of the OS X package
There was a bug in naming the versioned PKG for OSX when it is being packaged. This resulted
in two different names for the latest and versioned, which is not what we want.

Fix #1537
2016-02-23 11:31:10 -08:00

48 lines
1.7 KiB
Bash
Executable file

#!/bin/bash
#
# Copyright (c) .NET Foundation and contributors. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
#
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
source "$DIR/../../scripts/common/_common.sh"
if [ -z "$DOTNET_CLI_VERSION" ]; then
echo "Provide a version number (DOTNET_CLI_VERSION) $DOTNET_CLI_VERSION" && exit 1
fi
STAGE2_DIR=$REPOROOT/artifacts/$RID/stage2
if [ ! -d "$STAGE2_DIR" ]; then
echo "Missing stage2 output in $STAGE2_DIR" 1>&2
exit 1
fi
PACKAGE_DIR=$REPOROOT/artifacts/packages/pkg
[ -d "$PACKAGE_DIR" ] || mkdir -p $PACKAGE_DIR
PACKAGE_NAME=$PACKAGE_DIR/dotnet-osx-x64.${DOTNET_CLI_VERSION}.pkg
#chmod -R 755 $STAGE2_DIR
pkgbuild --root $STAGE2_DIR \
--version $DOTNET_CLI_VERSION \
--scripts $DIR/scripts \
--identifier com.microsoft.dotnet.cli.pkg.dotnet-osx-x64 \
--install-location /usr/local/share/dotnet \
$DIR/dotnet-osx-x64.$DOTNET_CLI_VERSION.pkg
cat $DIR/Distribution-Template | sed "/{VERSION}/s//$DOTNET_CLI_VERSION/g" > $DIR/Dist
productbuild --version $DOTNET_CLI_VERSION --identifier com.microsoft.dotnet.cli --package-path $DIR --resources $DIR/resources --distribution $DIR/Dist $PACKAGE_NAME
#Clean temp files
rm $DIR/dotnet-osx-x64.$DOTNET_CLI_VERSION.pkg
rm $DIR/Dist
$REPOROOT/scripts/publish/publish.sh $PACKAGE_NAME