Enhance build script and make master built tool

- automatically builds the zip file
- cleans up after itself
- puts all files in /outputs
- another zsh file to make all four packages/zips
This commit is contained in:
Erik Gomez
2020-06-14 21:43:35 -05:00
parent cbe94b9abf
commit 306ee5d21b
3 changed files with 31 additions and 1 deletions
+1
View File
@@ -3,3 +3,4 @@ minimal/*
no_customization/*
opionated/*
recommended/*
outputs/*
+13
View File
@@ -0,0 +1,13 @@
#!/bin/zsh
#
# Build script for all Python 3 frameworks
# Adaptd from https://github.com/munki/munki/blob/Munki3dev/code/tools/build_python_framework.sh
# IMPORTANT
# Run this with your current directory being the path where this script is located
TOOLSDIR=$(dirname $0)
sudo "$TOOLSDIR/build_python_framework_pkgs.zsh" minimal
sudo "$TOOLSDIR/build_python_framework_pkgs.zsh" no_customization
sudo "$TOOLSDIR/build_python_framework_pkgs.zsh" recommended
sudo "$TOOLSDIR/build_python_framework_pkgs.zsh" opionated
+17 -1
View File
@@ -52,8 +52,9 @@ fi
# Variables
DATE=$(/bin/date -u "+%m%d%Y%H%M%S")
TOOLSDIR=$(dirname $0)
OUTPUTSDIR="$TOOLSDIR/outputs"
CONSOLEUSER=$(/usr/bin/stat -f "%Su" /dev/console)
FRAMEWORKDIR="/Library/frameworks"
FRAMEWORKDIR="/Library/SystemFrameworks"
RP_BINDIR="/tmp/relocatable-python"
RP_ZIP="/tmp/relocatable-python.zip"
MP_BINDIR="/tmp/munki-pkg"
@@ -133,6 +134,9 @@ if [ "${DL_RESULT}" != "0" ]; then
exit 1
fi
# Create outputs folder
/bin/mkdir -p "$TOOLSDIR/outputs"
# Create the json file for munki-pkg
/bin/cat << JSONFILE > "$TOOLSDIR/$TYPE/build-info.json"
{
@@ -148,3 +152,15 @@ fi
JSONFILE
# Create the pkg
"${MP_BINDIR}/munki-pkg-${MP_SHA}/munkipkg" "$TOOLSDIR/$TYPE"
# Zip the framework
ZIPFILE="Python.framework_$TYPE-$PYTHON_VERSION.$DATE.zip"
/usr/bin/ditto -c -k --sequesterRsrc "$TOOLSDIR/$TYPE/payload/${FRAMEWORKDIR}/" ${ZIPFILE}
# Move all of the output files
/bin/mv ${ZIPFILE} "$OUTPUTSDIR"
/bin/mv "$TOOLSDIR/$TYPE/build/python_$TYPE-$PYTHON_VERSION.$DATE.pkg" "$OUTPUTSDIR"
/usr/bin/sudo /usr/sbin/chown -R ${CONSOLEUSER}:wheel "$OUTPUTSDIR"
# Cleanup
/usr/bin/sudo /bin/rm -rf "$TOOLSDIR/$TYPE"