Skip to content

Instantly share code, notes, and snippets.

@stevewood-tx
Created August 31, 2021 14:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevewood-tx/f9d57f624083a2e5fe50c438fed04067 to your computer and use it in GitHub Desktop.
Save stevewood-tx/f9d57f624083a2e5fe50c438fed04067 to your computer and use it in GitHub Desktop.
Package Build Script
#!/bin/bash
## basic package, not signed. Provide name you want and version as command line arguments.
args=("$@")
pkgName="${args[0]}"
echo "Supply the package name and version: build.sh <pkgname> <version>"
# get date for package name
myDate=`date +%Y%m%d`
# Name of the package.
NAME="${pkgName}"
# Once installed the identifier is used as the filename for a receipt files in /var/db/receipts/.
IDENTIFIER="com.omnicom.$NAME"
# Package version number.
VERSION="${args[1]}"
# Remove any unwanted .DS_Store files.
find ROOT/ -name '*.DS_Store' -type f -delete
# Build package.
/usr/bin/pkgbuild \
--root ROOT/ \
--scripts scripts/ \
--identifier "$IDENTIFIER" \
--version "$VERSION" \
"Output/$NAME-$VERSION-$myDate.pkg"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment