1#!/bin/sh 2echo "Script to invoke Jam and then package spectro/oemdnld binary." 3 4# Typical environment variables: 5# (NOTE some systems don't export these ENV vars. by default !!!) 6# 7# Platform $OSTYPE $MACHTYPE $HOSTTYPE 8# 9# Win2K [CMD.EXE] (none) (none) (none) 10# 11# Cygwin Win2K [bash] cygwin i686-pc-cygwin i686 12# 13# OS X PPC 10.3 [zsh] darwin7.0 powerpc (none) 14# 15# OS X i386 10.4 [bash] darwin8.0 i386-apple-darwin8.0 i386 16# 17# OS X i386 10.5 [bash] darwin9.0 i386-apple-darwin9.0 i386 18# 19# OS X i386 10.6 [bash] darwin10.0 x86_64-apple-darwin10.0 x86_64 20# 21# OS X i386 10.7 [bash] darwin11 x86_64-apple-darwin11 x86_64 22# 23# Linux RH 4.0 [bash] linux-gnu i686-redhat-linux-gnu i686 24# 25# Linux Fedora 7.1 [bash] linux-gnu i386-redhat-linux-gnu i386 26# Linux Ubuntu ??7 linux-gnu i486-pc-linux-gnu i686 27# 28# Linux Fedora 7.1 64 bit [bash] linux-gnu x86_64-redhat-linux-gnu x86_64 29# Ubuntu 12.10 64 bit [bash] linux-gnu x86_64-pc-linux-gnu x86_64 30# 31# FreeBSD 9.1 64 bit [bash] freebsd9.1 amd64-portbld-freebsd9.1 amd64 32# 33 34# We don't mark the binaries with the version, so that we don'y 35# haveto keep the web page in sync with ArgyllCMS. 36 37echo "About to make OEMdnld binary distribution" 38 39TOPDIR=OEMdist 40 41# Make sure that some environment variable are visible to Jam: 42export OSTYPE MACHTYPE HOSTTYPE 43 44# Make sure it's built and installed 45if ! jam -q -fJambase -j${NUMBER_OF_PROCESSORS:-2} -sBUILTIN_TIFF=true -sBUILTIN_JPEG=true "<spectro>oemdnld" ; then 46 echo "Build failed!" 47 exit 1 48fi 49 50# Maybe we could get Jam to do the following ? 51 52if [ X$OS = "XWindows_NT" ] ; then 53 echo "We're on MSWindows!" 54 # Hack cross comile 55 if [ X$COMPILER = "XMINGW64" ] ; then 56 echo "We're cross compiling to MSWin 64 bit !" 57 PACKAGE=oemdnld_win64_exe.zip 58 EXE=.exe 59 unset USETAR 60 else 61 # ~~ should detect native 64 bit here ~~ 62 echo "We're on MSWin 32 bit !" 63 PACKAGE=oemdnld_win32_exe.zip 64 EXE=.exe 65 unset USETAR 66 fi 67else if [ X$OSTYPE = "Xdarwin7.0" ] ; then 68 echo "We're on OSX 10.3 PPC!" 69 PACKAGE=oemdnld_osx10.3_ppc_bin.tgz 70 USETAR=true 71 EXE= 72else if [ X$OSTYPE = "Xdarwin8.0" ] ; then 73 if [ X$MACHTYPE = "Xi386-apple-darwin8.0" ] ; then 74 echo "We're on OSX 10.4 i386!" 75 PACKAGE=oemdnld_osx10.4_i86_bin.tgz 76 else if [ X$MACHTYPE = "Xpowerpc-apple-darwin8.0" ] ; then 77 echo "We're on OSX 10.4 PPC!" 78 PACKAGE=oemdnld_osx10.4_ppc_bin.tgz 79 fi 80 fi 81 EXE= 82 USETAR=true 83else if [ X$OSTYPE = "Xdarwin10.0" \ 84 -o X$OSTYPE = "Xdarwin11" ] ; then 85 if [ X$HOSTTYPE = "Xx86_64" ] ; then 86 echo "We're on OSX 10.6 x86_64!" 87 PACKAGE=oemdnld_osx10.6_x86_64_bin.tgz 88 fi 89 EXE= 90 USETAR=true 91else if [ X$OSTYPE = "Xlinux-gnu" ] ; then 92 if [[ "$MACHTYPE" = x86_64-*-linux-gnu ]] ; then 93 echo "We're on Linux x86_64!" 94 PACKAGE=oemdnld_linux_x86_64_bin.tgz 95 else if [[ "$MACHTYPE" = *86-*-linux-gnu ]] ; then 96 echo "We're on Linux x86!" 97 PACKAGE=oemdnld_linux_x86_bin.tgz 98 fi 99 fi 100 EXE= 101 USETAR=true 102fi 103fi 104fi 105fi 106fi 107 108if [ X$PACKAGE = "X" ] ; then 109 echo "Unknown host - build failed!" 110 exit 1 111fi 112 113echo "Making OEMdnld binary distribution $PACKAGE" 114 115rm -rf $TOPDIR 116mkdir $TOPDIR 117 118# Collect the names of all the files that we're going to package 119 120allfiles="spectro/oemdnld${EXE}" 121 122# Copy all the files to the package top directory 123for i in ${allfiles}; do 124 path=${i%/*} # extract path without filename 125 file=${i##*/} # extract filename 126 if [ $path = $i ] ; then 127 path= 128 fi 129 cp $i $TOPDIR/${file} 130done 131 132# Create the package 133rm -f $PACKAGE 134if [ X$USETAR = "Xtrue" ] ; then 135 cd $TOPDIR 136 tar -czvf ../$PACKAGE * 137 # tar -xzf to extract 138 # tar -tzf to list 139 cd .. 140else 141 cd $TOPDIR 142 zip -9 -r ../$PACKAGE * 143 # unzip to extract 144 # unzip -l to list 145 cd .. 146fi 147rm -rf $TOPDIR 148echo "Done GNU Argyll binary distribution $PACKAGE" 149 150exit 0 151 152