Merge pull request #2 from macadmins/development
Enhance build script and make master built tool
This commit is contained in:
3 files changed
+31
-1
No files matched your search
@@ -3,3 +3,4 @@ minimal/*
|
|||||||
no_customization/*
|
no_customization/*
|
||||||
opionated/*
|
opionated/*
|
||||||
recommended/*
|
recommended/*
|
||||||
|
outputs/*
|
||||||
Executable
+13
@@ -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
|
||||||
@@ -52,8 +52,9 @@ fi
|
|||||||
# Variables
|
# Variables
|
||||||
DATE=$(/bin/date -u "+%m%d%Y%H%M%S")
|
DATE=$(/bin/date -u "+%m%d%Y%H%M%S")
|
||||||
TOOLSDIR=$(dirname $0)
|
TOOLSDIR=$(dirname $0)
|
||||||
|
OUTPUTSDIR="$TOOLSDIR/outputs"
|
||||||
CONSOLEUSER=$(/usr/bin/stat -f "%Su" /dev/console)
|
CONSOLEUSER=$(/usr/bin/stat -f "%Su" /dev/console)
|
||||||
FRAMEWORKDIR="/Library/frameworks"
|
FRAMEWORKDIR="/Library/SystemFrameworks"
|
||||||
RP_BINDIR="/tmp/relocatable-python"
|
RP_BINDIR="/tmp/relocatable-python"
|
||||||
RP_ZIP="/tmp/relocatable-python.zip"
|
RP_ZIP="/tmp/relocatable-python.zip"
|
||||||
MP_BINDIR="/tmp/munki-pkg"
|
MP_BINDIR="/tmp/munki-pkg"
|
||||||
@@ -133,6 +134,9 @@ if [ "${DL_RESULT}" != "0" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Create outputs folder
|
||||||
|
/bin/mkdir -p "$TOOLSDIR/outputs"
|
||||||
|
|
||||||
# Create the json file for munki-pkg
|
# Create the json file for munki-pkg
|
||||||
/bin/cat << JSONFILE > "$TOOLSDIR/$TYPE/build-info.json"
|
/bin/cat << JSONFILE > "$TOOLSDIR/$TYPE/build-info.json"
|
||||||
{
|
{
|
||||||
@@ -148,3 +152,15 @@ fi
|
|||||||
JSONFILE
|
JSONFILE
|
||||||
# Create the pkg
|
# Create the pkg
|
||||||
"${MP_BINDIR}/munki-pkg-${MP_SHA}/munkipkg" "$TOOLSDIR/$TYPE"
|
"${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"
|
||||||
Reference in new issue
Block a user