#/bin/sh set -e usage() { echo "usage: $0 VERSION path/to/icon.icns path/to/binary output/dir" } if [ $# -eq 0 ]; then usage exit fi VERSION=$1 ICNFILE=$2 BINFILE=$3 OUTPATH=$4 mkdir -p $OUTPATH/yarr.app/Contents/MacOS mkdir -p $OUTPATH/yarr.app/Contents/Resources mv $BINFILE $OUTPATH/yarr.app/Contents/MacOS/yarr cp $ICNFILE $OUTPATH/yarr.app/Contents/Resources/icon.icns chmod u+x $OUTPATH/yarr.app/Contents/MacOS/yarr echo -n 'APPL????' >$OUTPATH/yarr.app/Contents/PkgInfo cat <$OUTPATH/yarr.app/Contents/Info.plist CFBundleName yarr CFBundleDisplayName yarr CFBundleIdentifier nkanaev.yarr CFBundleVersion $VERSION CFBundlePackageType APPL CFBundleExecutable yarr CFBundleIconFile icon LSApplicationCategoryType public.app-category.news NSHighResolutionCapable True LSMinimumSystemVersion 10.13 LSUIElement NSHumanReadableCopyright Copyright © 2020 nkanaev. All rights reserved. EOF