Distinct app dir
#!/bin/bash
+APP_DIR=$PREFIX/bin/FirefoxApp
+LAUNCH_SCRIPT=$PREFIX/bin/firefox
+
# 1) Extract the application into a directory under bin
-mkdir -p $PREFIX/bin/Firefox
+mkdir -p $APP_DIR
if [[ $(uname) == Linux ]]; then
- mv * $PREFIX/bin/Firefox/
+ mv * $APP_DIR
elif [[ $(uname) == Darwin ]]; then
pkgutil --expand firefox.pkg firefox
cpio -i -I firefox/Payload
- cp -rf Firefox.app/* $PREFIX/bin/Firefox/
+ cp -rf Firefox.app/* $APP_DIR
fi
# 2) Make a launch script in bin
-LAUNCH_SCRIPT=$PREFIX/bin/firefox
-
if [[ $(uname) == Linux ]]; then
cat <<EOF >$LAUNCH_SCRIPT
#!/bin/bash
-$PREFIX/bin/Firefox/firefox "\$@"
+$APP_DIR/firefox "\$@"
EOF
elif [[ $(uname) == Darwin ]]; then
cat <<EOF >$LAUNCH_SCRIPT
#!/bin/bash
-$PREFIX/bin/Firefox/Contents/MacOS/firefox "\$@"
+$APP_DIR/Contents/MacOS/firefox "\$@"
EOF
fi
