From 74528c76ea08e91b18b5b8f8cbc7005b6fce2cbb Mon Sep 17 00:00:00 2001 From: "Jacob F. Grant" Date: Sun, 7 Oct 2018 15:28:46 -0700 Subject: [PATCH] Fix package symbolic link install error On macOS, the directory /usr/local/bin/ is not created by default. Therefore, the postinstall script that generated the munkitap symbolic link would fail on systems where it did not already exist. This error can be avoided by installing the symbolic link as part of the package and not by a script. The pkg build script has been updated to automatically include the symbolic link and the postinstall script has been removed. The package version has been bumped up to reflect this change. --- package/build-info.plist | 2 +- package/munkitap_build.sh | 16 +++++++--------- package/scripts/postinstall | 18 ------------------ 3 files changed, 8 insertions(+), 28 deletions(-) delete mode 100755 package/scripts/postinstall diff --git a/package/build-info.plist b/package/build-info.plist index 49b1b33..4ae07a5 100644 --- a/package/build-info.plist +++ b/package/build-info.plist @@ -17,6 +17,6 @@ suppress_bundle_relocation version - 0.2.0 + 0.2.1 diff --git a/package/munkitap_build.sh b/package/munkitap_build.sh index 858311b..08cf742 100755 --- a/package/munkitap_build.sh +++ b/package/munkitap_build.sh @@ -8,7 +8,7 @@ # Created by Jacob F. Grant # # Written: 06/28/18 -# Updated: 06/28/18 +# Updated: 10/07/18 # @@ -27,16 +27,10 @@ then exit 2 fi -if [ ! -f "./scripts/postinstall" ] -then - echo 'missing postinstall script' - exit 3 -fi - if [ ! -f "../code/munkitap" ] || [ ! -d "../code/munkitaplib" ] then echo 'munkitap files not found' - exit 4 + exit 3 fi # Create payload directory @@ -45,10 +39,14 @@ then rm -r ./payload fi mkdir -p ./payload/Library/Munkitap/ +mkdir -p ./payload/usr/local/bin/ -# Move files +# Copy munkitap files cp ../code/munkitap ./payload/Library/Munkitap/ cp -r ../code/munkitaplib ./payload/Library/Munkitap/ +# Create symbolic link in /usr/local/bin/ +ln -s /Library/Munkitap/munkitap ./payload/usr/local/bin/munkitap + # Build package "$MUNKIPKG" . diff --git a/package/scripts/postinstall b/package/scripts/postinstall deleted file mode 100755 index 6a0d919..0000000 --- a/package/scripts/postinstall +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -# Munkitap Postinstall Script -# -# postinstall.sh -# -# -# Created by Jacob F. Grant -# -# Written: 06/24/18 -# Updated: 06/25/18 -# - -# Link munkitap in PATH -if ! [ -L "$3"usr/local/bin/munkitap ] -then - ln -s "$3"Library/Munkitap/munkitap "$3"usr/local/bin/munkitap -fi