2015-05-15 19:56:22 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )"
|
|
|
|
cd $ROOT
|
|
|
|
|
|
|
|
# deleting dist
|
|
|
|
echo Deleting dist folder
|
2017-04-18 18:12:24 -04:00
|
|
|
rm -rf $ROOT/dist &>/dev/null 2>&1
|
2015-05-15 19:56:22 -04:00
|
|
|
|
|
|
|
# build the .app
|
|
|
|
echo Building OnionShare.app
|
2017-02-22 16:34:20 -05:00
|
|
|
pyinstaller $ROOT/install/pyinstaller.spec
|
2017-04-18 18:12:24 -04:00
|
|
|
python3 $ROOT/install/get-tor-osx.py
|
2017-02-22 16:34:20 -05:00
|
|
|
|
|
|
|
# create a symlink of onionshare-gui called onionshare, for the CLI version
|
|
|
|
cd $ROOT/dist/OnionShare.app/Contents/MacOS
|
|
|
|
ln -s onionshare-gui onionshare
|
|
|
|
cd $ROOT
|
2015-05-15 19:56:22 -04:00
|
|
|
|
2016-09-04 22:21:09 -04:00
|
|
|
if [ "$1" = "--release" ]; then
|
|
|
|
mkdir -p dist
|
2017-02-22 16:34:20 -05:00
|
|
|
APP_PATH="$ROOT/dist/OnionShare.app"
|
|
|
|
PKG_PATH="$ROOT/dist/OnionShare.pkg"
|
2016-09-04 22:21:09 -04:00
|
|
|
IDENTITY_NAME_APPLICATION="Developer ID Application: Micah Lee"
|
|
|
|
IDENTITY_NAME_INSTALLER="Developer ID Installer: Micah Lee"
|
2018-11-25 18:52:36 -05:00
|
|
|
ENTITLEMENTS_CHILD_PATH="$ROOT/install/macos_sandbox/child.plist"
|
|
|
|
ENTITLEMENTS_PARENT_PATH="$ROOT/install/macos_sandbox/parent.plist"
|
2015-05-26 11:54:38 -04:00
|
|
|
|
2016-09-04 22:21:09 -04:00
|
|
|
echo "Codesigning the app bundle"
|
2019-04-21 22:13:48 -04:00
|
|
|
codesign \
|
|
|
|
--deep \
|
|
|
|
-s "$IDENTITY_NAME_APPLICATION" \
|
|
|
|
--force \
|
|
|
|
--entitlements "$ENTITLEMENTS_CHILD_PATH" \
|
|
|
|
--timestamp \
|
|
|
|
"$APP_PATH"
|
|
|
|
codesign \
|
|
|
|
-s "$IDENTITY_NAME_APPLICATION" \
|
|
|
|
--force \
|
|
|
|
--entitlements "$ENTITLEMENTS_PARENT_PATH" \
|
|
|
|
--timestamp \
|
|
|
|
"$APP_PATH"
|
2015-05-15 21:09:09 -04:00
|
|
|
|
2016-09-04 22:21:09 -04:00
|
|
|
echo "Creating an installer"
|
2019-04-21 22:13:48 -04:00
|
|
|
productbuild \
|
|
|
|
--sign "$IDENTITY_NAME_INSTALLER" \
|
|
|
|
--component "$APP_PATH" /Applications \
|
|
|
|
--timestamp \
|
|
|
|
"$PKG_PATH"
|
2016-09-04 22:21:09 -04:00
|
|
|
|
|
|
|
echo "Cleaning up"
|
|
|
|
rm -rf "$APP_PATH"
|
|
|
|
|
|
|
|
echo "All done, your installer is in: $PKG_PATH"
|
2015-05-26 11:54:38 -04:00
|
|
|
fi
|