create_mac_pkg.sh 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/bash
  2. # Script to create the Mac installer using the packages tool from
  3. # http://s.sudre.free.fr/Software/Packages/about.html
  4. #
  5. # the path of installation must be given as parameter
  6. if [ -z "$1" ]; then
  7. echo "ERROR: Provide the CMAKE_INSTALL_DIR to this script."
  8. exit 1
  9. fi
  10. prjfile="admin/osx/macosx.pkgproj"
  11. if [ ! -f $prjfile ]; then
  12. echo "ERROR: macosx.pkgproj not in admin dir, start from CMAKE_SOURCE_DIR!"
  13. exit 2
  14. fi
  15. pack="admin/ownCloud Installer.pkg"
  16. rm -f $pack
  17. install_path=$1
  18. # The name of the installer package
  19. installer=ownCloud\ Installer.pkg
  20. # The command line tool of the "Packages" tool, see link above.
  21. pkgbuild=/usr/local/bin/packagesbuild
  22. $pkgbuild -F $install_path $prjfile
  23. rc=$?
  24. if [ $rc == 0 ]; then
  25. echo "Successfully created $pack"
  26. else
  27. echo "Failed to create $pack"
  28. exit 3
  29. fi
  30. # FIXME: Sign the finished package.
  31. # See http://s.sudre.free.fr/Software/documentation/Packages/en/Project_Configuration.html#5
  32. # certname=gdbsign
  33. # productsign --cert $certname admin/$installer ./$installer