Hex Artifact Content

Artifact b6fc0d5cbb293efa4cc6511d8b800c5b4cbd0cf9:


0000: 23 21 2f 62 69 6e 2f 62 61 73 68 0a 23 20 53 68  #!/bin/bash.# Sh
0010: 65 6c 6c 20 53 63 72 69 70 74 20 74 6f 20 6d 61  ell Script to ma
0020: 6b 65 20 4d 61 63 20 4f 53 20 58 20 52 65 6c 65  ke Mac OS X Rele
0030: 61 73 65 73 20 6f 66 20 43 41 43 4b 65 79 0a 23  ases of CACKey.#
0040: 20 4b 65 6e 6e 65 74 68 20 56 61 6e 20 41 6c 73   Kenneth Van Als
0050: 74 79 6e 65 0a 23 20 6b 65 6e 6e 79 40 63 6f 72  tyne.# kenny@cor
0060: 65 61 64 61 70 74 69 76 65 2e 63 6f 6d 0a 43 41  eadaptive.com.CA
0070: 43 4b 45 59 5f 56 45 52 53 49 4f 4e 3d 60 63 61  CKEY_VERSION=`ca
0080: 74 20 63 6f 6e 66 69 67 75 72 65 2e 61 63 20 7c  t configure.ac |
0090: 20 67 72 65 70 20 41 43 5f 49 4e 49 54 20 7c 20   grep AC_INIT | 
00a0: 63 75 74 20 2d 64 20 22 20 22 20 2d 66 20 32 20  cut -d " " -f 2 
00b0: 7c 20 73 65 64 20 27 73 5f 29 5f 5f 27 60 0a 0a  | sed 's_)__'`..
00c0: 23 20 43 68 65 63 6b 20 74 6f 20 73 65 65 20 69  # Check to see i
00d0: 66 20 77 65 27 72 65 20 62 75 69 6c 64 69 6e 67  f we're building
00e0: 20 6f 6e 20 4d 61 63 20 4f 53 20 58 20 31 30 2e   on Mac OS X 10.
00f0: 37 20 22 4c 69 6f 6e 22 20 6f 72 20 6e 65 77 65  7 "Lion" or newe
0100: 72 0a 69 66 20 5b 20 22 60 75 6e 61 6d 65 20 2d  r.if [ "`uname -
0110: 72 20 7c 20 63 75 74 20 2d 64 20 2e 20 2d 66 20  r | cut -d . -f 
0120: 31 60 22 20 2d 67 65 20 22 31 31 22 20 5d 3b 20  1`" -ge "11" ]; 
0130: 74 68 65 6e 0a 09 4c 49 4f 4e 42 55 49 4c 44 3d  then..LIONBUILD=
0140: 31 0a 66 69 0a 0a 23 20 55 73 61 67 65 20 66 75  1.fi..# Usage fu
0150: 6e 63 74 69 6f 6e 0a 75 73 61 67 65 28 29 20 7b  nction.usage() {
0160: 0a 09 65 63 68 6f 20 22 55 73 61 67 65 3a 20 62  ..echo "Usage: b
0170: 75 69 6c 64 5f 6f 73 78 2e 73 68 20 3c 74 61 72  uild_osx.sh <tar
0180: 67 65 74 3e 22 0a 09 65 63 68 6f 20 57 68 65 72  get>"..echo Wher
0190: 65 20 74 61 72 67 65 74 20 69 73 20 6f 6e 65 20  e target is one 
01a0: 6f 66 3a 0a 09 65 63 68 6f 20 22 20 20 20 20 6c  of:..echo "    l
01b0: 65 6f 70 61 72 64 20 20 2d 20 28 42 75 69 6c 64  eopard  - (Build
01c0: 73 20 55 6e 69 76 65 72 73 61 6c 20 31 30 2e 35  s Universal 10.5
01d0: 20 4c 69 62 72 61 72 79 20 66 6f 72 20 50 50 43   Library for PPC
01e0: 47 34 2f 69 33 38 36 29 22 0a 09 65 63 68 6f 20  G4/i386)"..echo 
01f0: 22 20 20 20 20 73 6c 61 6e 64 75 70 20 2d 20 28  "    slandup - (
0200: 42 75 69 6c 64 73 20 55 6e 69 76 65 72 73 61 6c  Builds Universal
0210: 20 31 30 2e 36 20 61 6e 64 20 55 70 20 4c 69 62   10.6 and Up Lib
0220: 72 61 72 79 20 66 6f 72 20 69 33 38 36 2f 78 38  rary for i386/x8
0230: 36 5f 36 34 29 22 0a 09 65 63 68 6f 20 22 20 20  6_64)"..echo "  
0240: 20 20 61 6c 6c 20 2d 20 28 42 75 69 6c 64 73 20    all - (Builds 
0250: 66 6f 72 20 61 6c 6c 20 73 75 70 70 6f 72 74 65  for all supporte
0260: 64 20 74 61 72 67 65 74 73 29 22 0a 09 65 63 68  d targets)"..ech
0270: 6f 20 22 20 20 20 20 63 6c 65 61 6e 20 2d 20 28  o "    clean - (
0280: 43 6c 65 61 6e 73 20 75 70 29 22 0a 09 65 63 68  Cleans up)"..ech
0290: 6f 20 22 52 75 6e 20 66 72 6f 6d 20 43 41 43 4b  o "Run from CACK
02a0: 65 79 20 42 75 69 6c 64 20 52 6f 6f 74 2e 22 0a  ey Build Root.".
02b0: 09 65 63 68 6f 20 22 22 0a 09 65 63 68 6f 20 22  .echo ""..echo "
02c0: 4e 4f 54 45 3a 20 20 4c 65 6f 70 61 72 64 20 62  NOTE:  Leopard b
02d0: 75 69 6c 64 20 72 65 71 75 69 72 65 73 20 6c 65  uild requires le
02e0: 67 61 63 79 20 58 43 6f 64 65 20 33 20 63 6f 6d  gacy XCode 3 com
02f0: 70 6f 6e 65 6e 74 73 20 69 6e 22 0a 09 65 63 68  ponents in"..ech
0300: 6f 20 22 20 20 20 20 20 20 20 2f 44 65 76 65 6c  o "       /Devel
0310: 6f 70 65 72 20 62 65 63 61 75 73 65 20 6f 66 20  oper because of 
0320: 50 6f 77 65 72 50 43 20 73 75 70 70 6f 72 74 2e  PowerPC support.
0330: 22 0a 09 65 63 68 6f 20 22 20 20 20 20 20 20 20  "..echo "       
0340: 41 6c 6c 20 62 75 69 6c 64 73 20 72 65 71 75 69  All builds requi
0350: 72 65 20 67 6e 75 74 61 72 2c 20 61 75 74 6f 6d  re gnutar, autom
0360: 61 6b 65 2c 20 61 6e 64 20 61 75 74 6f 63 6f 6e  ake, and autocon
0370: 66 2e 22 0a 09 65 63 68 6f 20 22 20 20 20 20 20  f."..echo "     
0380: 20 20 49 66 20 79 6f 75 72 20 6e 65 77 65 72 20    If your newer 
0390: 72 65 6c 65 61 73 65 20 6f 66 20 58 43 6f 64 65  release of XCode
03a0: 20 64 6f 65 73 20 6e 6f 74 20 69 6e 63 6c 75 64   does not includ
03b0: 65 20 74 68 65 73 65 22 0a 09 65 63 68 6f 20 22  e these"..echo "
03c0: 20 20 20 20 20 20 20 63 6f 6d 70 6f 6e 65 6e 74         component
03d0: 73 2c 20 49 20 72 65 63 6f 6d 6d 65 6e 64 20 69  s, I recommend i
03e0: 6e 73 74 61 6c 6c 69 6e 67 20 74 68 65 6d 20 66  nstalling them f
03f0: 72 6f 6d 20 4d 61 63 50 6f 72 74 73 2e 22 0a 09  rom MacPorts."..
0400: 65 78 69 74 20 24 3f 0a 7d 0a 0a 23 20 43 6c 65  exit $?.}..# Cle
0410: 61 6e 20 75 70 20 66 75 6e 63 74 69 6f 6e 0a 63  an up function.c
0420: 6c 65 61 6e 28 29 20 7b 0a 09 72 6d 20 2d 66 20  lean() {..rm -f 
0430: 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78  build/cackey_osx
0440: 5f 62 75 69 6c 64 2f 63 61 63 6b 65 79 2e 64 79  _build/cackey.dy
0450: 6c 69 62 0a 09 72 6d 20 2d 72 66 20 62 75 69 6c  lib..rm -rf buil
0460: 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69  d/cackey_osx_bui
0470: 6c 64 2f 50 4b 43 53 31 31 2e 74 6f 6b 65 6e 64  ld/PKCS11.tokend
0480: 0a 09 72 6d 20 2d 72 66 20 50 4b 43 53 31 31 2e  ..rm -rf PKCS11.
0490: 74 6f 6b 65 6e 64 0a 09 72 6d 20 2d 72 66 20 6d  tokend..rm -rf m
04a0: 61 63 62 75 69 6c 64 0a 09 72 6d 20 2d 72 66 20  acbuild..rm -rf 
04b0: 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78  build/cackey_osx
04c0: 5f 62 75 69 6c 64 2f 2a 2e 70 6d 64 6f 63 0a 09  _build/*.pmdoc..
04d0: 6d 61 6b 65 20 64 69 73 74 63 6c 65 61 6e 0a 7d  make distclean.}
04e0: 0a 0a 23 20 44 69 72 65 63 74 6f 72 79 20 63 72  ..# Directory cr
04f0: 65 61 74 69 6f 6e 20 66 75 6e 63 74 69 6f 6e 0a  eation function.
0500: 6d 61 6b 65 64 69 72 28 29 20 7b 0a 09 69 66 20  makedir() {..if 
0510: 5b 20 22 60 75 6e 61 6d 65 20 2d 72 20 7c 20 63  [ "`uname -r | c
0520: 75 74 20 2d 64 20 2e 20 2d 66 20 31 60 22 20 2d  ut -d . -f 1`" -
0530: 6c 74 20 22 31 30 22 20 5d 3b 20 74 68 65 6e 0a  lt "10" ]; then.
0540: 09 09 4c 49 42 54 4f 4f 4c 44 49 52 3d 2f 44 65  ..LIBTOOLDIR=/De
0550: 76 65 6c 6f 70 65 72 2f 75 73 72 2f 73 68 61 72  veloper/usr/shar
0560: 65 2f 6c 69 62 74 6f 6f 6c 0a 09 65 6c 73 65 0a  e/libtool..else.
0570: 09 09 4c 49 42 54 4f 4f 4c 44 49 52 3d 2f 44 65  ..LIBTOOLDIR=/De
0580: 76 65 6c 6f 70 65 72 2f 75 73 72 2f 73 68 61 72  veloper/usr/shar
0590: 65 2f 6c 69 62 74 6f 6f 6c 2f 63 6f 6e 66 69 67  e/libtool/config
05a0: 0a 09 66 69 0a 09 69 66 20 5b 20 21 20 2d 64 20  ..fi..if [ ! -d 
05b0: 6d 61 63 62 75 69 6c 64 20 5d 3b 20 74 68 65 6e  macbuild ]; then
05c0: 0a 09 09 6d 6b 64 69 72 20 6d 61 63 62 75 69 6c  ...mkdir macbuil
05d0: 64 0a 09 09 6d 6b 64 69 72 20 6d 61 63 62 75 69  d...mkdir macbui
05e0: 6c 64 2f 4c 65 6f 70 61 72 64 0a 09 09 6d 6b 64  ld/Leopard...mkd
05f0: 69 72 20 6d 61 63 62 75 69 6c 64 2f 53 6c 61 6e  ir macbuild/Slan
0600: 64 75 70 0a 09 09 6d 6b 64 69 72 20 6d 61 63 62  dup...mkdir macb
0610: 75 69 6c 64 2f 70 6b 67 0a 09 66 69 0a 09 69 66  uild/pkg..fi..if
0620: 20 5b 20 21 20 2d 66 20 63 6f 6e 66 69 67 2e 67   [ ! -f config.g
0630: 75 65 73 73 20 5d 3b 20 74 68 65 6e 0a 09 09 63  uess ]; then...c
0640: 70 20 24 7b 4c 49 42 54 4f 4f 4c 44 49 52 7d 2f  p ${LIBTOOLDIR}/
0650: 63 6f 6e 66 69 67 2e 67 75 65 73 73 20 2e 0a 09  config.guess ...
0660: 66 69 0a 09 69 66 20 5b 20 21 20 2d 66 20 63 6f  fi..if [ ! -f co
0670: 6e 66 69 67 2e 73 75 62 20 5d 3b 20 74 68 65 6e  nfig.sub ]; then
0680: 0a 09 09 63 70 20 24 7b 4c 49 42 54 4f 4f 4c 44  ...cp ${LIBTOOLD
0690: 49 52 7d 2f 63 6f 6e 66 69 67 2e 73 75 62 20 2e  IR}/config.sub .
06a0: 0a 09 66 69 0a 09 69 66 20 5b 20 21 20 2d 66 20  ..fi..if [ ! -f 
06b0: 69 6e 73 74 61 6c 6c 2d 73 68 20 5d 3b 20 74 68  install-sh ]; th
06c0: 65 6e 0a 09 09 63 70 20 24 7b 4c 49 42 54 4f 4f  en...cp ${LIBTOO
06d0: 4c 44 49 52 7d 2f 69 6e 73 74 61 6c 6c 2d 73 68  LDIR}/install-sh
06e0: 20 2e 0a 09 66 69 0a 7d 0a 0a 23 20 42 75 69 6c   ...fi.}..# Buil
06f0: 64 20 66 75 6e 63 74 69 6f 6e 20 66 6f 72 20 4c  d function for L
0700: 65 6f 70 61 72 64 0a 6c 65 6f 70 61 72 64 28 29  eopard.leopard()
0710: 20 7b 0a 09 6d 61 6b 65 64 69 72 0a 09 48 45 41   {..makedir..HEA
0720: 44 45 52 53 3d 2f 44 65 76 65 6c 6f 70 65 72 2f  DERS=/Developer/
0730: 53 44 4b 73 2f 4d 61 63 4f 53 58 31 30 2e 35 2e  SDKs/MacOSX10.5.
0740: 73 64 6b 2f 53 79 73 74 65 6d 2f 4c 69 62 72 61  sdk/System/Libra
0750: 72 79 2f 46 72 61 6d 65 77 6f 72 6b 73 2f 50 43  ry/Frameworks/PC
0760: 53 43 2e 66 72 61 6d 65 77 6f 72 6b 2f 56 65 72  SC.framework/Ver
0770: 73 69 6f 6e 73 2f 41 2f 48 65 61 64 65 72 73 2f  sions/A/Headers/
0780: 0a 09 4c 49 42 52 41 52 59 3d 2f 44 65 76 65 6c  ..LIBRARY=/Devel
0790: 6f 70 65 72 2f 53 44 4b 73 2f 4d 61 63 4f 53 58  oper/SDKs/MacOSX
07a0: 31 30 2e 35 2e 73 64 6b 2f 53 79 73 74 65 6d 2f  10.5.sdk/System/
07b0: 4c 69 62 72 61 72 79 2f 46 72 61 6d 65 77 6f 72  Library/Framewor
07c0: 6b 73 2f 50 43 53 43 2e 66 72 61 6d 65 77 6f 72  ks/PCSC.framewor
07d0: 6b 2f 50 43 53 43 0a 09 4c 49 42 3d 22 22 0a 09  k/PCSC..LIB=""..
07e0: 41 52 43 48 4c 49 53 54 3d 22 22 0a 09 44 4c 49  ARCHLIST=""..DLI
07f0: 42 3d 22 22 0a 09 44 41 52 43 48 4c 49 53 54 3d  B=""..DARCHLIST=
0800: 22 22 0a 09 4f 53 58 3d 4c 65 6f 70 61 72 64 0a  ""..OSX=Leopard.
0810: 09 50 4b 54 41 52 47 45 54 4f 53 3d 33 0a 09 43  .PKTARGETOS=3..C
0820: 55 52 4f 53 58 56 45 52 3d 31 30 2e 35 0a 09 66  UROSXVER=10.5..f
0830: 6f 72 20 48 4f 53 54 20 69 6e 20 70 6f 77 65 72  or HOST in power
0840: 70 63 2d 61 70 70 6c 65 2d 64 61 72 77 69 6e 39  pc-apple-darwin9
0850: 20 69 33 38 36 2d 61 70 70 6c 65 2d 64 61 72 77   i386-apple-darw
0860: 69 6e 39 3b 20 64 6f 0a 09 09 67 65 6e 62 75 69  in9; do...genbui
0870: 6c 64 0a 09 64 6f 6e 65 0a 09 6c 69 62 62 75 69  ld..done..libbui
0880: 6c 64 0a 09 70 6b 67 62 75 69 6c 64 0a 7d 0a 0a  ld..pkgbuild.}..
0890: 23 20 42 75 69 6c 64 20 66 75 6e 63 74 69 6f 6e  # Build function
08a0: 20 66 6f 72 20 53 6e 6f 77 20 4c 65 6f 70 61 72   for Snow Leopar
08b0: 64 2f 4c 69 6f 6e 2f 4d 6f 75 6e 74 61 69 6e 20  d/Lion/Mountain 
08c0: 4c 69 6f 6e 2f 4d 61 76 65 72 69 63 6b 73 2f 59  Lion/Mavericks/Y
08d0: 6f 73 65 6d 69 74 65 0a 73 6c 61 6e 64 75 70 28  osemite.slandup(
08e0: 29 20 7b 0a 09 6d 61 6b 65 64 69 72 0a 09 48 45  ) {..makedir..HE
08f0: 41 44 45 52 53 3d 2f 44 65 76 65 6c 6f 70 65 72  ADERS=/Developer
0900: 2f 53 44 4b 73 2f 4d 61 63 4f 53 58 31 30 2e 36  /SDKs/MacOSX10.6
0910: 2e 73 64 6b 2f 53 79 73 74 65 6d 2f 4c 69 62 72  .sdk/System/Libr
0920: 61 72 79 2f 46 72 61 6d 65 77 6f 72 6b 73 2f 50  ary/Frameworks/P
0930: 43 53 43 2e 66 72 61 6d 65 77 6f 72 6b 2f 56 65  CSC.framework/Ve
0940: 72 73 69 6f 6e 73 2f 41 2f 48 65 61 64 65 72 73  rsions/A/Headers
0950: 2f 0a 09 4c 49 42 52 41 52 59 3d 2f 44 65 76 65  /..LIBRARY=/Deve
0960: 6c 6f 70 65 72 2f 53 44 4b 73 2f 4d 61 63 4f 53  loper/SDKs/MacOS
0970: 58 31 30 2e 36 2e 73 64 6b 2f 53 79 73 74 65 6d  X10.6.sdk/System
0980: 2f 4c 69 62 72 61 72 79 2f 46 72 61 6d 65 77 6f  /Library/Framewo
0990: 72 6b 73 2f 50 43 53 43 2e 66 72 61 6d 65 77 6f  rks/PCSC.framewo
09a0: 72 6b 2f 50 43 53 43 0a 09 4c 49 42 3d 22 22 0a  rk/PCSC..LIB="".
09b0: 09 41 52 43 48 4c 49 53 54 3d 22 22 0a 09 44 4c  .ARCHLIST=""..DL
09c0: 49 42 3d 22 22 0a 09 44 41 52 43 48 4c 49 53 54  IB=""..DARCHLIST
09d0: 3d 22 22 0a 09 4f 53 58 3d 53 6c 61 6e 64 75 70  =""..OSX=Slandup
09e0: 0a 09 50 4b 54 41 52 47 45 54 4f 53 3d 33 0a 09  ..PKTARGETOS=3..
09f0: 43 55 52 4f 53 58 56 45 52 3d 31 30 2e 36 0a 09  CUROSXVER=10.6..
0a00: 66 6f 72 20 48 4f 53 54 20 69 6e 20 69 33 38 36  for HOST in i386
0a10: 2d 61 70 70 6c 65 2d 64 61 72 77 69 6e 31 30 20  -apple-darwin10 
0a20: 78 38 36 5f 36 34 2d 61 70 70 6c 65 2d 64 61 72  x86_64-apple-dar
0a30: 77 69 6e 31 30 3b 20 64 6f 0a 09 09 67 65 6e 62  win10; do...genb
0a40: 75 69 6c 64 0a 09 64 6f 6e 65 0a 09 6c 69 62 62  uild..done..libb
0a50: 75 69 6c 64 0a 09 70 6b 67 62 75 69 6c 64 0a 7d  uild..pkgbuild.}
0a60: 0a 0a 23 20 47 65 6e 65 72 69 63 20 62 75 69 6c  ..# Generic buil
0a70: 64 20 66 75 6e 63 74 69 6f 6e 0a 67 65 6e 62 75  d function.genbu
0a80: 69 6c 64 28 29 20 7b 0a 09 6d 61 6b 65 20 64 69  ild() {..make di
0a90: 73 74 63 6c 65 61 6e 0a 09 41 52 43 48 3d 60 65  stclean..ARCH=`e
0aa0: 63 68 6f 20 24 7b 48 4f 53 54 7d 20 7c 20 63 75  cho ${HOST} | cu
0ab0: 74 20 2d 64 20 22 2d 22 20 2d 66 20 31 60 0a 09  t -d "-" -f 1`..
0ac0: 69 66 20 5b 20 24 7b 41 52 43 48 7d 20 3d 3d 20  if [ ${ARCH} == 
0ad0: 22 70 6f 77 65 72 70 63 22 20 5d 3b 20 74 68 65  "powerpc" ]; the
0ae0: 6e 0a 09 09 41 52 43 48 3d 22 70 70 63 20 2d 6d  n...ARCH="ppc -m
0af0: 63 70 75 3d 47 34 22 0a 09 66 69 0a 09 69 66 20  cpu=G4"..fi..if 
0b00: 5b 20 22 24 7b 4c 49 4f 4e 42 55 49 4c 44 7d 22  [ "${LIONBUILD}"
0b10: 20 3d 20 31 20 5d 3b 20 74 68 65 6e 0a 09 09 69   = 1 ]; then...i
0b20: 66 20 5b 20 22 24 7b 41 52 43 48 7d 22 20 3d 3d  f [ "${ARCH}" ==
0b30: 20 22 70 70 63 20 2d 6d 63 70 75 3d 47 34 22 20   "ppc -mcpu=G4" 
0b40: 5d 3b 20 74 68 65 6e 0a 09 09 09 43 43 3d 2f 44  ]; then....CC=/D
0b50: 65 76 65 6c 6f 70 65 72 2f 75 73 72 2f 62 69 6e  eveloper/usr/bin
0b60: 2f 70 6f 77 65 72 70 63 2d 61 70 70 6c 65 2d 64  /powerpc-apple-d
0b70: 61 72 77 69 6e 31 30 2d 67 63 63 2d 34 2e 32 2e  arwin10-gcc-4.2.
0b80: 31 20 43 58 58 3d 2f 44 65 76 65 6c 6f 70 65 72  1 CXX=/Developer
0b90: 2f 75 73 72 2f 62 69 6e 2f 70 6f 77 65 72 70 63  /usr/bin/powerpc
0ba0: 2d 61 70 70 6c 65 2d 64 61 72 77 69 6e 31 30 2d  -apple-darwin10-
0bb0: 67 2b 2b 2d 34 2e 32 2e 31 20 43 46 4c 41 47 53  g++-4.2.1 CFLAGS
0bc0: 3d 22 2d 6d 33 32 20 2d 6d 63 70 75 3d 47 34 20  ="-m32 -mcpu=G4 
0bd0: 2d 49 2f 44 65 76 65 6c 6f 70 65 72 2f 75 73 72  -I/Developer/usr
0be0: 2f 6c 69 62 2f 67 63 63 2f 70 6f 77 65 72 70 63  /lib/gcc/powerpc
0bf0: 2d 61 70 70 6c 65 2d 64 61 72 77 69 6e 31 30 2f  -apple-darwin10/
0c00: 34 2e 32 2e 31 2f 69 6e 63 6c 75 64 65 20 2d 69  4.2.1/include -i
0c10: 73 79 73 72 6f 6f 74 20 2f 44 65 76 65 6c 6f 70  sysroot /Develop
0c20: 65 72 2f 53 44 4b 73 2f 4d 61 63 4f 53 58 31 30  er/SDKs/MacOSX10
0c30: 2e 35 2e 73 64 6b 22 20 43 50 50 46 4c 41 47 53  .5.sdk" CPPFLAGS
0c40: 3d 22 2d 44 5f 4c 49 42 43 5f 4c 49 4d 49 54 53  ="-D_LIBC_LIMITS
0c50: 5f 48 5f 22 20 2e 2f 63 6f 6e 66 69 67 75 72 65  _H_" ./configure
0c60: 20 2d 2d 77 69 74 68 2d 70 63 73 63 2d 68 65 61   --with-pcsc-hea
0c70: 64 65 72 73 3d 24 7b 48 45 41 44 45 52 53 7d 20  ders=${HEADERS} 
0c80: 2d 2d 77 69 74 68 2d 70 63 73 63 2d 6c 69 62 73  --with-pcsc-libs
0c90: 3d 24 7b 4c 49 42 52 41 52 59 7d 20 2d 2d 68 6f  =${LIBRARY} --ho
0ca0: 73 74 3d 24 7b 48 4f 53 54 7d 20 2d 2d 65 6e 61  st=${HOST} --ena
0cb0: 62 6c 65 2d 64 6f 64 2d 63 65 72 74 73 2d 6f 6e  ble-dod-certs-on
0cc0: 2d 68 77 2d 73 6c 6f 74 73 0a 09 09 65 6c 73 65  -hw-slots...else
0cd0: 0a 09 09 09 43 46 4c 41 47 53 3d 22 2d 61 72 63  ....CFLAGS="-arc
0ce0: 68 20 24 7b 41 52 43 48 7d 22 20 2e 2f 63 6f 6e  h ${ARCH}" ./con
0cf0: 66 69 67 75 72 65 20 2d 2d 77 69 74 68 2d 70 63  figure --with-pc
0d00: 73 63 2d 68 65 61 64 65 72 73 3d 24 7b 48 45 41  sc-headers=${HEA
0d10: 44 45 52 53 7d 20 2d 2d 77 69 74 68 2d 70 63 73  DERS} --with-pcs
0d20: 63 2d 6c 69 62 73 3d 24 7b 4c 49 42 52 41 52 59  c-libs=${LIBRARY
0d30: 7d 20 2d 2d 68 6f 73 74 3d 24 7b 48 4f 53 54 7d  } --host=${HOST}
0d40: 20 2d 2d 65 6e 61 62 6c 65 2d 64 6f 64 2d 63 65   --enable-dod-ce
0d50: 72 74 73 2d 6f 6e 2d 68 77 2d 73 6c 6f 74 73 0a  rts-on-hw-slots.
0d60: 09 09 66 69 0a 09 65 6c 73 65 0a 09 09 43 46 4c  ..fi..else...CFL
0d70: 41 47 53 3d 22 2d 61 72 63 68 20 24 7b 41 52 43  AGS="-arch ${ARC
0d80: 48 7d 22 20 2e 2f 63 6f 6e 66 69 67 75 72 65 20  H}" ./configure 
0d90: 2d 2d 77 69 74 68 2d 70 63 73 63 2d 68 65 61 64  --with-pcsc-head
0da0: 65 72 73 3d 24 7b 48 45 41 44 45 52 53 7d 20 2d  ers=${HEADERS} -
0db0: 2d 77 69 74 68 2d 70 63 73 63 2d 6c 69 62 73 3d  -with-pcsc-libs=
0dc0: 24 7b 4c 49 42 52 41 52 59 7d 20 2d 2d 68 6f 73  ${LIBRARY} --hos
0dd0: 74 3d 24 7b 48 4f 53 54 7d 20 2d 2d 65 6e 61 62  t=${HOST} --enab
0de0: 6c 65 2d 64 6f 64 2d 63 65 72 74 73 2d 6f 6e 2d  le-dod-certs-on-
0df0: 68 77 2d 73 6c 6f 74 73 0a 09 66 69 0a 09 6d 61  hw-slots..fi..ma
0e00: 6b 65 0a 09 63 70 20 6c 69 62 63 61 63 6b 65 79  ke..cp libcackey
0e10: 2e 64 79 6c 69 62 20 6d 61 63 62 75 69 6c 64 2f  .dylib macbuild/
0e20: 24 7b 4f 53 58 7d 2f 6c 69 62 63 61 63 6b 65 79  ${OSX}/libcackey
0e30: 2e 64 79 6c 69 62 2e 60 65 63 68 6f 20 24 7b 41  .dylib.`echo ${A
0e40: 52 43 48 7d 20 7c 20 63 75 74 20 2d 64 20 27 20  RCH} | cut -d ' 
0e50: 27 20 2d 66 20 31 60 0a 09 63 70 20 6c 69 62 63  ' -f 1`..cp libc
0e60: 61 63 6b 65 79 5f 67 2e 64 79 6c 69 62 20 6d 61  ackey_g.dylib ma
0e70: 63 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 2f 6c 69  cbuild/${OSX}/li
0e80: 62 63 61 63 6b 65 79 5f 67 2e 64 79 6c 69 62 2e  bcackey_g.dylib.
0e90: 60 65 63 68 6f 20 24 7b 41 52 43 48 7d 20 7c 20  `echo ${ARCH} | 
0ea0: 63 75 74 20 2d 64 20 27 20 27 20 2d 66 20 31 60  cut -d ' ' -f 1`
0eb0: 20 0a 7d 0a 0a 23 20 4c 69 62 72 61 72 79 20 62   .}..# Library b
0ec0: 75 69 6c 64 20 66 75 6e 63 74 69 6f 6e 0a 6c 69  uild function.li
0ed0: 62 62 75 69 6c 64 28 29 20 7b 0a 09 66 6f 72 20  bbuild() {..for 
0ee0: 4c 49 42 20 69 6e 20 6d 61 63 62 75 69 6c 64 2f  LIB in macbuild/
0ef0: 24 7b 4f 53 58 7d 2f 6c 69 62 63 61 63 6b 65 79  ${OSX}/libcackey
0f00: 2e 64 79 6c 69 62 2e 2a 3b 20 64 6f 0a 09 09 41  .dylib.*; do...A
0f10: 52 43 48 4c 49 53 54 3d 22 24 7b 41 52 43 48 4c  RCHLIST="${ARCHL
0f20: 49 53 54 7d 20 60 65 63 68 6f 20 27 2d 61 72 63  IST} `echo '-arc
0f30: 68 20 27 60 20 60 65 63 68 6f 20 24 7b 4c 49 42  h '` `echo ${LIB
0f40: 7d 20 7c 20 63 75 74 20 2d 64 20 2e 20 2d 66 20  } | cut -d . -f 
0f50: 33 60 20 60 65 63 68 6f 20 27 20 27 60 20 60 65  3` `echo ' '` `e
0f60: 63 68 6f 20 24 7b 4c 49 42 7d 60 22 0a 09 64 6f  cho ${LIB}`"..do
0f70: 6e 65 0a 09 6c 69 70 6f 20 2d 63 72 65 61 74 65  ne..lipo -create
0f80: 20 24 7b 41 52 43 48 4c 49 53 54 7d 20 2d 6f 75   ${ARCHLIST} -ou
0f90: 74 70 75 74 20 6d 61 63 62 75 69 6c 64 2f 24 7b  tput macbuild/${
0fa0: 4f 53 58 7d 2f 6c 69 62 63 61 63 6b 65 79 2e 64  OSX}/libcackey.d
0fb0: 79 6c 69 62 0a 09 66 6f 72 20 44 4c 49 42 20 69  ylib..for DLIB i
0fc0: 6e 20 6d 61 63 62 75 69 6c 64 2f 24 7b 4f 53 58  n macbuild/${OSX
0fd0: 7d 2f 6c 69 62 63 61 63 6b 65 79 5f 67 2e 64 79  }/libcackey_g.dy
0fe0: 6c 69 62 2e 2a 3b 20 64 6f 0a 09 09 44 41 52 43  lib.*; do...DARC
0ff0: 48 4c 49 53 54 3d 22 24 7b 44 41 52 43 48 4c 49  HLIST="${DARCHLI
1000: 53 54 7d 20 60 65 63 68 6f 20 27 2d 61 72 63 68  ST} `echo '-arch
1010: 20 27 60 20 60 65 63 68 6f 20 24 7b 44 4c 49 42   '` `echo ${DLIB
1020: 7d 20 7c 20 63 75 74 20 2d 64 20 2e 20 2d 66 20  } | cut -d . -f 
1030: 33 60 20 60 65 63 68 6f 20 27 20 27 60 20 60 65  3` `echo ' '` `e
1040: 63 68 6f 20 24 7b 44 4c 49 42 7d 60 22 0a 09 64  cho ${DLIB}`"..d
1050: 6f 6e 65 0a 09 6c 69 70 6f 20 2d 63 72 65 61 74  one..lipo -creat
1060: 65 20 24 7b 44 41 52 43 48 4c 49 53 54 7d 20 2d  e ${DARCHLIST} -
1070: 6f 75 74 70 75 74 20 6d 61 63 62 75 69 6c 64 2f  output macbuild/
1080: 24 7b 4f 53 58 7d 2f 6c 69 62 63 61 63 6b 65 79  ${OSX}/libcackey
1090: 5f 67 2e 64 79 6c 69 62 0a 09 72 6d 20 6d 61 63  _g.dylib..rm mac
10a0: 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 2f 6c 69 62  build/${OSX}/lib
10b0: 63 61 63 6b 65 79 2a 2e 64 79 6c 69 62 2e 2a 0a  cackey*.dylib.*.
10c0: 7d 0a 0a 23 20 46 75 6e 63 74 69 6f 6e 20 74 6f  }..# Function to
10d0: 20 62 75 69 6c 64 20 4d 61 63 20 4f 53 20 58 20   build Mac OS X 
10e0: 50 61 63 6b 61 67 65 73 0a 70 6b 67 62 75 69 6c  Packages.pkgbuil
10f0: 64 28 29 20 7b 0a 09 69 66 20 5b 20 22 60 75 6e  d() {..if [ "`un
1100: 61 6d 65 20 2d 72 20 7c 20 63 75 74 20 2d 64 20  ame -r | cut -d 
1110: 2e 20 2d 66 20 31 60 22 20 2d 6c 74 20 22 31 30  . -f 1`" -lt "10
1120: 22 20 5d 3b 20 74 68 65 6e 0a 09 09 4c 49 42 43  " ]; then...LIBC
1130: 41 43 4b 45 59 47 3d 6c 69 62 63 61 63 6b 65 79  ACKEYG=libcackey
1140: 67 2e 70 6b 67 0a 09 65 6c 73 65 0a 09 09 4c 49  g.pkg..else...LI
1150: 42 43 41 43 4b 45 59 47 3d 6c 69 62 63 61 63 6b  BCACKEYG=libcack
1160: 65 79 5f 67 2e 70 6b 67 0a 09 66 69 0a 09 72 6d  ey_g.pkg..fi..rm
1170: 20 2d 66 20 62 75 69 6c 64 2f 63 61 63 6b 65 79   -f build/cackey
1180: 5f 6f 73 78 5f 62 75 69 6c 64 2f 63 61 63 6b 65  _osx_build/cacke
1190: 79 2e 64 79 6c 69 62 0a 09 6c 6e 20 6d 61 63 62  y.dylib..ln macb
11a0: 75 69 6c 64 2f 24 7b 4f 53 58 7d 2f 6c 69 62 63  uild/${OSX}/libc
11b0: 61 63 6b 65 79 2e 64 79 6c 69 62 20 62 75 69 6c  ackey.dylib buil
11c0: 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69  d/cackey_osx_bui
11d0: 6c 64 2f 63 61 63 6b 65 79 2e 64 79 6c 69 62 0a  ld/cackey.dylib.
11e0: 09 72 6d 20 2d 72 66 20 62 75 69 6c 64 2f 63 61  .rm -rf build/ca
11f0: 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 50  ckey_osx_build/P
1200: 4b 43 53 31 31 2e 74 6f 6b 65 6e 64 0a 09 69 66  KCS11.tokend..if
1210: 20 5b 20 22 24 7b 4c 49 4f 4e 42 55 49 4c 44 7d   [ "${LIONBUILD}
1220: 22 20 3d 20 31 20 5d 3b 20 74 68 65 6e 0a 09 09  " = 1 ]; then...
1230: 54 41 52 3d 67 6e 75 74 61 72 0a 09 65 6c 73 65  TAR=gnutar..else
1240: 0a 09 09 54 41 52 3d 74 61 72 0a 09 66 69 0a 09  ...TAR=tar..fi..
1250: 54 4f 4b 45 4e 44 53 48 41 32 35 36 3d 22 66 34  TOKENDSHA256="f4
1260: 61 32 37 62 63 65 63 30 32 65 66 66 63 33 39 66  a27bcec02effc39f
1270: 31 62 63 39 61 36 64 63 37 39 34 33 62 38 63 31  1bc9a6dc7943b8c1
1280: 63 33 65 35 37 30 34 33 31 37 38 32 61 38 37 34  c3e570431782a874
1290: 61 31 30 38 32 62 62 31 33 33 32 65 66 33 22 0a  a1082bb1332ef3".
12a0: 09 63 75 72 6c 20 68 74 74 70 3a 2f 2f 64 65 76  .curl http://dev
12b0: 65 6c 2e 6b 76 61 6e 61 6c 73 2e 6f 72 67 2f 50  el.kvanals.org/P
12c0: 4b 43 53 31 31 5f 54 6f 6b 65 6e 64 2f 50 4b 43  KCS11_Tokend/PKC
12d0: 53 31 31 5f 74 6f 6b 65 6e 64 2d 6c 61 74 65 73  S11_tokend-lates
12e0: 74 2e 74 61 72 2e 67 7a 20 3e 20 50 4b 43 53 31  t.tar.gz > PKCS1
12f0: 31 5f 74 6f 6b 65 6e 64 2d 6c 61 74 65 73 74 2e  1_tokend-latest.
1300: 74 61 72 2e 67 7a 0a 09 69 66 20 5b 20 22 24 7b  tar.gz..if [ "${
1310: 54 4f 4b 45 4e 44 53 48 41 32 35 36 7d 22 20 21  TOKENDSHA256}" !
1320: 3d 20 22 60 73 68 61 73 75 6d 20 2d 61 20 32 35  = "`shasum -a 25
1330: 36 20 50 4b 43 53 31 31 5f 74 6f 6b 65 6e 64 2d  6 PKCS11_tokend-
1340: 6c 61 74 65 73 74 2e 74 61 72 2e 67 7a 20 7c 20  latest.tar.gz | 
1350: 61 77 6b 20 27 7b 70 72 69 6e 74 20 24 31 7d 27  awk '{print $1}'
1360: 60 22 20 5d 3b 20 74 68 65 6e 0a 09 09 65 63 68  `" ]; then...ech
1370: 6f 20 22 53 48 41 2d 32 35 36 20 43 68 65 63 6b  o "SHA-256 Check
1380: 73 75 6d 20 64 6f 65 73 20 4e 4f 54 20 6d 61 74  sum does NOT mat
1390: 63 68 20 66 6f 72 20 54 6f 6b 65 6e 44 21 20 20  ch for TokenD!  
13a0: 56 65 72 69 66 79 20 74 68 65 72 65 20 77 61 73  Verify there was
13b0: 20 61 20 6e 65 77 20 75 70 73 74 72 65 61 6d 20   a new upstream 
13c0: 72 65 6c 65 61 73 65 20 61 6e 64 20 75 70 64 61  release and upda
13d0: 74 65 20 74 68 65 20 62 75 69 6c 64 20 73 63 72  te the build scr
13e0: 69 70 74 21 22 0a 09 09 72 6d 20 2d 66 20 50 4b  ipt!"...rm -f PK
13f0: 43 53 31 31 5f 74 6f 6b 65 6e 64 2d 6c 61 74 65  CS11_tokend-late
1400: 73 74 2e 74 61 72 2e 67 7a 0a 09 09 65 78 69 74  st.tar.gz...exit
1410: 20 31 0a 09 66 69 0a 09 69 66 20 5b 20 22 24 7b   1..fi..if [ "${
1420: 4f 53 58 7d 22 20 3d 20 22 4c 65 6f 70 61 72 64  OSX}" = "Leopard
1430: 22 20 5d 3b 20 74 68 65 6e 0a 09 09 63 61 74 20  " ]; then...cat 
1440: 50 4b 43 53 31 31 5f 74 6f 6b 65 6e 64 2d 6c 61  PKCS11_tokend-la
1450: 74 65 73 74 2e 74 61 72 2e 67 7a 20 7c 20 67 7a  test.tar.gz | gz
1460: 69 70 20 2d 64 20 2d 63 20 7c 20 24 7b 54 41 52  ip -d -c | ${TAR
1470: 7d 20 2d 2d 73 74 72 69 70 2d 63 6f 6d 70 6f 6e  } --strip-compon
1480: 65 6e 74 73 20 33 20 2d 2d 77 69 6c 64 63 61 72  ents 3 --wildcar
1490: 64 73 20 2d 78 20 2d 66 20 2d 20 22 50 4b 43 53  ds -x -f - "PKCS
14a0: 31 31 5f 74 6f 6b 65 6e 64 2d 2a 2f 70 72 65 62  11_tokend-*/preb
14b0: 75 69 6c 74 2f 6c 65 6f 70 61 72 64 2f 50 4b 43  uilt/leopard/PKC
14c0: 53 31 31 2e 74 6f 6b 65 6e 64 22 0a 09 09 72 6d  S11.tokend"...rm
14d0: 20 2d 66 20 50 4b 43 53 31 31 5f 74 6f 6b 65 6e   -f PKCS11_token
14e0: 64 2d 6c 61 74 65 73 74 2e 74 61 72 2e 67 7a 0a  d-latest.tar.gz.
14f0: 09 09 6d 76 20 50 4b 43 53 31 31 2e 74 6f 6b 65  ..mv PKCS11.toke
1500: 6e 64 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f  nd build/cackey_
1510: 6f 73 78 5f 62 75 69 6c 64 2f 50 4b 43 53 31 31  osx_build/PKCS11
1520: 2e 74 6f 6b 65 6e 64 0a 09 65 6c 73 65 0a 09 09  .tokend..else...
1530: 63 61 74 20 50 4b 43 53 31 31 5f 74 6f 6b 65 6e  cat PKCS11_token
1540: 64 2d 6c 61 74 65 73 74 2e 74 61 72 2e 67 7a 20  d-latest.tar.gz 
1550: 7c 20 67 7a 69 70 20 2d 64 20 2d 63 20 7c 20 24  | gzip -d -c | $
1560: 7b 54 41 52 7d 20 2d 2d 73 74 72 69 70 2d 63 6f  {TAR} --strip-co
1570: 6d 70 6f 6e 65 6e 74 73 20 33 20 2d 2d 77 69 6c  mponents 3 --wil
1580: 64 63 61 72 64 73 20 2d 78 20 2d 66 20 2d 20 22  dcards -x -f - "
1590: 50 4b 43 53 31 31 5f 74 6f 6b 65 6e 64 2d 2a 2f  PKCS11_tokend-*/
15a0: 70 72 65 62 75 69 6c 74 2f 73 6e 6f 77 6c 65 6f  prebuilt/snowleo
15b0: 70 61 72 64 2f 50 4b 43 53 31 31 2e 74 6f 6b 65  pard/PKCS11.toke
15c0: 6e 64 22 0a 09 09 72 6d 20 2d 66 20 50 4b 43 53  nd"...rm -f PKCS
15d0: 31 31 5f 74 6f 6b 65 6e 64 2d 6c 61 74 65 73 74  11_tokend-latest
15e0: 2e 74 61 72 2e 67 7a 0a 09 09 6d 76 20 50 4b 43  .tar.gz...mv PKC
15f0: 53 31 31 2e 74 6f 6b 65 6e 64 20 62 75 69 6c 64  S11.tokend build
1600: 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c  /cackey_osx_buil
1610: 64 2f 50 4b 43 53 31 31 2e 74 6f 6b 65 6e 64 0a  d/PKCS11.tokend.
1620: 09 66 69 0a 09 66 6f 72 20 50 4d 44 4f 43 20 69  .fi..for PMDOC i
1630: 6e 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f  n build/cackey_o
1640: 73 78 5f 62 75 69 6c 64 2f 54 65 6d 70 6c 61 74  sx_build/Templat
1650: 65 5f 70 6d 62 75 69 6c 64 2f 2a 2e 69 6e 3b 20  e_pmbuild/*.in; 
1660: 64 6f 0a 09 09 50 4d 44 4f 43 3d 22 60 65 63 68  do...PMDOC="`ech
1670: 6f 20 22 24 7b 50 4d 44 4f 43 7d 22 20 7c 20 73  o "${PMDOC}" | s
1680: 65 64 20 27 73 7c 6c 2e 69 6e 7c 6c 7c 67 27 20  ed 's|l.in|l|g' 
1690: 7c 20 73 65 64 20 27 73 7c 62 75 69 6c 64 2f 63  | sed 's|build/c
16a0: 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f  ackey_osx_build/
16b0: 54 65 6d 70 6c 61 74 65 5f 70 6d 62 75 69 6c 64  Template_pmbuild
16c0: 2f 7c 7c 67 27 60 22 0a 09 09 55 55 49 44 3d 22  /||g'`"...UUID="
16d0: 60 70 79 74 68 6f 6e 20 2d 63 20 27 69 6d 70 6f  `python -c 'impo
16e0: 72 74 20 75 75 69 64 3b 20 70 72 69 6e 74 20 75  rt uuid; print u
16f0: 75 69 64 2e 75 75 69 64 31 28 29 27 20 7c 20 64  uid.uuid1()' | d
1700: 64 20 63 6f 6e 76 3d 75 63 61 73 65 20 32 3e 2f  d conv=ucase 2>/
1710: 64 65 76 2f 6e 75 6c 6c 60 22 0a 09 09 6d 6b 64  dev/null`"...mkd
1720: 69 72 20 2d 70 20 62 75 69 6c 64 2f 63 61 63 6b  ir -p build/cack
1730: 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f  ey_osx_build/${O
1740: 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f  SX}_pmbuild.pmdo
1750: 63 0a 09 09 73 65 64 20 22 73 7c 40 40 42 55 49  c...sed "s|@@BUI
1760: 4c 44 52 4f 4f 54 44 49 52 40 40 7c 24 28 70 77  LDROOTDIR@@|$(pw
1770: 64 29 7c 67 22 20 62 75 69 6c 64 2f 63 61 63 6b  d)|g" build/cack
1780: 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 54 65 6d  ey_osx_build/Tem
1790: 70 6c 61 74 65 5f 70 6d 62 75 69 6c 64 2f 24 7b  plate_pmbuild/${
17a0: 50 4d 44 4f 43 7d 2e 69 6e 20 3e 20 62 75 69 6c  PMDOC}.in > buil
17b0: 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69  d/cackey_osx_bui
17c0: 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c  ld/${OSX}_pmbuil
17d0: 64 2e 70 6d 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d  d.pmdoc/${PMDOC}
17e0: 0a 09 09 73 65 64 20 22 73 7c 40 40 4f 53 58 56  ...sed "s|@@OSXV
17f0: 45 52 53 49 4f 4e 40 40 7c 24 7b 4f 53 58 7d 7c  ERSION@@|${OSX}|
1800: 67 22 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f  g" build/cackey_
1810: 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58 7d  osx_build/${OSX}
1820: 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f 24  _pmbuild.pmdoc/$
1830: 7b 50 4d 44 4f 43 7d 20 3e 20 62 75 69 6c 64 2f  {PMDOC} > build/
1840: 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64  cackey_osx_build
1850: 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e  /${OSX}_pmbuild.
1860: 70 6d 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d 2e 31  pmdoc/${PMDOC}.1
1870: 0a 09 09 73 65 64 20 22 73 7c 40 40 55 55 49 44  ...sed "s|@@UUID
1880: 40 40 7c 24 7b 55 55 49 44 7d 7c 67 22 20 62 75  @@|${UUID}|g" bu
1890: 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62  ild/cackey_osx_b
18a0: 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75  uild/${OSX}_pmbu
18b0: 69 6c 64 2e 70 6d 64 6f 63 2f 24 7b 50 4d 44 4f  ild.pmdoc/${PMDO
18c0: 43 7d 2e 31 20 3e 20 62 75 69 6c 64 2f 63 61 63  C}.1 > build/cac
18d0: 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b  key_osx_build/${
18e0: 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64  OSX}_pmbuild.pmd
18f0: 6f 63 2f 24 7b 50 4d 44 4f 43 7d 0a 09 09 73 65  oc/${PMDOC}...se
1900: 64 20 22 73 7c 40 40 54 41 52 47 45 54 4f 53 40  d "s|@@TARGETOS@
1910: 40 7c 24 7b 50 4b 54 41 52 47 45 54 4f 53 7d 7c  @|${PKTARGETOS}|
1920: 67 22 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f  g" build/cackey_
1930: 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58 7d  osx_build/${OSX}
1940: 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f 24  _pmbuild.pmdoc/$
1950: 7b 50 4d 44 4f 43 7d 20 3e 20 62 75 69 6c 64 2f  {PMDOC} > build/
1960: 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64  cackey_osx_build
1970: 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e  /${OSX}_pmbuild.
1980: 70 6d 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d 2e 31  pmdoc/${PMDOC}.1
1990: 0a 09 09 73 65 64 20 22 73 7c 40 40 43 55 52 4f  ...sed "s|@@CURO
19a0: 53 58 56 45 52 40 40 7c 24 7b 43 55 52 4f 53 58  SXVER@@|${CUROSX
19b0: 56 45 52 7d 7c 67 22 20 62 75 69 6c 64 2f 63 61  VER}|g" build/ca
19c0: 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24  ckey_osx_build/$
19d0: 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d  {OSX}_pmbuild.pm
19e0: 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d 20 3e 20 62  doc/${PMDOC} > b
19f0: 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f  uild/cackey_osx_
1a00: 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62  build/${OSX}_pmb
1a10: 75 69 6c 64 2e 70 6d 64 6f 63 2f 24 7b 50 4d 44  uild.pmdoc/${PMD
1a20: 4f 43 7d 2e 31 0a 09 09 73 65 64 20 22 73 7c 40  OC}.1...sed "s|@
1a30: 40 4c 49 42 43 41 43 4b 45 59 47 40 40 7c 24 7b  @LIBCACKEYG@@|${
1a40: 4c 49 42 43 41 43 4b 45 59 47 7d 7c 67 22 20 62  LIBCACKEYG}|g" b
1a50: 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f  uild/cackey_osx_
1a60: 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62  build/${OSX}_pmb
1a70: 75 69 6c 64 2e 70 6d 64 6f 63 2f 24 7b 50 4d 44  uild.pmdoc/${PMD
1a80: 4f 43 7d 2e 31 20 3e 20 62 75 69 6c 64 2f 63 61  OC}.1 > build/ca
1a90: 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24  ckey_osx_build/$
1aa0: 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d  {OSX}_pmbuild.pm
1ab0: 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d 0a 09 09 63  doc/${PMDOC}...c
1ac0: 70 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f  p build/cackey_o
1ad0: 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f  sx_build/${OSX}_
1ae0: 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f 24 7b  pmbuild.pmdoc/${
1af0: 50 4d 44 4f 43 7d 20 62 75 69 6c 64 2f 63 61 63  PMDOC} build/cac
1b00: 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b  key_osx_build/${
1b10: 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64  OSX}_pmbuild.pmd
1b20: 6f 63 2f 24 7b 50 4d 44 4f 43 7d 2e 31 0a 09 09  oc/${PMDOC}.1...
1b30: 6d 76 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f  mv build/cackey_
1b40: 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58 7d  osx_build/${OSX}
1b50: 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f 24  _pmbuild.pmdoc/$
1b60: 7b 50 4d 44 4f 43 7d 2e 31 20 62 75 69 6c 64 2f  {PMDOC}.1 build/
1b70: 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64  cackey_osx_build
1b80: 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e  /${OSX}_pmbuild.
1b90: 70 6d 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d 0a 09  pmdoc/${PMDOC}..
1ba0: 64 6f 6e 65 0a 09 45 58 54 3d 70 6b 67 0a 09 69  done..EXT=pkg..i
1bb0: 66 20 5b 20 24 7b 4f 53 58 7d 20 3d 3d 20 22 53  f [ ${OSX} == "S
1bc0: 6c 61 6e 64 75 70 22 20 5d 3b 20 74 68 65 6e 0a  landup" ]; then.
1bd0: 09 09 63 61 74 20 62 75 69 6c 64 2f 63 61 63 6b  ..cat build/cack
1be0: 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f  ey_osx_build/${O
1bf0: 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f  SX}_pmbuild.pmdo
1c00: 63 2f 69 6e 64 65 78 2e 78 6d 6c 20 7c 20 73 65  c/index.xml | se
1c10: 64 20 27 73 7c 66 6f 72 20 4d 61 63 20 4f 53 20  d 's|for Mac OS 
1c20: 58 20 53 6c 61 6e 64 75 70 7c 66 6f 72 20 4d 61  X Slandup|for Ma
1c30: 63 20 4f 53 20 58 20 53 4c 61 6e 64 55 70 7c 67  c OS X SLandUp|g
1c40: 27 20 3e 20 62 75 69 6c 64 2f 63 61 63 6b 65 79  ' > build/cackey
1c50: 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58  _osx_build/${OSX
1c60: 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f  }_pmbuild.pmdoc/
1c70: 69 6e 64 65 78 2e 78 6d 6c 2e 6e 65 77 0a 09 09  index.xml.new...
1c80: 6d 76 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f  mv build/cackey_
1c90: 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58 7d  osx_build/${OSX}
1ca0: 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f 69  _pmbuild.pmdoc/i
1cb0: 6e 64 65 78 2e 78 6d 6c 2e 6e 65 77 20 62 75 69  ndex.xml.new bui
1cc0: 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75  ld/cackey_osx_bu
1cd0: 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69  ild/${OSX}_pmbui
1ce0: 6c 64 2e 70 6d 64 6f 63 2f 69 6e 64 65 78 2e 78  ld.pmdoc/index.x
1cf0: 6d 6c 0a 09 66 69 0a 09 2f 44 65 76 65 6c 6f 70  ml..fi../Develop
1d00: 65 72 2f 41 70 70 6c 69 63 61 74 69 6f 6e 73 2f  er/Applications/
1d10: 55 74 69 6c 69 74 69 65 73 2f 50 61 63 6b 61 67  Utilities/Packag
1d20: 65 4d 61 6b 65 72 2e 61 70 70 2f 43 6f 6e 74 65  eMaker.app/Conte
1d30: 6e 74 73 2f 4d 61 63 4f 53 2f 50 61 63 6b 61 67  nts/MacOS/Packag
1d40: 65 4d 61 6b 65 72 20 2d 64 20 62 75 69 6c 64 2f  eMaker -d build/
1d50: 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64  cackey_osx_build
1d60: 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e  /${OSX}_pmbuild.
1d70: 70 6d 64 6f 63 20 2d 6f 20 6d 61 63 62 75 69 6c  pmdoc -o macbuil
1d80: 64 2f 70 6b 67 2f 43 41 43 4b 65 79 5f 24 7b 43  d/pkg/CACKey_${C
1d90: 41 43 4b 45 59 5f 56 45 52 53 49 4f 4e 7d 5f 24  ACKEY_VERSION}_$
1da0: 7b 4f 53 58 7d 2e 24 7b 45 58 54 7d 0a 09 74 61  {OSX}.${EXT}..ta
1db0: 72 20 2d 2d 63 72 65 61 74 65 20 2d 2d 64 69 72  r --create --dir
1dc0: 65 63 74 6f 72 79 20 6d 61 63 62 75 69 6c 64 2f  ectory macbuild/
1dd0: 70 6b 67 2f 20 2d 2d 66 69 6c 65 20 6d 61 63 62  pkg/ --file macb
1de0: 75 69 6c 64 2f 70 6b 67 2f 43 41 43 4b 65 79 5f  uild/pkg/CACKey_
1df0: 24 7b 43 41 43 4b 45 59 5f 56 45 52 53 49 4f 4e  ${CACKEY_VERSION
1e00: 7d 5f 24 7b 4f 53 58 7d 2e 24 7b 45 58 54 7d 2e  }_${OSX}.${EXT}.
1e10: 74 61 72 20 43 41 43 4b 65 79 5f 24 7b 43 41 43  tar CACKey_${CAC
1e20: 4b 45 59 5f 56 45 52 53 49 4f 4e 7d 5f 24 7b 4f  KEY_VERSION}_${O
1e30: 53 58 7d 2e 24 7b 45 58 54 7d 0a 09 67 7a 69 70  SX}.${EXT}..gzip
1e40: 20 2d 39 20 6d 61 63 62 75 69 6c 64 2f 70 6b 67   -9 macbuild/pkg
1e50: 2f 43 41 43 4b 65 79 5f 24 7b 43 41 43 4b 45 59  /CACKey_${CACKEY
1e60: 5f 56 45 52 53 49 4f 4e 7d 5f 24 7b 4f 53 58 7d  _VERSION}_${OSX}
1e70: 2e 24 7b 45 58 54 7d 2e 74 61 72 0a 09 72 6d 20  .${EXT}.tar..rm 
1e80: 2d 72 66 20 6d 61 63 62 75 69 6c 64 2f 70 6b 67  -rf macbuild/pkg
1e90: 2f 43 41 43 4b 65 79 5f 24 7b 43 41 43 4b 45 59  /CACKey_${CACKEY
1ea0: 5f 56 45 52 53 49 4f 4e 7d 5f 24 7b 4f 53 58 7d  _VERSION}_${OSX}
1eb0: 2e 24 7b 45 58 54 7d 0a 09 72 6d 20 2d 66 20 62  .${EXT}..rm -f b
1ec0: 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f  uild/cackey_osx_
1ed0: 62 75 69 6c 64 2f 63 61 63 6b 65 79 2e 64 79 6c  build/cackey.dyl
1ee0: 69 62 0a 09 72 6d 20 2d 72 66 20 62 75 69 6c 64  ib..rm -rf build
1ef0: 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c  /cackey_osx_buil
1f00: 64 2f 50 4b 43 53 31 31 2e 74 6f 6b 65 6e 64 0a  d/PKCS11.tokend.
1f10: 09 65 63 68 6f 20 22 24 7b 4f 53 58 7d 20 62 75  .echo "${OSX} bu
1f20: 69 6c 64 20 63 6f 6d 70 6c 65 74 65 22 0a 7d 0a  ild complete".}.
1f30: 0a 23 20 54 61 6b 65 20 63 6f 6d 6d 61 6e 64 20  .# Take command 
1f40: 6c 69 6e 65 20 61 72 67 75 6d 65 6e 74 73 20 61  line arguments a
1f50: 6e 64 20 65 78 65 63 75 74 65 0a 63 61 73 65 20  nd execute.case 
1f60: 22 24 31 22 20 69 6e 0a 09 22 22 29 0a 09 09 75  "$1" in.."")...u
1f70: 73 61 67 65 0a 09 09 65 78 69 74 20 24 3f 0a 09  sage...exit $?..
1f80: 3b 3b 0a 0a 09 22 6c 65 6f 70 61 72 64 22 29 0a  ;;..."leopard").
1f90: 09 09 2e 2f 61 75 74 6f 67 65 6e 2e 73 68 0a 09  .../autogen.sh..
1fa0: 09 6c 65 6f 70 61 72 64 0a 09 09 65 78 69 74 20  .leopard...exit 
1fb0: 24 3f 0a 09 3b 3b 0a 0a 09 22 73 6c 61 6e 64 75  $?..;;..."slandu
1fc0: 70 22 29 0a 09 09 2e 2f 61 75 74 6f 67 65 6e 2e  p")..../autogen.
1fd0: 73 68 0a 09 09 73 6c 61 6e 64 75 70 0a 09 09 65  sh...slandup...e
1fe0: 78 69 74 20 24 3f 0a 09 3b 3b 0a 0a 09 22 61 6c  xit $?..;;..."al
1ff0: 6c 22 29 0a 09 09 2e 2f 61 75 74 6f 67 65 6e 2e  l")..../autogen.
2000: 73 68 0a 09 09 6c 65 6f 70 61 72 64 0a 09 09 73  sh...leopard...s
2010: 6c 61 6e 64 75 70 0a 09 09 65 63 68 6f 20 22 22  landup...echo ""
2020: 0a 09 09 65 63 68 6f 20 22 41 6c 6c 20 62 75 69  ...echo "All bui
2030: 6c 64 73 20 63 6f 6d 70 6c 65 74 65 2e 22 0a 09  lds complete."..
2040: 09 65 78 69 74 20 24 3f 0a 09 3b 3b 0a 0a 09 22  .exit $?..;;..."
2050: 63 6c 65 61 6e 22 29 0a 09 09 63 6c 65 61 6e 0a  clean")...clean.
2060: 09 09 65 78 69 74 20 24 3f 0a 09 3b 3b 0a 0a 09  ..exit $?..;;...
2070: 2a 29 0a 09 09 75 73 61 67 65 0a 09 09 65 78 69  *)...usage...exi
2080: 74 20 24 3f 0a 09 3b 3b 0a 65 73 61 63 20 0a     t $?..;;.esac .