PageRenderTime 26ms CodeModel.GetById 17ms app.highlight 6ms RepoModel.GetById 2ms app.codeStats 0ms

/crypto/heimdal/packages/mac/mac.sh

https://bitbucket.org/freebsd/freebsd-head/
Shell | 52 lines | 40 code | 10 blank | 2 comment | 14 complexity | bf2e6688ee537d9bdaded6e5155cd2d1 MD5 | raw file
 1#!/bin/sh
 2# $Id: mac.sh 22177 2007-12-05 01:43:30Z lha $
 3
 4dbase=`dirname $0`
 5base=`cd $dbase && pwd`
 6config=${base}/../../configure
 7
 8destdir=`pwd`/destdir
 9builddir=`pwd`/builddir
10imgdir=`pwd`/imgdir
11
12rm -rf ${destdir} ${builddir} ${imgdir} || exit 1
13mkdir ${destdir} || exit 1
14mkdir ${builddir} || exit 1
15mkdir ${imgdir} || exit 1
16
17cd ${builddir} || exit 1
18
19version=`sh ${config} --help 2>/dev/null | head -1 | sed 's/.*Heimdal \([^ ]*\).*/\1/'`
20
21echo "Building Mac universal binary package for Heimdal ${version}"
22echo "Configure"
23env \
24  CFLAGS="-arch i386 -arch ppc" \
25  LDFLAGS="-arch i386 -arch ppc" \
26  ${config} > log || exit 1
27echo "Build"
28make all > /dev/null || exit 1
29echo "Run regression suite"
30make check > /dev/null || exit 1
31echo "Install"
32make install DESTDIR=${destdir} > /dev/null || exit 1 
33
34echo "Build package"
35/Developer/usr/bin/packagemaker \
36    --version "${version}" \
37    --root ${destdir} \
38    --info ${base}/Info.plist \
39    --out ${imgdir}/Heimdal.pkg \
40    --resources ${base}/Resources \
41    --domain system || exit 1
42
43cd ..
44echo "Build disk image"
45rm "heimdal-${version}.dmg"
46/usr/bin/hdiutil create -volname "Heimdal-${version}" -srcfolder ${imgdir} "heimdal-${version}.dmg" || exit 1
47
48echo "Clean"
49rm -rf ${destdir} ${builddir} ${imgdir} || exit 1
50
51echo "Done!"
52exit 0