2021-05-15 13:32:35 +02:00
|
|
|
|
#!/bin/bash
|
|
|
|
|
#
|
|
|
|
|
# Install.sh
|
|
|
|
|
# alternate build for buldpkg
|
|
|
|
|
# Created on: May 12, 2021
|
|
|
|
|
# Author: LAbyOne
|
|
|
|
|
#
|
|
|
|
|
cd "$(dirname $([ -L $0 ] && readlink $0 || echo $0))"
|
2021-11-04 18:12:47 +01:00
|
|
|
|
REVISION=$(git describe --tags $(git rev-list --tags --max-count=1))
|
2021-05-15 13:32:35 +02:00
|
|
|
|
|
|
|
|
|
declare -r ROOT="$PWD"
|
|
|
|
|
declare -r CLOVERROOT=$(dirname $(dirname $ROOT))
|
|
|
|
|
declare -r BUILD_PATH="${CLOVERROOT}"/Xcode/CloverConfigPlistValidator/build
|
|
|
|
|
declare -r CCPV_PATH="${BUILD_PATH}"/ccpv
|
|
|
|
|
declare -r INSTALL_DIR="$CLOVERROOT/CloverPackage/CloverConfigPlistValidator"
|
2021-11-04 18:12:47 +01:00
|
|
|
|
declare -r SYMROOT="${CLOVERROOT}/CloverPackage/sym"
|
2021-05-15 13:32:35 +02:00
|
|
|
|
|
2021-11-04 18:12:47 +01:00
|
|
|
|
# Clear old sym directory and Create a new one
|
|
|
|
|
if [[ -d "$SYMROOT" && $(stat -f '%u' "$SYMROOT") -eq 0 ]]; then
|
|
|
|
|
sudo rm -rf "$SYMROOT"
|
|
|
|
|
fi
|
|
|
|
|
rm -rf "$SYMROOT"
|
|
|
|
|
mkdir "$SYMROOT"
|
|
|
|
|
|
|
|
|
|
# make CloverConfigPlistValidator build
|
2021-05-15 13:32:35 +02:00
|
|
|
|
buildccpv() {
|
2021-11-04 18:12:47 +01:00
|
|
|
|
echo "- Building ccpv and archive"
|
2021-05-15 13:32:35 +02:00
|
|
|
|
cd "${CLOVERROOT}"/Xcode/CloverConfigPlistValidator
|
|
|
|
|
/usr/bin/xcodebuild -project 'CloverConfigPlistValidator.xcodeproj' \
|
|
|
|
|
-configuration 'Release' \
|
|
|
|
|
CONFIGURATION_BUILD_DIR=${BUILD_PATH} \
|
|
|
|
|
EPLOYMENT_LOCATION=NO \
|
|
|
|
|
ARCHS=x86_64 VALID_ARCHS=x86_64 ONLY_ACTIVE_ARCH=YES >/dev/null
|
|
|
|
|
|
2021-11-04 18:12:47 +01:00
|
|
|
|
# Clear old ccpv directory and Create a new one
|
2021-05-15 13:32:35 +02:00
|
|
|
|
rm -Rf "$INSTALL_DIR"
|
|
|
|
|
mkdir -p "$INSTALL_DIR"
|
|
|
|
|
|
|
|
|
|
# Install files
|
2021-11-04 18:12:47 +01:00
|
|
|
|
cp "$BUILD_PATH"/CloverConfigPlistValidator "$INSTALL_DIR"/ccpv
|
2021-05-15 13:32:35 +02:00
|
|
|
|
|
2021-11-04 18:12:47 +01:00
|
|
|
|
# make archive
|
|
|
|
|
mv "$BUILD_PATH"/CloverConfigPlistValidator "$BUILD_PATH"/CloverConfigPlistValidator_${REVISION}
|
|
|
|
|
cd "$BUILD_PATH"
|
|
|
|
|
zip -qr CloverConfigPlistValidator_${REVISION}.zip CloverConfigPlistValidator_${REVISION}
|
|
|
|
|
cp "$BUILD_PATH"/CloverConfigPlistValidator_${REVISION}.zip "${SYMROOT}"
|
2021-05-15 13:32:35 +02:00
|
|
|
|
# clean up
|
|
|
|
|
rm -Rf "$BUILD_PATH"
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-04 18:12:47 +01:00
|
|
|
|
buildccpv
|