libtommath: Fix possible integer overflow CVE-2023-36328
[heimdal.git] / packages / mac / mac.sh
blobd84557be2a6a233ec7161a405fb943ba6e532827
1 #!/bin/sh
2 # $Id$
4 dbase=`dirname $0`
5 base=`cd $dbase && pwd`
6 config=${base}/../../configure
8 destdir=`pwd`/destdir
9 builddir=`pwd`/builddir
10 imgdir=`pwd`/imgdir
12 rm -rf ${destdir} ${builddir} ${imgdir} || exit 1
13 mkdir ${destdir} || exit 1
14 mkdir ${builddir} || exit 1
15 mkdir ${imgdir} || exit 1
17 cd ${builddir} || exit 1
19 version=`sh ${config} --help 2>/dev/null | head -1 | sed 's/.*Heimdal \([^ ]*\).*/\1/'`
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
28 echo "Build"
29 env \
30 CODE_SIGN_IDENTITY="Developer ID Application:" \
31 make all > /dev/null || exit 1
33 echo "Run regression suite"
34 make check > /dev/null || exit 1
35 echo "Install"
36 make install DESTDIR=${destdir} > /dev/null || exit 1
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
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
52 echo "Clean"
53 rm -rf ${destdir} ${builddir} ${imgdir} || exit 1
55 echo "Done!"
56 exit 0