Patrick Welche <prlw1@cam.ac.uk>
[netbsd-mini2440.git] / crypto / dist / heimdal / packages / mac / mac.sh
bloba697bbc13c3362fd46b33a5c706badfa42db2dae
1 #!/bin/sh
2 # $Heimdal: mac.sh 22177 2007-12-05 01:43:30Z lha $
3 # $NetBSD$
5 dbase=`dirname $0`
6 base=`cd $dbase && pwd`
7 config=${base}/../../configure
9 destdir=`pwd`/destdir
10 builddir=`pwd`/builddir
11 imgdir=`pwd`/imgdir
13 rm -rf ${destdir} ${builddir} ${imgdir} || exit 1
14 mkdir ${destdir} || exit 1
15 mkdir ${builddir} || exit 1
16 mkdir ${imgdir} || exit 1
18 cd ${builddir} || exit 1
20 version=`sh ${config} --help 2>/dev/null | head -1 | sed 's/.*Heimdal \([^ ]*\).*/\1/'`
22 echo "Building Mac universal binary package for Heimdal ${version}"
23 echo "Configure"
24 env \
25 CFLAGS="-arch i386 -arch ppc" \
26 LDFLAGS="-arch i386 -arch ppc" \
27 ${config} > log || exit 1
28 echo "Build"
29 make all > /dev/null || exit 1
30 echo "Run regression suite"
31 make check > /dev/null || exit 1
32 echo "Install"
33 make install DESTDIR=${destdir} > /dev/null || exit 1
35 echo "Build package"
36 /Developer/usr/bin/packagemaker \
37 --version "${version}" \
38 --root ${destdir} \
39 --info ${base}/Info.plist \
40 --out ${imgdir}/Heimdal.pkg \
41 --resources ${base}/Resources \
42 --domain system || exit 1
44 cd ..
45 echo "Build disk image"
46 rm "heimdal-${version}.dmg"
47 /usr/bin/hdiutil create -volname "Heimdal-${version}" -srcfolder ${imgdir} "heimdal-${version}.dmg" || exit 1
49 echo "Clean"
50 rm -rf ${destdir} ${builddir} ${imgdir} || exit 1
52 echo "Done!"
53 exit 0