2014-08-01 12:55:31 +04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Script to create the Mac installer using the packages tool from
|
|
|
|
# http://s.sudre.free.fr/Software/Packages/about.html
|
|
|
|
#
|
|
|
|
|
|
|
|
# the path of installation must be given as parameter
|
|
|
|
if [ -z "$1" ]; then
|
2014-08-27 13:40:10 +04:00
|
|
|
echo "ERROR: Provide the path to CMAKE_INSTALL_DIR to this script as first parameter."
|
2014-08-01 12:55:31 +04:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2014-08-27 13:40:10 +04:00
|
|
|
if [ -z "$2" ]; then
|
|
|
|
echo "ERROR: Provide the path to build directory as second parameter."
|
|
|
|
exit 1
|
2014-08-01 12:55:31 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
install_path=$1
|
2014-08-27 13:40:10 +04:00
|
|
|
build_path=$2
|
|
|
|
prjfile=$build_path/admin/osx/macosx.pkgproj
|
2014-08-01 12:55:31 +04:00
|
|
|
|
|
|
|
# The name of the installer package
|
2014-08-27 21:13:13 +04:00
|
|
|
installer="ownCloud-@MIRALL_VERSION_FULL@@MIRALL_VERSION_SUFFIX@"
|
2014-08-27 14:49:22 +04:00
|
|
|
installer_file="$installer.pkg"
|
2014-08-26 18:01:36 +04:00
|
|
|
|
|
|
|
# set the installer name to the copied prj config file
|
2014-08-27 14:49:22 +04:00
|
|
|
/usr/local/bin/packagesutil --file $prjfile set project name "$installer"
|
2014-08-01 12:55:31 +04:00
|
|
|
|
|
|
|
# The command line tool of the "Packages" tool, see link above.
|
|
|
|
pkgbuild=/usr/local/bin/packagesbuild
|
|
|
|
|
|
|
|
$pkgbuild -F $install_path $prjfile
|
|
|
|
rc=$?
|
|
|
|
|
|
|
|
if [ $rc == 0 ]; then
|
2014-08-26 18:01:36 +04:00
|
|
|
echo "Successfully created $installer_file"
|
2014-08-01 12:55:31 +04:00
|
|
|
else
|
2014-08-26 18:01:36 +04:00
|
|
|
echo "Failed to create $installer_file"
|
2014-08-01 12:55:31 +04:00
|
|
|
exit 3
|
|
|
|
fi
|
|
|
|
|
|
|
|
# FIXME: Sign the finished package.
|
|
|
|
# See http://s.sudre.free.fr/Software/documentation/Packages/en/Project_Configuration.html#5
|
|
|
|
# certname=gdbsign
|
|
|
|
# productsign --cert $certname admin/$installer ./$installer
|
2014-08-27 13:40:10 +04:00
|
|
|
|
|
|
|
# FIXME: OEMs?
|