Hex Artifact Content

Artifact c66d1aadeb2923a03cce94975692dcd3e4340ee7:


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 44 43 31 53 41 4e 5f 53 55  tyne.# DC1SAN_SU
0060: 50 50 4f 52 54 40 68 71 2e 64 68 73 2e 67 6f 76  PPORT@hq.dhs.gov
0070: 0a 43 41 43 4b 45 59 5f 56 45 52 53 49 4f 4e 3d  .CACKEY_VERSION=
0080: 60 63 61 74 20 63 6f 6e 66 69 67 75 72 65 2e 61  `cat configure.a
0090: 63 20 7c 20 67 72 65 70 20 41 43 5f 49 4e 49 54  c | grep AC_INIT
00a0: 20 7c 20 63 75 74 20 2d 64 20 22 20 22 20 2d 66   | cut -d " " -f
00b0: 20 32 20 7c 20 73 65 64 20 27 73 5f 29 5f 5f 27   2 | sed 's_)__'
00c0: 60 0a 0a 23 20 43 68 65 63 6b 20 74 6f 20 73 65  `..# Check to se
00d0: 65 20 69 66 20 77 65 27 72 65 20 62 75 69 6c 64  e if we're build
00e0: 69 6e 67 20 6f 6e 20 4d 61 63 20 4f 53 20 58 20  ing on Mac OS X 
00f0: 31 30 2e 37 20 22 4c 69 6f 6e 22 0a 69 66 20 5b  10.7 "Lion".if [
0100: 20 22 60 75 6e 61 6d 65 20 2d 72 20 7c 20 63 75   "`uname -r | cu
0110: 74 20 2d 64 20 2e 20 2d 66 20 31 60 22 20 3d 20  t -d . -f 1`" = 
0120: 22 31 31 22 20 5d 3b 20 74 68 65 6e 0a 09 4c 49  "11" ]; then..LI
0130: 4f 4e 42 55 49 4c 44 3d 31 0a 66 69 0a 0a 23 20  ONBUILD=1.fi..# 
0140: 55 73 61 67 65 20 66 75 6e 63 74 69 6f 6e 0a 75  Usage function.u
0150: 73 61 67 65 28 29 20 7b 0a 09 65 63 68 6f 20 22  sage() {..echo "
0160: 55 73 61 67 65 3a 20 62 75 69 6c 64 5f 6f 73 78  Usage: build_osx
0170: 2e 73 68 20 3c 74 61 72 67 65 74 3e 22 0a 09 65  .sh <target>"..e
0180: 63 68 6f 20 57 68 65 72 65 20 74 61 72 67 65 74  cho Where target
0190: 20 69 73 20 6f 6e 65 20 6f 66 3a 0a 09 65 63 68   is one of:..ech
01a0: 6f 20 22 20 20 20 20 6c 65 6f 70 61 72 64 20 20  o "    leopard  
01b0: 2d 20 28 42 75 69 6c 64 73 20 55 6e 69 76 65 72  - (Builds Univer
01c0: 73 61 6c 20 31 30 2e 35 20 4c 69 62 72 61 72 79  sal 10.5 Library
01d0: 20 66 6f 72 20 50 50 43 47 34 2f 69 33 38 36 29   for PPCG4/i386)
01e0: 22 0a 09 65 63 68 6f 20 22 20 20 20 20 73 6e 6f  "..echo "    sno
01f0: 77 6c 65 6f 70 61 72 64 20 20 2d 20 28 42 75 69  wleopard  - (Bui
0200: 6c 64 73 20 55 6e 69 76 65 72 73 61 6c 20 31 30  lds Universal 10
0210: 2e 36 20 4c 69 62 72 61 72 79 20 66 6f 72 20 69  .6 Library for i
0220: 33 38 36 2f 78 38 36 5f 36 34 29 22 0a 09 65 63  386/x86_64)"..ec
0230: 68 6f 20 22 20 20 20 20 6c 69 6f 6e 20 20 2d 20  ho "    lion  - 
0240: 28 42 75 69 6c 64 73 20 55 6e 69 76 65 72 73 61  (Builds Universa
0250: 6c 20 31 30 2e 37 20 4c 69 62 72 61 72 79 20 66  l 10.7 Library f
0260: 6f 72 20 69 33 38 36 2f 78 38 36 5f 36 34 29 22  or i386/x86_64)"
0270: 0a 09 65 63 68 6f 20 22 20 20 20 20 73 6c 74 6f  ..echo "    slto
0280: 6d 6c 20 2d 20 28 42 75 69 6c 64 73 20 55 6e 69  ml - (Builds Uni
0290: 76 65 72 73 61 6c 20 31 30 2e 36 2f 31 30 2e 37  versal 10.6/10.7
02a0: 2f 31 30 2e 38 20 4c 69 62 72 61 72 79 20 66 6f  /10.8 Library fo
02b0: 72 20 69 33 38 36 2f 78 38 36 5f 36 34 29 22 0a  r i386/x86_64)".
02c0: 09 65 63 68 6f 20 22 20 20 20 20 61 6c 6c 20 2d  .echo "    all -
02d0: 20 28 42 75 69 6c 64 73 20 66 6f 72 20 61 6c 6c   (Builds for all
02e0: 20 73 75 70 70 6f 72 74 65 64 20 74 61 72 67 65   supported targe
02f0: 74 73 29 22 0a 09 65 63 68 6f 20 22 20 20 20 20  ts)"..echo "    
0300: 63 6c 65 61 6e 20 2d 20 28 43 6c 65 61 6e 73 20  clean - (Cleans 
0310: 75 70 29 22 0a 09 65 63 68 6f 20 22 52 75 6e 20  up)"..echo "Run 
0320: 66 72 6f 6d 20 43 41 43 4b 65 79 20 42 75 69 6c  from CACKey Buil
0330: 64 20 52 6f 6f 74 2e 22 0a 09 65 78 69 74 20 24  d Root."..exit $
0340: 3f 0a 7d 0a 0a 23 20 43 6c 65 61 6e 20 75 70 20  ?.}..# Clean up 
0350: 66 75 6e 63 74 69 6f 6e 0a 63 6c 65 61 6e 28 29  function.clean()
0360: 20 7b 0a 09 72 6d 20 2d 66 20 62 75 69 6c 64 2f   {..rm -f build/
0370: 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64  cackey_osx_build
0380: 2f 63 61 63 6b 65 79 2e 64 79 6c 69 62 0a 09 72  /cackey.dylib..r
0390: 6d 20 2d 72 66 20 62 75 69 6c 64 2f 63 61 63 6b  m -rf build/cack
03a0: 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 50 4b 43  ey_osx_build/PKC
03b0: 53 31 31 2e 74 6f 6b 65 6e 64 0a 09 72 6d 20 2d  S11.tokend..rm -
03c0: 72 66 20 50 4b 43 53 31 31 2e 74 6f 6b 65 6e 64  rf PKCS11.tokend
03d0: 0a 09 72 6d 20 2d 72 66 20 6d 61 63 62 75 69 6c  ..rm -rf macbuil
03e0: 64 0a 09 72 6d 20 2d 72 66 20 62 75 69 6c 64 2f  d..rm -rf build/
03f0: 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64  cackey_osx_build
0400: 2f 2a 2e 70 6d 64 6f 63 0a 09 6d 61 6b 65 20 64  /*.pmdoc..make d
0410: 69 73 74 63 6c 65 61 6e 0a 7d 0a 0a 23 20 44 69  istclean.}..# Di
0420: 72 65 63 74 6f 72 79 20 63 72 65 61 74 69 6f 6e  rectory creation
0430: 20 66 75 6e 63 74 69 6f 6e 0a 6d 61 6b 65 64 69   function.makedi
0440: 72 28 29 20 7b 0a 09 69 66 20 5b 20 22 60 75 6e  r() {..if [ "`un
0450: 61 6d 65 20 2d 72 20 7c 20 63 75 74 20 2d 64 20  ame -r | cut -d 
0460: 2e 20 2d 66 20 31 60 22 20 2d 6c 74 20 22 31 30  . -f 1`" -lt "10
0470: 22 20 5d 3b 20 74 68 65 6e 0a 09 09 4c 49 42 54  " ]; then...LIBT
0480: 4f 4f 4c 44 49 52 3d 2f 44 65 76 65 6c 6f 70 65  OOLDIR=/Develope
0490: 72 2f 75 73 72 2f 73 68 61 72 65 2f 6c 69 62 74  r/usr/share/libt
04a0: 6f 6f 6c 0a 09 65 6c 73 65 0a 09 09 4c 49 42 54  ool..else...LIBT
04b0: 4f 4f 4c 44 49 52 3d 2f 44 65 76 65 6c 6f 70 65  OOLDIR=/Develope
04c0: 72 2f 75 73 72 2f 73 68 61 72 65 2f 6c 69 62 74  r/usr/share/libt
04d0: 6f 6f 6c 2f 63 6f 6e 66 69 67 0a 09 66 69 0a 09  ool/config..fi..
04e0: 69 66 20 5b 20 21 20 2d 64 20 6d 61 63 62 75 69  if [ ! -d macbui
04f0: 6c 64 20 5d 3b 20 74 68 65 6e 0a 09 09 6d 6b 64  ld ]; then...mkd
0500: 69 72 20 6d 61 63 62 75 69 6c 64 0a 09 09 6d 6b  ir macbuild...mk
0510: 64 69 72 20 6d 61 63 62 75 69 6c 64 2f 4c 65 6f  dir macbuild/Leo
0520: 70 61 72 64 0a 09 09 6d 6b 64 69 72 20 6d 61 63  pard...mkdir mac
0530: 62 75 69 6c 64 2f 53 6e 6f 77 6c 65 6f 70 61 72  build/Snowleopar
0540: 64 0a 09 09 6d 6b 64 69 72 20 6d 61 63 62 75 69  d...mkdir macbui
0550: 6c 64 2f 4c 69 6f 6e 0a 09 09 6d 6b 64 69 72 20  ld/Lion...mkdir 
0560: 6d 61 63 62 75 69 6c 64 2f 53 6c 74 6f 6d 6c 0a  macbuild/Sltoml.
0570: 09 09 6d 6b 64 69 72 20 6d 61 63 62 75 69 6c 64  ..mkdir macbuild
0580: 2f 70 6b 67 0a 09 66 69 0a 09 69 66 20 5b 20 21  /pkg..fi..if [ !
0590: 20 2d 66 20 63 6f 6e 66 69 67 2e 67 75 65 73 73   -f config.guess
05a0: 20 5d 3b 20 74 68 65 6e 0a 09 09 63 70 20 24 7b   ]; then...cp ${
05b0: 4c 49 42 54 4f 4f 4c 44 49 52 7d 2f 63 6f 6e 66  LIBTOOLDIR}/conf
05c0: 69 67 2e 67 75 65 73 73 20 2e 0a 09 66 69 0a 09  ig.guess ...fi..
05d0: 69 66 20 5b 20 21 20 2d 66 20 63 6f 6e 66 69 67  if [ ! -f config
05e0: 2e 73 75 62 20 5d 3b 20 74 68 65 6e 0a 09 09 63  .sub ]; then...c
05f0: 70 20 24 7b 4c 49 42 54 4f 4f 4c 44 49 52 7d 2f  p ${LIBTOOLDIR}/
0600: 63 6f 6e 66 69 67 2e 73 75 62 20 2e 0a 09 66 69  config.sub ...fi
0610: 0a 09 69 66 20 5b 20 21 20 2d 66 20 69 6e 73 74  ..if [ ! -f inst
0620: 61 6c 6c 2d 73 68 20 5d 3b 20 74 68 65 6e 0a 09  all-sh ]; then..
0630: 09 63 70 20 24 7b 4c 49 42 54 4f 4f 4c 44 49 52  .cp ${LIBTOOLDIR
0640: 7d 2f 69 6e 73 74 61 6c 6c 2d 73 68 20 2e 0a 09  }/install-sh ...
0650: 66 69 0a 7d 0a 0a 23 20 42 75 69 6c 64 20 66 75  fi.}..# Build fu
0660: 6e 63 74 69 6f 6e 20 66 6f 72 20 4c 65 6f 70 61  nction for Leopa
0670: 72 64 0a 6c 65 6f 70 61 72 64 28 29 20 7b 0a 09  rd.leopard() {..
0680: 6d 61 6b 65 64 69 72 0a 09 48 45 41 44 45 52 53  makedir..HEADERS
0690: 3d 2f 44 65 76 65 6c 6f 70 65 72 2f 53 44 4b 73  =/Developer/SDKs
06a0: 2f 4d 61 63 4f 53 58 31 30 2e 35 2e 73 64 6b 2f  /MacOSX10.5.sdk/
06b0: 53 79 73 74 65 6d 2f 4c 69 62 72 61 72 79 2f 46  System/Library/F
06c0: 72 61 6d 65 77 6f 72 6b 73 2f 50 43 53 43 2e 66  rameworks/PCSC.f
06d0: 72 61 6d 65 77 6f 72 6b 2f 56 65 72 73 69 6f 6e  ramework/Version
06e0: 73 2f 41 2f 48 65 61 64 65 72 73 2f 0a 09 4c 49  s/A/Headers/..LI
06f0: 42 52 41 52 59 3d 2f 44 65 76 65 6c 6f 70 65 72  BRARY=/Developer
0700: 2f 53 44 4b 73 2f 4d 61 63 4f 53 58 31 30 2e 35  /SDKs/MacOSX10.5
0710: 2e 73 64 6b 2f 53 79 73 74 65 6d 2f 4c 69 62 72  .sdk/System/Libr
0720: 61 72 79 2f 46 72 61 6d 65 77 6f 72 6b 73 2f 50  ary/Frameworks/P
0730: 43 53 43 2e 66 72 61 6d 65 77 6f 72 6b 2f 50 43  CSC.framework/PC
0740: 53 43 0a 09 4c 49 42 3d 22 22 0a 09 41 52 43 48  SC..LIB=""..ARCH
0750: 4c 49 53 54 3d 22 22 0a 09 44 4c 49 42 3d 22 22  LIST=""..DLIB=""
0760: 0a 09 44 41 52 43 48 4c 49 53 54 3d 22 22 0a 09  ..DARCHLIST=""..
0770: 4f 53 58 3d 4c 65 6f 70 61 72 64 0a 09 50 4b 54  OSX=Leopard..PKT
0780: 41 52 47 45 54 4f 53 3d 33 0a 09 4e 45 58 54 4f  ARGETOS=3..NEXTO
0790: 53 58 56 45 52 3d 31 30 2e 36 0a 09 43 55 52 4f  SXVER=10.6..CURO
07a0: 53 58 56 45 52 3d 31 30 2e 35 0a 09 66 6f 72 20  SXVER=10.5..for 
07b0: 48 4f 53 54 20 69 6e 20 70 6f 77 65 72 70 63 2d  HOST in powerpc-
07c0: 61 70 70 6c 65 2d 64 61 72 77 69 6e 39 20 69 33  apple-darwin9 i3
07d0: 38 36 2d 61 70 70 6c 65 2d 64 61 72 77 69 6e 39  86-apple-darwin9
07e0: 3b 20 64 6f 0a 09 09 67 65 6e 62 75 69 6c 64 0a  ; do...genbuild.
07f0: 09 64 6f 6e 65 0a 09 6c 69 62 62 75 69 6c 64 0a  .done..libbuild.
0800: 09 70 6b 67 62 75 69 6c 64 0a 7d 0a 0a 23 20 42  .pkgbuild.}..# B
0810: 75 69 6c 64 20 66 75 6e 63 74 69 6f 6e 20 66 6f  uild function fo
0820: 72 20 53 6e 6f 77 20 4c 65 6f 70 61 72 64 0a 73  r Snow Leopard.s
0830: 6e 6f 77 6c 65 6f 70 61 72 64 28 29 20 7b 0a 09  nowleopard() {..
0840: 6d 61 6b 65 64 69 72 0a 09 48 45 41 44 45 52 53  makedir..HEADERS
0850: 3d 2f 44 65 76 65 6c 6f 70 65 72 2f 53 44 4b 73  =/Developer/SDKs
0860: 2f 4d 61 63 4f 53 58 31 30 2e 36 2e 73 64 6b 2f  /MacOSX10.6.sdk/
0870: 53 79 73 74 65 6d 2f 4c 69 62 72 61 72 79 2f 46  System/Library/F
0880: 72 61 6d 65 77 6f 72 6b 73 2f 50 43 53 43 2e 66  rameworks/PCSC.f
0890: 72 61 6d 65 77 6f 72 6b 2f 56 65 72 73 69 6f 6e  ramework/Version
08a0: 73 2f 41 2f 48 65 61 64 65 72 73 2f 0a 09 4c 49  s/A/Headers/..LI
08b0: 42 52 41 52 59 3d 2f 44 65 76 65 6c 6f 70 65 72  BRARY=/Developer
08c0: 2f 53 44 4b 73 2f 4d 61 63 4f 53 58 31 30 2e 36  /SDKs/MacOSX10.6
08d0: 2e 73 64 6b 2f 53 79 73 74 65 6d 2f 4c 69 62 72  .sdk/System/Libr
08e0: 61 72 79 2f 46 72 61 6d 65 77 6f 72 6b 73 2f 50  ary/Frameworks/P
08f0: 43 53 43 2e 66 72 61 6d 65 77 6f 72 6b 2f 50 43  CSC.framework/PC
0900: 53 43 0a 09 4c 49 42 3d 22 22 0a 09 41 52 43 48  SC..LIB=""..ARCH
0910: 4c 49 53 54 3d 22 22 0a 09 44 4c 49 42 3d 22 22  LIST=""..DLIB=""
0920: 0a 09 44 41 52 43 48 4c 49 53 54 3d 22 22 0a 09  ..DARCHLIST=""..
0930: 4f 53 58 3d 53 6e 6f 77 6c 65 6f 70 61 72 64 0a  OSX=Snowleopard.
0940: 09 50 4b 54 41 52 47 45 54 4f 53 3d 33 0a 09 4e  .PKTARGETOS=3..N
0950: 45 58 54 4f 53 58 56 45 52 3d 31 30 2e 37 0a 09  EXTOSXVER=10.7..
0960: 43 55 52 4f 53 58 56 45 52 3d 31 30 2e 36 0a 09  CUROSXVER=10.6..
0970: 66 6f 72 20 48 4f 53 54 20 69 6e 20 69 33 38 36  for HOST in i386
0980: 2d 61 70 70 6c 65 2d 64 61 72 77 69 6e 31 30 20  -apple-darwin10 
0990: 78 38 36 5f 36 34 2d 61 70 70 6c 65 2d 64 61 72  x86_64-apple-dar
09a0: 77 69 6e 31 30 3b 20 64 6f 0a 09 09 67 65 6e 62  win10; do...genb
09b0: 75 69 6c 64 0a 09 64 6f 6e 65 0a 09 6c 69 62 62  uild..done..libb
09c0: 75 69 6c 64 0a 09 70 6b 67 62 75 69 6c 64 0a 7d  uild..pkgbuild.}
09d0: 0a 0a 23 20 42 75 69 6c 64 20 66 75 6e 63 74 69  ..# Build functi
09e0: 6f 6e 20 66 6f 72 20 4c 69 6f 6e 0a 6c 69 6f 6e  on for Lion.lion
09f0: 28 29 20 7b 0a 09 6d 61 6b 65 64 69 72 0a 09 48  () {..makedir..H
0a00: 45 41 44 45 52 53 3d 2f 44 65 76 65 6c 6f 70 65  EADERS=/Develope
0a10: 72 2f 53 44 4b 73 2f 4d 61 63 4f 53 58 31 30 2e  r/SDKs/MacOSX10.
0a20: 37 2e 73 64 6b 2f 53 79 73 74 65 6d 2f 4c 69 62  7.sdk/System/Lib
0a30: 72 61 72 79 2f 46 72 61 6d 65 77 6f 72 6b 73 2f  rary/Frameworks/
0a40: 50 43 53 43 2e 66 72 61 6d 65 77 6f 72 6b 2f 56  PCSC.framework/V
0a50: 65 72 73 69 6f 6e 73 2f 41 2f 48 65 61 64 65 72  ersions/A/Header
0a60: 73 2f 0a 09 4c 49 42 52 41 52 59 3d 2f 44 65 76  s/..LIBRARY=/Dev
0a70: 65 6c 6f 70 65 72 2f 53 44 4b 73 2f 4d 61 63 4f  eloper/SDKs/MacO
0a80: 53 58 31 30 2e 37 2e 73 64 6b 2f 53 79 73 74 65  SX10.7.sdk/Syste
0a90: 6d 2f 4c 69 62 72 61 72 79 2f 46 72 61 6d 65 77  m/Library/Framew
0aa0: 6f 72 6b 73 2f 50 43 53 43 2e 66 72 61 6d 65 77  orks/PCSC.framew
0ab0: 6f 72 6b 2f 50 43 53 43 0a 09 4c 49 42 3d 22 22  ork/PCSC..LIB=""
0ac0: 0a 09 41 52 43 48 4c 49 53 54 3d 22 22 0a 09 44  ..ARCHLIST=""..D
0ad0: 4c 49 42 3d 22 22 0a 09 44 41 52 43 48 4c 49 53  LIB=""..DARCHLIS
0ae0: 54 3d 22 22 0a 09 4f 53 58 3d 4c 69 6f 6e 0a 09  T=""..OSX=Lion..
0af0: 50 4b 54 41 52 47 45 54 4f 53 3d 33 0a 09 4e 45  PKTARGETOS=3..NE
0b00: 58 54 4f 53 58 56 45 52 3d 31 30 2e 38 0a 09 43  XTOSXVER=10.8..C
0b10: 55 52 4f 53 58 56 45 52 3d 31 30 2e 37 0a 09 66  UROSXVER=10.7..f
0b20: 6f 72 20 48 4f 53 54 20 69 6e 20 69 33 38 36 2d  or HOST in i386-
0b30: 61 70 70 6c 65 2d 64 61 72 77 69 6e 31 31 20 78  apple-darwin11 x
0b40: 38 36 5f 36 34 2d 61 70 70 6c 65 2d 64 61 72 77  86_64-apple-darw
0b50: 69 6e 31 31 3b 20 64 6f 0a 09 09 67 65 6e 62 75  in11; do...genbu
0b60: 69 6c 64 0a 09 64 6f 6e 65 0a 09 6c 69 62 62 75  ild..done..libbu
0b70: 69 6c 64 0a 09 70 6b 67 62 75 69 6c 64 0a 7d 0a  ild..pkgbuild.}.
0b80: 0a 23 20 42 75 69 6c 64 20 66 75 6e 63 74 69 6f  .# Build functio
0b90: 6e 20 66 6f 72 20 53 6e 6f 77 20 4c 65 6f 70 61  n for Snow Leopa
0ba0: 72 64 2f 4c 69 6f 6e 2f 4d 6f 75 6e 74 61 69 6e  rd/Lion/Mountain
0bb0: 20 4c 69 6f 6e 0a 73 6c 74 6f 6d 6c 28 29 20 7b   Lion.sltoml() {
0bc0: 0a 09 6d 61 6b 65 64 69 72 0a 09 48 45 41 44 45  ..makedir..HEADE
0bd0: 52 53 3d 2f 44 65 76 65 6c 6f 70 65 72 2f 53 44  RS=/Developer/SD
0be0: 4b 73 2f 4d 61 63 4f 53 58 31 30 2e 36 2e 73 64  Ks/MacOSX10.6.sd
0bf0: 6b 2f 53 79 73 74 65 6d 2f 4c 69 62 72 61 72 79  k/System/Library
0c00: 2f 46 72 61 6d 65 77 6f 72 6b 73 2f 50 43 53 43  /Frameworks/PCSC
0c10: 2e 66 72 61 6d 65 77 6f 72 6b 2f 56 65 72 73 69  .framework/Versi
0c20: 6f 6e 73 2f 41 2f 48 65 61 64 65 72 73 2f 0a 09  ons/A/Headers/..
0c30: 4c 49 42 52 41 52 59 3d 2f 44 65 76 65 6c 6f 70  LIBRARY=/Develop
0c40: 65 72 2f 53 44 4b 73 2f 4d 61 63 4f 53 58 31 30  er/SDKs/MacOSX10
0c50: 2e 36 2e 73 64 6b 2f 53 79 73 74 65 6d 2f 4c 69  .6.sdk/System/Li
0c60: 62 72 61 72 79 2f 46 72 61 6d 65 77 6f 72 6b 73  brary/Frameworks
0c70: 2f 50 43 53 43 2e 66 72 61 6d 65 77 6f 72 6b 2f  /PCSC.framework/
0c80: 50 43 53 43 0a 09 4c 49 42 3d 22 22 0a 09 41 52  PCSC..LIB=""..AR
0c90: 43 48 4c 49 53 54 3d 22 22 0a 09 44 4c 49 42 3d  CHLIST=""..DLIB=
0ca0: 22 22 0a 09 44 41 52 43 48 4c 49 53 54 3d 22 22  ""..DARCHLIST=""
0cb0: 0a 09 4f 53 58 3d 53 6c 74 6f 6d 6c 0a 09 50 4b  ..OSX=Sltoml..PK
0cc0: 54 41 52 47 45 54 4f 53 3d 33 0a 09 4e 45 58 54  TARGETOS=3..NEXT
0cd0: 4f 53 58 56 45 52 3d 31 30 2e 39 0a 09 43 55 52  OSXVER=10.9..CUR
0ce0: 4f 53 58 56 45 52 3d 31 30 2e 36 0a 09 66 6f 72  OSXVER=10.6..for
0cf0: 20 48 4f 53 54 20 69 6e 20 69 33 38 36 2d 61 70   HOST in i386-ap
0d00: 70 6c 65 2d 64 61 72 77 69 6e 31 30 20 78 38 36  ple-darwin10 x86
0d10: 5f 36 34 2d 61 70 70 6c 65 2d 64 61 72 77 69 6e  _64-apple-darwin
0d20: 31 30 3b 20 64 6f 0a 09 09 67 65 6e 62 75 69 6c  10; do...genbuil
0d30: 64 0a 09 64 6f 6e 65 0a 09 6c 69 62 62 75 69 6c  d..done..libbuil
0d40: 64 0a 09 70 6b 67 62 75 69 6c 64 0a 7d 0a 0a 23  d..pkgbuild.}..#
0d50: 20 42 75 69 6c 64 20 66 75 6e 63 74 69 6f 6e 20   Build function 
0d60: 66 6f 72 20 53 6e 6f 77 20 4c 65 6f 70 61 72 64  for Snow Leopard
0d70: 2f 4c 69 6f 6e 2f 4d 6f 75 6e 74 61 69 6e 20 4c  /Lion/Mountain L
0d80: 69 6f 6e 0a 73 6c 74 6f 6d 6c 28 29 20 7b 0a 09  ion.sltoml() {..
0d90: 6d 61 6b 65 64 69 72 0a 09 48 45 41 44 45 52 53  makedir..HEADERS
0da0: 3d 2f 44 65 76 65 6c 6f 70 65 72 2f 53 44 4b 73  =/Developer/SDKs
0db0: 2f 4d 61 63 4f 53 58 31 30 2e 36 2e 73 64 6b 2f  /MacOSX10.6.sdk/
0dc0: 53 79 73 74 65 6d 2f 4c 69 62 72 61 72 79 2f 46  System/Library/F
0dd0: 72 61 6d 65 77 6f 72 6b 73 2f 50 43 53 43 2e 66  rameworks/PCSC.f
0de0: 72 61 6d 65 77 6f 72 6b 2f 56 65 72 73 69 6f 6e  ramework/Version
0df0: 73 2f 41 2f 48 65 61 64 65 72 73 2f 0a 09 4c 49  s/A/Headers/..LI
0e00: 42 52 41 52 59 3d 2f 44 65 76 65 6c 6f 70 65 72  BRARY=/Developer
0e10: 2f 53 44 4b 73 2f 4d 61 63 4f 53 58 31 30 2e 36  /SDKs/MacOSX10.6
0e20: 2e 73 64 6b 2f 53 79 73 74 65 6d 2f 4c 69 62 72  .sdk/System/Libr
0e30: 61 72 79 2f 46 72 61 6d 65 77 6f 72 6b 73 2f 50  ary/Frameworks/P
0e40: 43 53 43 2e 66 72 61 6d 65 77 6f 72 6b 2f 50 43  CSC.framework/PC
0e50: 53 43 0a 09 4c 49 42 3d 22 22 0a 09 41 52 43 48  SC..LIB=""..ARCH
0e60: 4c 49 53 54 3d 22 22 0a 09 44 4c 49 42 3d 22 22  LIST=""..DLIB=""
0e70: 0a 09 44 41 52 43 48 4c 49 53 54 3d 22 22 0a 09  ..DARCHLIST=""..
0e80: 4f 53 58 3d 53 6c 74 6f 6d 6c 0a 09 50 4b 54 41  OSX=Sltoml..PKTA
0e90: 52 47 45 54 4f 53 3d 33 0a 09 4e 45 58 54 4f 53  RGETOS=3..NEXTOS
0ea0: 58 56 45 52 3d 31 30 2e 39 0a 09 43 55 52 4f 53  XVER=10.9..CUROS
0eb0: 58 56 45 52 3d 31 30 2e 36 0a 09 66 6f 72 20 48  XVER=10.6..for H
0ec0: 4f 53 54 20 69 6e 20 69 33 38 36 2d 61 70 70 6c  OST in i386-appl
0ed0: 65 2d 64 61 72 77 69 6e 31 30 20 78 38 36 5f 36  e-darwin10 x86_6
0ee0: 34 2d 61 70 70 6c 65 2d 64 61 72 77 69 6e 31 30  4-apple-darwin10
0ef0: 3b 20 64 6f 0a 09 09 67 65 6e 62 75 69 6c 64 0a  ; do...genbuild.
0f00: 09 64 6f 6e 65 0a 09 6c 69 62 62 75 69 6c 64 0a  .done..libbuild.
0f10: 09 70 6b 67 62 75 69 6c 64 0a 7d 0a 0a 23 20 47  .pkgbuild.}..# G
0f20: 65 6e 65 72 69 63 20 62 75 69 6c 64 20 66 75 6e  eneric build fun
0f30: 63 74 69 6f 6e 0a 67 65 6e 62 75 69 6c 64 28 29  ction.genbuild()
0f40: 20 7b 0a 09 6d 61 6b 65 20 64 69 73 74 63 6c 65   {..make distcle
0f50: 61 6e 0a 09 41 52 43 48 3d 60 65 63 68 6f 20 24  an..ARCH=`echo $
0f60: 7b 48 4f 53 54 7d 20 7c 20 63 75 74 20 2d 64 20  {HOST} | cut -d 
0f70: 22 2d 22 20 2d 66 20 31 60 0a 09 69 66 20 5b 20  "-" -f 1`..if [ 
0f80: 24 7b 41 52 43 48 7d 20 3d 3d 20 22 70 6f 77 65  ${ARCH} == "powe
0f90: 72 70 63 22 20 5d 3b 20 74 68 65 6e 0a 09 09 69  rpc" ]; then...i
0fa0: 66 20 5b 20 24 7b 4f 53 58 7d 20 3d 3d 20 22 4c  f [ ${OSX} == "L
0fb0: 65 6f 70 61 72 64 22 20 5d 3b 20 74 68 65 6e 0a  eopard" ]; then.
0fc0: 09 09 09 41 52 43 48 3d 22 70 70 63 20 2d 6d 63  ...ARCH="ppc -mc
0fd0: 70 75 3d 47 34 22 0a 09 09 65 6c 73 65 0a 09 09  pu=G4"...else...
0fe0: 09 41 52 43 48 3d 22 70 70 63 20 2d 6d 63 70 75  .ARCH="ppc -mcpu
0ff0: 3d 47 33 22 0a 09 09 66 69 0a 09 66 69 0a 09 69  =G3"...fi..fi..i
1000: 66 20 5b 20 22 24 7b 4c 49 4f 4e 42 55 49 4c 44  f [ "${LIONBUILD
1010: 7d 22 20 3d 20 31 20 5d 3b 20 74 68 65 6e 0a 09  }" = 1 ]; then..
1020: 09 69 66 20 5b 20 22 24 7b 41 52 43 48 7d 22 20  .if [ "${ARCH}" 
1030: 3d 3d 20 22 70 70 63 20 2d 6d 63 70 75 3d 47 34  == "ppc -mcpu=G4
1040: 22 20 5d 3b 20 74 68 65 6e 0a 09 09 09 43 43 3d  " ]; then....CC=
1050: 70 6f 77 65 72 70 63 2d 61 70 70 6c 65 2d 64 61  powerpc-apple-da
1060: 72 77 69 6e 31 31 2d 67 63 63 2d 34 2e 32 2e 31  rwin11-gcc-4.2.1
1070: 20 43 50 50 3d 70 6f 77 65 72 70 63 2d 61 70 70   CPP=powerpc-app
1080: 6c 65 2d 64 61 72 77 69 6e 31 31 2d 63 70 70 2d  le-darwin11-cpp-
1090: 34 2e 32 2e 31 20 43 46 4c 41 47 53 3d 22 2d 6d  4.2.1 CFLAGS="-m
10a0: 33 32 20 2d 49 2f 44 65 76 65 6c 6f 70 65 72 2f  32 -I/Developer/
10b0: 50 6c 61 74 66 6f 72 6d 73 2f 69 50 68 6f 6e 65  Platforms/iPhone
10c0: 4f 53 2e 70 6c 61 74 66 6f 72 6d 2f 44 65 76 65  OS.platform/Deve
10d0: 6c 6f 70 65 72 2f 75 73 72 2f 6c 69 62 2f 67 63  loper/usr/lib/gc
10e0: 63 2f 70 6f 77 65 72 70 63 2d 61 70 70 6c 65 2d  c/powerpc-apple-
10f0: 64 61 72 77 69 6e 31 30 2f 34 2e 32 2e 31 2f 69  darwin10/4.2.1/i
1100: 6e 63 6c 75 64 65 20 2d 69 73 79 73 72 6f 6f 74  nclude -isysroot
1110: 20 2f 44 65 76 65 6c 6f 70 65 72 2f 53 44 4b 73   /Developer/SDKs
1120: 2f 4d 61 63 4f 53 58 31 30 2e 35 2e 73 64 6b 22  /MacOSX10.5.sdk"
1130: 20 43 50 50 46 4c 41 47 53 3d 22 2d 44 5f 4c 49   CPPFLAGS="-D_LI
1140: 42 43 5f 4c 49 4d 49 54 53 5f 48 5f 22 20 2e 2f  BC_LIMITS_H_" ./
1150: 63 6f 6e 66 69 67 75 72 65 20 2d 2d 77 69 74 68  configure --with
1160: 2d 70 63 73 63 2d 68 65 61 64 65 72 73 3d 24 7b  -pcsc-headers=${
1170: 48 45 41 44 45 52 53 7d 20 2d 2d 77 69 74 68 2d  HEADERS} --with-
1180: 70 63 73 63 2d 6c 69 62 73 3d 24 7b 4c 49 42 52  pcsc-libs=${LIBR
1190: 41 52 59 7d 20 2d 2d 68 6f 73 74 3d 24 7b 48 4f  ARY} --host=${HO
11a0: 53 54 7d 20 2d 2d 65 6e 61 62 6c 65 2d 64 6f 64  ST} --enable-dod
11b0: 2d 63 65 72 74 73 2d 6f 6e 2d 68 77 2d 73 6c 6f  -certs-on-hw-slo
11c0: 74 73 0a 09 09 65 6c 73 65 0a 09 09 09 43 46 4c  ts...else....CFL
11d0: 41 47 53 3d 22 2d 61 72 63 68 20 24 7b 41 52 43  AGS="-arch ${ARC
11e0: 48 7d 22 20 2e 2f 63 6f 6e 66 69 67 75 72 65 20  H}" ./configure 
11f0: 2d 2d 77 69 74 68 2d 70 63 73 63 2d 68 65 61 64  --with-pcsc-head
1200: 65 72 73 3d 24 7b 48 45 41 44 45 52 53 7d 20 2d  ers=${HEADERS} -
1210: 2d 77 69 74 68 2d 70 63 73 63 2d 6c 69 62 73 3d  -with-pcsc-libs=
1220: 24 7b 4c 49 42 52 41 52 59 7d 20 2d 2d 68 6f 73  ${LIBRARY} --hos
1230: 74 3d 24 7b 48 4f 53 54 7d 20 2d 2d 65 6e 61 62  t=${HOST} --enab
1240: 6c 65 2d 64 6f 64 2d 63 65 72 74 73 2d 6f 6e 2d  le-dod-certs-on-
1250: 68 77 2d 73 6c 6f 74 73 0a 09 09 66 69 0a 09 65  hw-slots...fi..e
1260: 6c 73 65 0a 09 09 43 46 4c 41 47 53 3d 22 2d 61  lse...CFLAGS="-a
1270: 72 63 68 20 24 7b 41 52 43 48 7d 22 20 2e 2f 63  rch ${ARCH}" ./c
1280: 6f 6e 66 69 67 75 72 65 20 2d 2d 77 69 74 68 2d  onfigure --with-
1290: 70 63 73 63 2d 68 65 61 64 65 72 73 3d 24 7b 48  pcsc-headers=${H
12a0: 45 41 44 45 52 53 7d 20 2d 2d 77 69 74 68 2d 70  EADERS} --with-p
12b0: 63 73 63 2d 6c 69 62 73 3d 24 7b 4c 49 42 52 41  csc-libs=${LIBRA
12c0: 52 59 7d 20 2d 2d 68 6f 73 74 3d 24 7b 48 4f 53  RY} --host=${HOS
12d0: 54 7d 20 2d 2d 65 6e 61 62 6c 65 2d 64 6f 64 2d  T} --enable-dod-
12e0: 63 65 72 74 73 2d 6f 6e 2d 68 77 2d 73 6c 6f 74  certs-on-hw-slot
12f0: 73 0a 09 66 69 0a 09 6d 61 6b 65 0a 09 63 70 20  s..fi..make..cp 
1300: 6c 69 62 63 61 63 6b 65 79 2e 64 79 6c 69 62 20  libcackey.dylib 
1310: 6d 61 63 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 2f  macbuild/${OSX}/
1320: 6c 69 62 63 61 63 6b 65 79 2e 64 79 6c 69 62 2e  libcackey.dylib.
1330: 60 65 63 68 6f 20 24 7b 41 52 43 48 7d 20 7c 20  `echo ${ARCH} | 
1340: 63 75 74 20 2d 64 20 27 20 27 20 2d 66 20 31 60  cut -d ' ' -f 1`
1350: 0a 09 63 70 20 6c 69 62 63 61 63 6b 65 79 5f 67  ..cp libcackey_g
1360: 2e 64 79 6c 69 62 20 6d 61 63 62 75 69 6c 64 2f  .dylib macbuild/
1370: 24 7b 4f 53 58 7d 2f 6c 69 62 63 61 63 6b 65 79  ${OSX}/libcackey
1380: 5f 67 2e 64 79 6c 69 62 2e 60 65 63 68 6f 20 24  _g.dylib.`echo $
1390: 7b 41 52 43 48 7d 20 7c 20 63 75 74 20 2d 64 20  {ARCH} | cut -d 
13a0: 27 20 27 20 2d 66 20 31 60 20 0a 7d 0a 0a 23 20  ' ' -f 1` .}..# 
13b0: 4c 69 62 72 61 72 79 20 62 75 69 6c 64 20 66 75  Library build fu
13c0: 6e 63 74 69 6f 6e 0a 6c 69 62 62 75 69 6c 64 28  nction.libbuild(
13d0: 29 20 7b 0a 09 66 6f 72 20 4c 49 42 20 69 6e 20  ) {..for LIB in 
13e0: 6d 61 63 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 2f  macbuild/${OSX}/
13f0: 6c 69 62 63 61 63 6b 65 79 2e 64 79 6c 69 62 2e  libcackey.dylib.
1400: 2a 3b 20 64 6f 0a 09 09 41 52 43 48 4c 49 53 54  *; do...ARCHLIST
1410: 3d 22 24 7b 41 52 43 48 4c 49 53 54 7d 20 60 65  ="${ARCHLIST} `e
1420: 63 68 6f 20 27 2d 61 72 63 68 20 27 60 20 60 65  cho '-arch '` `e
1430: 63 68 6f 20 24 7b 4c 49 42 7d 20 7c 20 63 75 74  cho ${LIB} | cut
1440: 20 2d 64 20 2e 20 2d 66 20 33 60 20 60 65 63 68   -d . -f 3` `ech
1450: 6f 20 27 20 27 60 20 60 65 63 68 6f 20 24 7b 4c  o ' '` `echo ${L
1460: 49 42 7d 60 22 0a 09 64 6f 6e 65 0a 09 6c 69 70  IB}`"..done..lip
1470: 6f 20 2d 63 72 65 61 74 65 20 24 7b 41 52 43 48  o -create ${ARCH
1480: 4c 49 53 54 7d 20 2d 6f 75 74 70 75 74 20 6d 61  LIST} -output ma
1490: 63 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 2f 6c 69  cbuild/${OSX}/li
14a0: 62 63 61 63 6b 65 79 2e 64 79 6c 69 62 0a 09 66  bcackey.dylib..f
14b0: 6f 72 20 44 4c 49 42 20 69 6e 20 6d 61 63 62 75  or DLIB in macbu
14c0: 69 6c 64 2f 24 7b 4f 53 58 7d 2f 6c 69 62 63 61  ild/${OSX}/libca
14d0: 63 6b 65 79 5f 67 2e 64 79 6c 69 62 2e 2a 3b 20  ckey_g.dylib.*; 
14e0: 64 6f 0a 09 09 44 41 52 43 48 4c 49 53 54 3d 22  do...DARCHLIST="
14f0: 24 7b 44 41 52 43 48 4c 49 53 54 7d 20 60 65 63  ${DARCHLIST} `ec
1500: 68 6f 20 27 2d 61 72 63 68 20 27 60 20 60 65 63  ho '-arch '` `ec
1510: 68 6f 20 24 7b 44 4c 49 42 7d 20 7c 20 63 75 74  ho ${DLIB} | cut
1520: 20 2d 64 20 2e 20 2d 66 20 33 60 20 60 65 63 68   -d . -f 3` `ech
1530: 6f 20 27 20 27 60 20 60 65 63 68 6f 20 24 7b 44  o ' '` `echo ${D
1540: 4c 49 42 7d 60 22 0a 09 64 6f 6e 65 0a 09 6c 69  LIB}`"..done..li
1550: 70 6f 20 2d 63 72 65 61 74 65 20 24 7b 44 41 52  po -create ${DAR
1560: 43 48 4c 49 53 54 7d 20 2d 6f 75 74 70 75 74 20  CHLIST} -output 
1570: 6d 61 63 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 2f  macbuild/${OSX}/
1580: 6c 69 62 63 61 63 6b 65 79 5f 67 2e 64 79 6c 69  libcackey_g.dyli
1590: 62 0a 09 72 6d 20 6d 61 63 62 75 69 6c 64 2f 24  b..rm macbuild/$
15a0: 7b 4f 53 58 7d 2f 6c 69 62 63 61 63 6b 65 79 2a  {OSX}/libcackey*
15b0: 2e 64 79 6c 69 62 2e 2a 0a 7d 0a 0a 23 20 46 75  .dylib.*.}..# Fu
15c0: 6e 63 74 69 6f 6e 20 74 6f 20 62 75 69 6c 64 20  nction to build 
15d0: 4d 61 63 20 4f 53 20 58 20 50 61 63 6b 61 67 65  Mac OS X Package
15e0: 73 0a 70 6b 67 62 75 69 6c 64 28 29 20 7b 0a 09  s.pkgbuild() {..
15f0: 69 66 20 5b 20 22 60 75 6e 61 6d 65 20 2d 72 20  if [ "`uname -r 
1600: 7c 20 63 75 74 20 2d 64 20 2e 20 2d 66 20 31 60  | cut -d . -f 1`
1610: 22 20 2d 6c 74 20 22 31 30 22 20 5d 3b 20 74 68  " -lt "10" ]; th
1620: 65 6e 0a 09 09 4c 49 42 43 41 43 4b 45 59 47 3d  en...LIBCACKEYG=
1630: 6c 69 62 63 61 63 6b 65 79 67 2e 70 6b 67 0a 09  libcackeyg.pkg..
1640: 65 6c 73 65 0a 09 09 4c 49 42 43 41 43 4b 45 59  else...LIBCACKEY
1650: 47 3d 6c 69 62 63 61 63 6b 65 79 5f 67 2e 70 6b  G=libcackey_g.pk
1660: 67 0a 09 66 69 0a 09 72 6d 20 2d 66 20 62 75 69  g..fi..rm -f bui
1670: 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75  ld/cackey_osx_bu
1680: 69 6c 64 2f 63 61 63 6b 65 79 2e 64 79 6c 69 62  ild/cackey.dylib
1690: 0a 09 6c 6e 20 6d 61 63 62 75 69 6c 64 2f 24 7b  ..ln macbuild/${
16a0: 4f 53 58 7d 2f 6c 69 62 63 61 63 6b 65 79 2e 64  OSX}/libcackey.d
16b0: 79 6c 69 62 20 62 75 69 6c 64 2f 63 61 63 6b 65  ylib build/cacke
16c0: 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 63 61 63 6b  y_osx_build/cack
16d0: 65 79 2e 64 79 6c 69 62 0a 09 72 6d 20 2d 72 66  ey.dylib..rm -rf
16e0: 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73   build/cackey_os
16f0: 78 5f 62 75 69 6c 64 2f 50 4b 43 53 31 31 2e 74  x_build/PKCS11.t
1700: 6f 6b 65 6e 64 0a 09 69 66 20 5b 20 22 24 7b 4c  okend..if [ "${L
1710: 49 4f 4e 42 55 49 4c 44 7d 22 20 3d 20 31 20 5d  IONBUILD}" = 1 ]
1720: 3b 20 74 68 65 6e 0a 09 09 54 41 52 3d 67 6e 75  ; then...TAR=gnu
1730: 74 61 72 0a 09 65 6c 73 65 0a 09 09 54 41 52 3d  tar..else...TAR=
1740: 74 61 72 0a 09 66 69 0a 09 69 66 20 5b 20 22 24  tar..fi..if [ "$
1750: 7b 4f 53 58 7d 22 20 3d 20 22 4c 65 6f 70 61 72  {OSX}" = "Leopar
1760: 64 22 20 5d 3b 20 74 68 65 6e 0a 09 09 63 75 72  d" ]; then...cur
1770: 6c 20 68 74 74 70 3a 2f 2f 64 65 76 65 6c 2e 6b  l http://devel.k
1780: 76 61 6e 61 6c 73 2e 6f 72 67 2f 50 4b 43 53 31  vanals.org/PKCS1
1790: 31 5f 54 6f 6b 65 6e 64 2f 50 4b 43 53 31 31 5f  1_Tokend/PKCS11_
17a0: 74 6f 6b 65 6e 64 2d 6c 61 74 65 73 74 2e 74 61  tokend-latest.ta
17b0: 72 2e 67 7a 20 7c 20 24 7b 54 41 52 7d 20 2d 2d  r.gz | ${TAR} --
17c0: 73 74 72 69 70 2d 63 6f 6d 70 6f 6e 65 6e 74 73  strip-components
17d0: 20 33 20 2d 2d 77 69 6c 64 63 61 72 64 73 20 2d   3 --wildcards -
17e0: 78 20 2d 7a 20 2d 66 20 2d 20 22 50 4b 43 53 31  x -z -f - "PKCS1
17f0: 31 5f 74 6f 6b 65 6e 64 2d 2a 2f 70 72 65 62 75  1_tokend-*/prebu
1800: 69 6c 74 2f 6c 65 6f 70 61 72 64 2f 50 4b 43 53  ilt/leopard/PKCS
1810: 31 31 2e 74 6f 6b 65 6e 64 22 0a 09 09 6d 76 20  11.tokend"...mv 
1820: 50 4b 43 53 31 31 2e 74 6f 6b 65 6e 64 20 62 75  PKCS11.tokend bu
1830: 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62  ild/cackey_osx_b
1840: 75 69 6c 64 2f 50 4b 43 53 31 31 2e 74 6f 6b 65  uild/PKCS11.toke
1850: 6e 64 0a 09 65 6c 73 65 0a 09 09 63 75 72 6c 20  nd..else...curl 
1860: 68 74 74 70 3a 2f 2f 64 65 76 65 6c 2e 6b 76 61  http://devel.kva
1870: 6e 61 6c 73 2e 6f 72 67 2f 50 4b 43 53 31 31 5f  nals.org/PKCS11_
1880: 54 6f 6b 65 6e 64 2f 50 4b 43 53 31 31 5f 74 6f  Tokend/PKCS11_to
1890: 6b 65 6e 64 2d 6c 61 74 65 73 74 2e 74 61 72 2e  kend-latest.tar.
18a0: 67 7a 20 7c 20 24 7b 54 41 52 7d 20 2d 2d 73 74  gz | ${TAR} --st
18b0: 72 69 70 2d 63 6f 6d 70 6f 6e 65 6e 74 73 20 33  rip-components 3
18c0: 20 2d 2d 77 69 6c 64 63 61 72 64 73 20 2d 78 20   --wildcards -x 
18d0: 2d 7a 20 2d 66 20 2d 20 22 50 4b 43 53 31 31 5f  -z -f - "PKCS11_
18e0: 74 6f 6b 65 6e 64 2d 2a 2f 70 72 65 62 75 69 6c  tokend-*/prebuil
18f0: 74 2f 73 6e 6f 77 6c 65 6f 70 61 72 64 2f 50 4b  t/snowleopard/PK
1900: 43 53 31 31 2e 74 6f 6b 65 6e 64 22 0a 09 09 6d  CS11.tokend"...m
1910: 76 20 50 4b 43 53 31 31 2e 74 6f 6b 65 6e 64 20  v PKCS11.tokend 
1920: 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78  build/cackey_osx
1930: 5f 62 75 69 6c 64 2f 50 4b 43 53 31 31 2e 74 6f  _build/PKCS11.to
1940: 6b 65 6e 64 0a 09 66 69 0a 09 66 6f 72 20 50 4d  kend..fi..for PM
1950: 44 4f 43 20 69 6e 20 62 75 69 6c 64 2f 63 61 63  DOC in build/cac
1960: 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 54 65  key_osx_build/Te
1970: 6d 70 6c 61 74 65 5f 70 6d 62 75 69 6c 64 2f 2a  mplate_pmbuild/*
1980: 2e 69 6e 3b 20 64 6f 0a 09 09 50 4d 44 4f 43 3d  .in; do...PMDOC=
1990: 22 60 65 63 68 6f 20 22 24 7b 50 4d 44 4f 43 7d  "`echo "${PMDOC}
19a0: 22 20 7c 20 73 65 64 20 27 73 7c 6c 2e 69 6e 7c  " | sed 's|l.in|
19b0: 6c 7c 67 27 20 7c 20 73 65 64 20 27 73 7c 62 75  l|g' | sed 's|bu
19c0: 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62  ild/cackey_osx_b
19d0: 75 69 6c 64 2f 54 65 6d 70 6c 61 74 65 5f 70 6d  uild/Template_pm
19e0: 62 75 69 6c 64 2f 7c 7c 67 27 60 22 0a 09 09 55  build/||g'`"...U
19f0: 55 49 44 3d 22 60 70 79 74 68 6f 6e 20 2d 63 20  UID="`python -c 
1a00: 27 69 6d 70 6f 72 74 20 75 75 69 64 3b 20 70 72  'import uuid; pr
1a10: 69 6e 74 20 75 75 69 64 2e 75 75 69 64 31 28 29  int uuid.uuid1()
1a20: 27 20 7c 20 64 64 20 63 6f 6e 76 3d 75 63 61 73  ' | dd conv=ucas
1a30: 65 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 22 0a  e 2>/dev/null`".
1a40: 09 09 6d 6b 64 69 72 20 2d 70 20 62 75 69 6c 64  ..mkdir -p build
1a50: 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c  /cackey_osx_buil
1a60: 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64  d/${OSX}_pmbuild
1a70: 2e 70 6d 64 6f 63 0a 09 09 73 65 64 20 22 73 7c  .pmdoc...sed "s|
1a80: 40 40 42 55 49 4c 44 52 4f 4f 54 44 49 52 40 40  @@BUILDROOTDIR@@
1a90: 7c 24 28 70 77 64 29 7c 67 22 20 62 75 69 6c 64  |$(pwd)|g" build
1aa0: 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c  /cackey_osx_buil
1ab0: 64 2f 54 65 6d 70 6c 61 74 65 5f 70 6d 62 75 69  d/Template_pmbui
1ac0: 6c 64 2f 24 7b 50 4d 44 4f 43 7d 2e 69 6e 20 3e  ld/${PMDOC}.in >
1ad0: 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73   build/cackey_os
1ae0: 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70  x_build/${OSX}_p
1af0: 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f 24 7b 50  mbuild.pmdoc/${P
1b00: 4d 44 4f 43 7d 0a 09 09 73 65 64 20 22 73 7c 40  MDOC}...sed "s|@
1b10: 40 4f 53 58 56 45 52 53 49 4f 4e 40 40 7c 24 7b  @OSXVERSION@@|${
1b20: 4f 53 58 7d 7c 67 22 20 62 75 69 6c 64 2f 63 61  OSX}|g" build/ca
1b30: 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24  ckey_osx_build/$
1b40: 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d  {OSX}_pmbuild.pm
1b50: 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d 20 3e 20 62  doc/${PMDOC} > b
1b60: 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f  uild/cackey_osx_
1b70: 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62  build/${OSX}_pmb
1b80: 75 69 6c 64 2e 70 6d 64 6f 63 2f 24 7b 50 4d 44  uild.pmdoc/${PMD
1b90: 4f 43 7d 2e 31 0a 09 09 73 65 64 20 22 73 7c 40  OC}.1...sed "s|@
1ba0: 40 55 55 49 44 40 40 7c 24 7b 55 55 49 44 7d 7c  @UUID@@|${UUID}|
1bb0: 67 22 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f  g" build/cackey_
1bc0: 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58 7d  osx_build/${OSX}
1bd0: 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f 24  _pmbuild.pmdoc/$
1be0: 7b 50 4d 44 4f 43 7d 2e 31 20 3e 20 62 75 69 6c  {PMDOC}.1 > buil
1bf0: 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69  d/cackey_osx_bui
1c00: 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c  ld/${OSX}_pmbuil
1c10: 64 2e 70 6d 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d  d.pmdoc/${PMDOC}
1c20: 0a 09 09 73 65 64 20 22 73 7c 40 40 54 41 52 47  ...sed "s|@@TARG
1c30: 45 54 4f 53 40 40 7c 24 7b 50 4b 54 41 52 47 45  ETOS@@|${PKTARGE
1c40: 54 4f 53 7d 7c 67 22 20 62 75 69 6c 64 2f 63 61  TOS}|g" build/ca
1c50: 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24  ckey_osx_build/$
1c60: 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d  {OSX}_pmbuild.pm
1c70: 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d 20 3e 20 62  doc/${PMDOC} > b
1c80: 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f  uild/cackey_osx_
1c90: 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62  build/${OSX}_pmb
1ca0: 75 69 6c 64 2e 70 6d 64 6f 63 2f 24 7b 50 4d 44  uild.pmdoc/${PMD
1cb0: 4f 43 7d 2e 31 0a 09 09 73 65 64 20 22 73 7c 40  OC}.1...sed "s|@
1cc0: 40 4e 45 58 54 4f 53 58 56 45 52 40 40 7c 24 7b  @NEXTOSXVER@@|${
1cd0: 4e 45 58 54 4f 53 58 56 45 52 7d 7c 67 22 20 62  NEXTOSXVER}|g" b
1ce0: 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f  uild/cackey_osx_
1cf0: 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62  build/${OSX}_pmb
1d00: 75 69 6c 64 2e 70 6d 64 6f 63 2f 24 7b 50 4d 44  uild.pmdoc/${PMD
1d10: 4f 43 7d 2e 31 20 3e 20 62 75 69 6c 64 2f 63 61  OC}.1 > build/ca
1d20: 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24  ckey_osx_build/$
1d30: 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d  {OSX}_pmbuild.pm
1d40: 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d 0a 09 09 73  doc/${PMDOC}...s
1d50: 65 64 20 22 73 7c 40 40 43 55 52 4f 53 58 56 45  ed "s|@@CUROSXVE
1d60: 52 40 40 7c 24 7b 43 55 52 4f 53 58 56 45 52 7d  R@@|${CUROSXVER}
1d70: 7c 67 22 20 62 75 69 6c 64 2f 63 61 63 6b 65 79  |g" build/cackey
1d80: 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58  _osx_build/${OSX
1d90: 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f  }_pmbuild.pmdoc/
1da0: 24 7b 50 4d 44 4f 43 7d 20 3e 20 62 75 69 6c 64  ${PMDOC} > build
1db0: 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c  /cackey_osx_buil
1dc0: 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64  d/${OSX}_pmbuild
1dd0: 2e 70 6d 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d 2e  .pmdoc/${PMDOC}.
1de0: 31 0a 09 09 73 65 64 20 22 73 7c 40 40 4c 49 42  1...sed "s|@@LIB
1df0: 43 41 43 4b 45 59 47 40 40 7c 24 7b 4c 49 42 43  CACKEYG@@|${LIBC
1e00: 41 43 4b 45 59 47 7d 7c 67 22 20 62 75 69 6c 64  ACKEYG}|g" build
1e10: 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c  /cackey_osx_buil
1e20: 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64  d/${OSX}_pmbuild
1e30: 2e 70 6d 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d 2e  .pmdoc/${PMDOC}.
1e40: 31 20 3e 20 62 75 69 6c 64 2f 63 61 63 6b 65 79  1 > build/cackey
1e50: 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58  _osx_build/${OSX
1e60: 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f  }_pmbuild.pmdoc/
1e70: 24 7b 50 4d 44 4f 43 7d 0a 09 09 63 70 20 62 75  ${PMDOC}...cp bu
1e80: 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62  ild/cackey_osx_b
1e90: 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75  uild/${OSX}_pmbu
1ea0: 69 6c 64 2e 70 6d 64 6f 63 2f 24 7b 50 4d 44 4f  ild.pmdoc/${PMDO
1eb0: 43 7d 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f  C} build/cackey_
1ec0: 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58 7d  osx_build/${OSX}
1ed0: 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f 24  _pmbuild.pmdoc/$
1ee0: 7b 50 4d 44 4f 43 7d 2e 31 0a 09 09 6d 76 20 62  {PMDOC}.1...mv b
1ef0: 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f  uild/cackey_osx_
1f00: 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62  build/${OSX}_pmb
1f10: 75 69 6c 64 2e 70 6d 64 6f 63 2f 24 7b 50 4d 44  uild.pmdoc/${PMD
1f20: 4f 43 7d 2e 31 20 62 75 69 6c 64 2f 63 61 63 6b  OC}.1 build/cack
1f30: 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f  ey_osx_build/${O
1f40: 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f  SX}_pmbuild.pmdo
1f50: 63 2f 24 7b 50 4d 44 4f 43 7d 0a 09 64 6f 6e 65  c/${PMDOC}..done
1f60: 0a 09 45 58 54 3d 70 6b 67 0a 09 69 66 20 5b 20  ..EXT=pkg..if [ 
1f70: 24 7b 4f 53 58 7d 20 3d 3d 20 22 53 6e 6f 77 6c  ${OSX} == "Snowl
1f80: 65 6f 70 61 72 64 22 20 5d 3b 20 74 68 65 6e 0a  eopard" ]; then.
1f90: 09 09 63 61 74 20 62 75 69 6c 64 2f 63 61 63 6b  ..cat build/cack
1fa0: 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f  ey_osx_build/${O
1fb0: 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f  SX}_pmbuild.pmdo
1fc0: 63 2f 69 6e 64 65 78 2e 78 6d 6c 20 7c 20 73 65  c/index.xml | se
1fd0: 64 20 27 73 7c 66 6f 72 20 4d 61 63 20 4f 53 20  d 's|for Mac OS 
1fe0: 58 20 53 6e 6f 77 6c 65 6f 70 61 72 64 7c 66 6f  X Snowleopard|fo
1ff0: 72 20 4d 61 63 20 4f 53 20 58 20 53 6e 6f 77 4c  r Mac OS X SnowL
2000: 65 6f 70 61 72 64 7c 67 27 20 3e 20 62 75 69 6c  eopard|g' > buil
2010: 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69  d/cackey_osx_bui
2020: 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c  ld/${OSX}_pmbuil
2030: 64 2e 70 6d 64 6f 63 2f 69 6e 64 65 78 2e 78 6d  d.pmdoc/index.xm
2040: 6c 2e 6e 65 77 0a 09 09 6d 76 20 62 75 69 6c 64  l.new...mv build
2050: 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c  /cackey_osx_buil
2060: 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64  d/${OSX}_pmbuild
2070: 2e 70 6d 64 6f 63 2f 69 6e 64 65 78 2e 78 6d 6c  .pmdoc/index.xml
2080: 2e 6e 65 77 20 62 75 69 6c 64 2f 63 61 63 6b 65  .new build/cacke
2090: 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53  y_osx_build/${OS
20a0: 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63  X}_pmbuild.pmdoc
20b0: 2f 69 6e 64 65 78 2e 78 6d 6c 0a 09 66 69 0a 09  /index.xml..fi..
20c0: 69 66 20 5b 20 24 7b 4f 53 58 7d 20 3d 3d 20 22  if [ ${OSX} == "
20d0: 53 6c 74 6f 6d 6c 22 20 5d 3b 20 74 68 65 6e 0a  Sltoml" ]; then.
20e0: 09 09 63 61 74 20 62 75 69 6c 64 2f 63 61 63 6b  ..cat build/cack
20f0: 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f  ey_osx_build/${O
2100: 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f  SX}_pmbuild.pmdo
2110: 63 2f 69 6e 64 65 78 2e 78 6d 6c 20 7c 20 73 65  c/index.xml | se
2120: 64 20 27 73 7c 66 6f 72 20 4d 61 63 20 4f 53 20  d 's|for Mac OS 
2130: 58 20 53 6c 74 6f 6d 6c 7c 66 6f 72 20 4d 61 63  X Sltoml|for Mac
2140: 20 4f 53 20 58 20 53 4c 74 6f 4d 4c 7c 67 27 20   OS X SLtoML|g' 
2150: 3e 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f  > build/cackey_o
2160: 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f  sx_build/${OSX}_
2170: 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f 69 6e  pmbuild.pmdoc/in
2180: 64 65 78 2e 78 6d 6c 2e 6e 65 77 0a 09 09 6d 76  dex.xml.new...mv
2190: 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73   build/cackey_os
21a0: 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70  x_build/${OSX}_p
21b0: 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f 69 6e 64  mbuild.pmdoc/ind
21c0: 65 78 2e 78 6d 6c 2e 6e 65 77 20 62 75 69 6c 64  ex.xml.new build
21d0: 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c  /cackey_osx_buil
21e0: 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64  d/${OSX}_pmbuild
21f0: 2e 70 6d 64 6f 63 2f 69 6e 64 65 78 2e 78 6d 6c  .pmdoc/index.xml
2200: 0a 09 66 69 0a 09 2f 44 65 76 65 6c 6f 70 65 72  ..fi../Developer
2210: 2f 41 70 70 6c 69 63 61 74 69 6f 6e 73 2f 55 74  /Applications/Ut
2220: 69 6c 69 74 69 65 73 2f 50 61 63 6b 61 67 65 4d  ilities/PackageM
2230: 61 6b 65 72 2e 61 70 70 2f 43 6f 6e 74 65 6e 74  aker.app/Content
2240: 73 2f 4d 61 63 4f 53 2f 50 61 63 6b 61 67 65 4d  s/MacOS/PackageM
2250: 61 6b 65 72 20 2d 64 20 62 75 69 6c 64 2f 63 61  aker -d build/ca
2260: 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24  ckey_osx_build/$
2270: 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d  {OSX}_pmbuild.pm
2280: 64 6f 63 20 2d 6f 20 6d 61 63 62 75 69 6c 64 2f  doc -o macbuild/
2290: 70 6b 67 2f 43 41 43 4b 65 79 5f 24 7b 43 41 43  pkg/CACKey_${CAC
22a0: 4b 45 59 5f 56 45 52 53 49 4f 4e 7d 5f 24 7b 4f  KEY_VERSION}_${O
22b0: 53 58 7d 2e 24 7b 45 58 54 7d 0a 09 74 61 72 20  SX}.${EXT}..tar 
22c0: 2d 2d 63 72 65 61 74 65 20 2d 2d 64 69 72 65 63  --create --direc
22d0: 74 6f 72 79 20 6d 61 63 62 75 69 6c 64 2f 70 6b  tory macbuild/pk
22e0: 67 2f 20 2d 2d 66 69 6c 65 20 6d 61 63 62 75 69  g/ --file macbui
22f0: 6c 64 2f 70 6b 67 2f 43 41 43 4b 65 79 5f 24 7b  ld/pkg/CACKey_${
2300: 43 41 43 4b 45 59 5f 56 45 52 53 49 4f 4e 7d 5f  CACKEY_VERSION}_
2310: 24 7b 4f 53 58 7d 2e 24 7b 45 58 54 7d 2e 74 61  ${OSX}.${EXT}.ta
2320: 72 20 43 41 43 4b 65 79 5f 24 7b 43 41 43 4b 45  r CACKey_${CACKE
2330: 59 5f 56 45 52 53 49 4f 4e 7d 5f 24 7b 4f 53 58  Y_VERSION}_${OSX
2340: 7d 2e 24 7b 45 58 54 7d 0a 09 67 7a 69 70 20 2d  }.${EXT}..gzip -
2350: 39 20 6d 61 63 62 75 69 6c 64 2f 70 6b 67 2f 43  9 macbuild/pkg/C
2360: 41 43 4b 65 79 5f 24 7b 43 41 43 4b 45 59 5f 56  ACKey_${CACKEY_V
2370: 45 52 53 49 4f 4e 7d 5f 24 7b 4f 53 58 7d 2e 24  ERSION}_${OSX}.$
2380: 7b 45 58 54 7d 2e 74 61 72 0a 09 72 6d 20 2d 72  {EXT}.tar..rm -r
2390: 66 20 6d 61 63 62 75 69 6c 64 2f 70 6b 67 2f 43  f macbuild/pkg/C
23a0: 41 43 4b 65 79 5f 24 7b 43 41 43 4b 45 59 5f 56  ACKey_${CACKEY_V
23b0: 45 52 53 49 4f 4e 7d 5f 24 7b 4f 53 58 7d 2e 24  ERSION}_${OSX}.$
23c0: 7b 45 58 54 7d 0a 09 72 6d 20 2d 66 20 62 75 69  {EXT}..rm -f bui
23d0: 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75  ld/cackey_osx_bu
23e0: 69 6c 64 2f 63 61 63 6b 65 79 2e 64 79 6c 69 62  ild/cackey.dylib
23f0: 0a 09 72 6d 20 2d 72 66 20 62 75 69 6c 64 2f 63  ..rm -rf build/c
2400: 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f  ackey_osx_build/
2410: 50 4b 43 53 31 31 2e 74 6f 6b 65 6e 64 0a 09 65  PKCS11.tokend..e
2420: 63 68 6f 20 22 24 7b 4f 53 58 7d 20 62 75 69 6c  cho "${OSX} buil
2430: 64 20 63 6f 6d 70 6c 65 74 65 22 0a 7d 0a 0a 23  d complete".}..#
2440: 20 54 61 6b 65 20 63 6f 6d 6d 61 6e 64 20 6c 69   Take command li
2450: 6e 65 20 61 72 67 75 6d 65 6e 74 73 20 61 6e 64  ne arguments and
2460: 20 65 78 65 63 75 74 65 0a 63 61 73 65 20 22 24   execute.case "$
2470: 31 22 20 69 6e 0a 09 22 22 29 0a 09 09 75 73 61  1" in.."")...usa
2480: 67 65 0a 09 09 65 78 69 74 20 24 3f 0a 09 3b 3b  ge...exit $?..;;
2490: 0a 0a 09 22 6c 65 6f 70 61 72 64 22 29 0a 09 09  ..."leopard")...
24a0: 2e 2f 61 75 74 6f 67 65 6e 2e 73 68 0a 09 09 6c  ./autogen.sh...l
24b0: 65 6f 70 61 72 64 0a 09 09 65 78 69 74 20 24 3f  eopard...exit $?
24c0: 0a 09 3b 3b 0a 0a 09 22 73 6e 6f 77 6c 65 6f 70  ..;;..."snowleop
24d0: 61 72 64 22 29 0a 09 09 2e 2f 61 75 74 6f 67 65  ard")..../autoge
24e0: 6e 2e 73 68 0a 09 09 73 6e 6f 77 6c 65 6f 70 61  n.sh...snowleopa
24f0: 72 64 0a 09 09 65 78 69 74 20 24 3f 0a 09 3b 3b  rd...exit $?..;;
2500: 0a 09 0a 09 22 6c 69 6f 6e 22 29 0a 09 09 2e 2f  ...."lion")..../
2510: 61 75 74 6f 67 65 6e 2e 73 68 0a 09 09 6c 69 6f  autogen.sh...lio
2520: 6e 0a 09 09 65 78 69 74 20 24 3f 0a 09 3b 3b 0a  n...exit $?..;;.
2530: 09 0a 09 22 73 6c 74 6f 6d 6c 22 29 0a 09 09 2e  ..."sltoml")....
2540: 2f 61 75 74 6f 67 65 6e 2e 73 68 0a 09 09 73 6c  /autogen.sh...sl
2550: 74 6f 6d 6c 0a 09 09 65 78 69 74 20 24 3f 0a 09  toml...exit $?..
2560: 3b 3b 0a 0a 09 22 61 6c 6c 22 29 0a 09 09 2e 2f  ;;..."all")..../
2570: 61 75 74 6f 67 65 6e 2e 73 68 0a 09 09 6c 65 6f  autogen.sh...leo
2580: 70 61 72 64 0a 09 09 73 6c 74 6f 6d 6c 0a 09 09  pard...sltoml...
2590: 65 63 68 6f 20 22 22 0a 09 09 65 63 68 6f 20 22  echo ""...echo "
25a0: 41 6c 6c 20 62 75 69 6c 64 73 20 63 6f 6d 70 6c  All builds compl
25b0: 65 74 65 2e 22 0a 09 09 65 78 69 74 20 24 3f 0a  ete."...exit $?.
25c0: 09 3b 3b 0a 0a 09 22 63 6c 65 61 6e 22 29 0a 09  .;;..."clean")..
25d0: 09 63 6c 65 61 6e 0a 09 09 65 78 69 74 20 24 3f  .clean...exit $?
25e0: 0a 09 3b 3b 0a 0a 09 2a 29 0a 09 09 75 73 61 67  ..;;...*)...usag
25f0: 65 0a 09 09 65 78 69 74 20 24 3f 0a 09 3b 3b 0a  e...exit $?..;;.
2600: 65 73 61 63 20 0a                                esac .