Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. TempDir="/tmp/pkg"
  4. AppPath=$1
  5. TargetPath=$2
  6. PackageIdentifier=$3
  7. Certificate=$4
  8.  
  9. if [ $# -ne 3 ]
  10. then
  11. echo "Usage: $0 <AppPath> <TargetPath> <PackageIdentifier> <CertificateCommonName or CertificateChecksum>"
  12. exit 1
  13. fi
  14.  
  15. rm -rf ${TempDir}
  16. mkdir -p ${TempDir}
  17. mkdir -p ${TargetPath}
  18. cp -r ${AppPath} ${TempDir}
  19.  
  20. cd /tmp
  21.  
  22. pkgbuild --analyze --root ${TempDir} package.plist
  23. pkgbuild --root ${TempDir} --component-plist package.plist --identifier ${PackageIdentifier} package.pkg
  24. productbuild --synthesize --package package.pkg packageDistribution.xml
  25. productbuild --distribution ./packageDistribution.xml --package-path . InstallerPackage.pkg
  26. productsign --timestamp=none --sign "$Certificate" InstallerPackage.pkg SignedInstallerPackage.pkg
  27.  
  28. rm package.plist
  29. rm package.pkg
  30. rm packageDistribution.xml
  31. rm -rf ${TempDir}
  32. mv SignedInstallerPackage.pkg ${TargetPath}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement