| 1 |
#!/bin/sh |
| 2 |
# $Id$ |
| 3 |
|
| 4 |
dbase=`dirname $0` |
| 5 |
base=`cd $dbase && pwd` |
| 6 |
config=${base}/../../configure |
| 7 |
|
| 8 |
destdir=`pwd`/destdir |
| 9 |
builddir=`pwd`/builddir |
| 10 |
imgdir=`pwd`/imgdir |
| 11 |
|
| 12 |
rm -rf ${destdir} ${builddir} ${imgdir} || exit 1 |
| 13 |
mkdir ${destdir} || exit 1 |
| 14 |
mkdir ${builddir} || exit 1 |
| 15 |
mkdir ${imgdir} || exit 1 |
| 16 |
|
| 17 |
cd ${builddir} || exit 1 |
| 18 |
|
| 19 |
version=`sh ${config} --help 2>/dev/null | head -1 | sed 's/.*Heimdal \([^ ]*\).*/\1/'` |
| 20 |
|
| 21 |
echo "Building Mac universal binary package for Heimdal ${version}" |
| 22 |
echo "Configure" |
| 23 |
env \ |
| 24 |
CFLAGS="-arch i386 -arch x86_64" \ |
| 25 |
LDFLAGS="-arch i386 -arch x86_64" \ |
| 26 |
${config} --disable-dependency-tracking > log || exit 1 |
| 27 |
|
| 28 |
echo "Build" |
| 29 |
env \ |
| 30 |
CODE_SIGN_IDENTITY="Developer ID Application:" \ |
| 31 |
make all > /dev/null || exit 1 |
| 32 |
|
| 33 |
echo "Run regression suite" |
| 34 |
make check > /dev/null || exit 1 |
| 35 |
echo "Install" |
| 36 |
make install DESTDIR=${destdir} > /dev/null || exit 1 |
| 37 |
|
| 38 |
echo "Build package" |
| 39 |
xcrun productbuild \ |
| 40 |
--identifier org.h5l.heimdal \ |
| 41 |
--version ${version} \ |
| 42 |
--root ${destdir} / \ |
| 43 |
--resources ${base}/Resources \ |
| 44 |
--sign 'Developer ID Installer:' \ |
| 45 |
${imgdir}/Heimdal-${version}.pkg |
| 46 |
|
| 47 |
cd .. |
| 48 |
echo "Build disk image" |
| 49 |
rm "heimdal-${version}.dmg" |
| 50 |
/usr/bin/hdiutil create -volname "Heimdal-${version}" -srcfolder ${imgdir} "heimdal-${version}.dmg" || exit 1 |
| 51 |
|
| 52 |
echo "Clean" |
| 53 |
rm -rf ${destdir} ${builddir} ${imgdir} || exit 1 |
| 54 |
|
| 55 |
echo "Done!" |
| 56 |
exit 0 |