Diff

Differences From Artifact [a40d90084e]:

To Artifact [ba9acb7d77]:


     1      1   #!/bin/bash
     2      2   # Shell Script to make Mac OS X Releases of CACKey
     3      3   # Kenneth Van Alstyne
     4      4   # kenneth.l.vanalstyne@usace.army.mil
     5      5   # 20100712
            6  +CACKEY_VERSION=`cat configure.ac | grep AC_INIT | cut -d " " -f 2 | sed 's_)__'`
     6      7   
     7      8   # Usage function
     8      9   usage() {
     9     10   	echo "Usage: build_osx.sh <target>"
    10     11   	echo Where target is one of:
    11     12   	echo "    panther  - (Builds 10.3 Library for PPCG3)"
    12     13   	echo "    tiger  - (Builds Universal 10.4 Library for PPCG3/i386)"
................................................................................
    16     17   	echo "    clean - (Cleans up)"
    17     18   	echo "Run from CACKey Build Root."
    18     19   	exit $?
    19     20   }
    20     21   
    21     22   # Clean up function
    22     23   clean() {
           24  +	for PMDOC in build/cackey_osx_build/*_pmbuild.pmdoc/*.in; do
           25  +		PMDOC="`echo "${PMDOC}" | sed 's_.in__g'`"
           26  +		rm -f "${PMDOC}"
           27  +	done
           28  +	rm -f build/cackey_osx_build/cackey.dylib
    23     29   	rm -rf macbuild
    24     30   	make distclean
    25     31   }
    26     32   
    27     33   # Directory creation function
    28     34   makedir() {
    29     35   	if [ ! -d macbuild ]; then
................................................................................
   140    146   	done
   141    147   	lipo -create ${DARCHLIST} -output macbuild/${OSX}/libcackey_g.dylib
   142    148   	rm macbuild/${OSX}/libcackey*.dylib.*
   143    149   }
   144    150   
   145    151   # Function to build Mac OS X Packages
   146    152   pkgbuild() {
          153  +	rm -f build/cackey_osx_build/cackey.dylib
          154  +	ln macbuild/${OSX}/libcackey.dylib build/cackey_osx_build/cackey.dylib
          155  +	for PMDOC in build/cackey_osx_build/${OSX}_pmbuild.pmdoc/*.in; do
          156  +		PMDOC="`echo "${PMDOC}" | sed 's_.in__g'`"
          157  +		sed "s|@@BUILDROOTDIR@@|$(pwd)|g" ${PMDOC}.in > ${PMDOC}
          158  +	done
   147    159   	if [ ${OSX} == "Panther" ]; then
   148    160   		EXT=mpkg
   149    161   	else
   150    162   		EXT=pkg
   151    163   	fi
   152         -	/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker -d build/cackey_osx_build/${OSX}_pmbuild.pmdoc -o macbuild/pkg/CACKey_${OSX}.${EXT}
   153         -	tar --create --directory macbuild/pkg/ --file macbuild/pkg/CACKey_${OSX}.${EXT}.tar CACKey_${OSX}.${EXT}
   154         -	gzip -9 macbuild/pkg/CACKey_${OSX}.${EXT}.tar
   155         -	rm -rf macbuild/pkg/CACKey_${OSX}.${EXT}
          164  +	/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker -d build/cackey_osx_build/${OSX}_pmbuild.pmdoc -o macbuild/pkg/CACKey_${CACKEY_VERSION}_${OSX}.${EXT}
          165  +	tar --create --directory macbuild/pkg/ --file macbuild/pkg/CACKey_${CACKEY_VERSION}_${OSX}.${EXT}.tar CACKey_${CACKEY_VERSION}_${OSX}.${EXT}
          166  +	gzip -9 macbuild/pkg/CACKey_${CACKEY_VERSION}_${OSX}.${EXT}.tar
          167  +	rm -rf macbuild/pkg/CACKey_${CACKEY_VERSION}_${OSX}.${EXT}
          168  +	rm -f build/cackey_osx_build/cackey.dylib
   156    169   	echo "${OSX} build complete"
   157    170   }
   158    171   
   159    172   # Take command line arguments and execute
   160    173   case "$1" in
   161    174   	"")
   162    175   		usage