mitmproxy/release/osx-binaries
2015-03-12 13:26:21 +11:00

55 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
# Quick and dangerous script for building OSX binaries.
# A few quirks to note, which should be re-checked every release:
# - We require the latest development version of PyInstaller.
# To run, first install netlib and mitmproxy, then run
#
# ./release/osx-binaries
#
# From the top-level mitmproxy directory.
usage ()
{
echo 'Usage : ./release/osx-binaries /path/to/pyinstaller.py'
echo 'Run from the top-level mitmproxy directory'
exit
}
if [ "$1" = "" ]
then
usage
fi
TMPDIR=./tmp
PYINST_CMD=$1" -F --clean"
CACHE="~/Library/Application Support/pyinstaller"
rm -f dist/*
rm -rf $TMPDIR
rm -rf $CACHE
$PYINST_CMD ./release/mitmdump.spec
echo "Running mitmdump..."
./dist/mitmdump --version || exit 1
$PYINST_CMD ./release/mitmproxy.spec
echo "Running mitmproxy..."
./dist/mitmproxy --version || exit 1
$PYINST_CMD ./release/mitmweb.spec
echo "Running mitmweb..."
./dist/mitmweb --version || exit 1
DST=osx-mitmproxy-`./dist/mitmdump --shortversion 2>&1`
mkdir -p $TMPDIR/$DST
cp ./dist/mitmproxy $TMPDIR/$DST
cp ./dist/mitmdump $TMPDIR/$DST
cshape ./doc-src $TMPDIR/$DST/doc
cd $TMPDIR
tar -czvf $DST.tar.gz $DST