Hex Artifact Content

Artifact 04fe9e319de21f4628d4e51c5a090e616fe18cc6:


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 65 74 68 2e 6c  tyne.# kenneth.l
0060: 2e 76 61 6e 61 6c 73 74 79 6e 65 40 75 73 61 63  .vanalstyne@usac
0070: 65 2e 61 72 6d 79 2e 6d 69 6c 0a 43 41 43 4b 45  e.army.mil.CACKE
0080: 59 5f 56 45 52 53 49 4f 4e 3d 60 63 61 74 20 63  Y_VERSION=`cat c
0090: 6f 6e 66 69 67 75 72 65 2e 61 63 20 7c 20 67 72  onfigure.ac | gr
00a0: 65 70 20 41 43 5f 49 4e 49 54 20 7c 20 63 75 74  ep AC_INIT | cut
00b0: 20 2d 64 20 22 20 22 20 2d 66 20 32 20 7c 20 73   -d " " -f 2 | s
00c0: 65 64 20 27 73 5f 29 5f 5f 27 60 0a 0a 23 20 43  ed 's_)__'`..# C
00d0: 68 65 63 6b 20 74 6f 20 73 65 65 20 69 66 20 77  heck to see if w
00e0: 65 27 72 65 20 62 75 69 6c 64 69 6e 67 20 6f 6e  e're building on
00f0: 20 4d 61 63 20 4f 53 20 58 20 31 30 2e 37 20 22   Mac OS X 10.7 "
0100: 4c 69 6f 6e 22 0a 69 66 20 5b 20 22 60 75 6e 61  Lion".if [ "`una
0110: 6d 65 20 2d 72 20 7c 20 63 75 74 20 2d 64 20 2e  me -r | cut -d .
0120: 20 2d 66 20 31 60 22 20 3d 20 22 31 31 22 20 5d   -f 1`" = "11" ]
0130: 3b 20 74 68 65 6e 0a 09 4c 49 4f 4e 42 55 49 4c  ; then..LIONBUIL
0140: 44 3d 31 0a 66 69 0a 0a 23 20 55 73 61 67 65 20  D=1.fi..# Usage 
0150: 66 75 6e 63 74 69 6f 6e 0a 75 73 61 67 65 28 29  function.usage()
0160: 20 7b 0a 09 65 63 68 6f 20 22 55 73 61 67 65 3a   {..echo "Usage:
0170: 20 62 75 69 6c 64 5f 6f 73 78 2e 73 68 20 3c 74   build_osx.sh <t
0180: 61 72 67 65 74 3e 22 0a 09 65 63 68 6f 20 57 68  arget>"..echo Wh
0190: 65 72 65 20 74 61 72 67 65 74 20 69 73 20 6f 6e  ere target is on
01a0: 65 20 6f 66 3a 0a 09 65 63 68 6f 20 22 20 20 20  e of:..echo "   
01b0: 20 6c 65 6f 70 61 72 64 20 20 2d 20 28 42 75 69   leopard  - (Bui
01c0: 6c 64 73 20 55 6e 69 76 65 72 73 61 6c 20 31 30  lds Universal 10
01d0: 2e 35 20 4c 69 62 72 61 72 79 20 66 6f 72 20 50  .5 Library for P
01e0: 50 43 47 34 2f 69 33 38 36 29 22 0a 09 65 63 68  PCG4/i386)"..ech
01f0: 6f 20 22 20 20 20 20 73 6e 6f 77 6c 65 6f 70 61  o "    snowleopa
0200: 72 64 20 20 2d 20 28 42 75 69 6c 64 73 20 55 6e  rd  - (Builds Un
0210: 69 76 65 72 73 61 6c 20 31 30 2e 36 20 4c 69 62  iversal 10.6 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 6c 69 6f 6e 20 20 2d 20 28 42 75 69 6c 64    lion  - (Build
0250: 73 20 55 6e 69 76 65 72 73 61 6c 20 31 30 2e 37  s Universal 10.7
0260: 20 4c 69 62 72 61 72 79 20 66 6f 72 20 69 33 38   Library for i38
0270: 36 2f 78 38 36 5f 36 34 29 22 0a 09 65 63 68 6f  6/x86_64)"..echo
0280: 20 22 20 20 20 20 73 6c 74 6f 6d 6c 20 2d 20 28   "    sltoml - (
0290: 42 75 69 6c 64 73 20 55 6e 69 76 65 72 73 61 6c  Builds Universal
02a0: 20 31 30 2e 36 2f 31 30 2e 37 2f 31 30 2e 38 20   10.6/10.7/10.8 
02b0: 4c 69 62 72 61 72 79 20 66 6f 72 20 69 33 38 36  Library for i386
02c0: 2f 78 38 36 5f 36 34 29 22 0a 09 65 63 68 6f 20  /x86_64)"..echo 
02d0: 22 20 20 20 20 61 6c 6c 20 2d 20 28 42 75 69 6c  "    all - (Buil
02e0: 64 73 20 66 6f 72 20 61 6c 6c 20 73 75 70 70 6f  ds for all suppo
02f0: 72 74 65 64 20 74 61 72 67 65 74 73 29 22 0a 09  rted targets)"..
0300: 65 63 68 6f 20 22 20 20 20 20 63 6c 65 61 6e 20  echo "    clean 
0310: 2d 20 28 43 6c 65 61 6e 73 20 75 70 29 22 0a 09  - (Cleans up)"..
0320: 65 63 68 6f 20 22 52 75 6e 20 66 72 6f 6d 20 43  echo "Run from C
0330: 41 43 4b 65 79 20 42 75 69 6c 64 20 52 6f 6f 74  ACKey Build Root
0340: 2e 22 0a 09 65 78 69 74 20 24 3f 0a 7d 0a 0a 23  ."..exit $?.}..#
0350: 20 43 6c 65 61 6e 20 75 70 20 66 75 6e 63 74 69   Clean up functi
0360: 6f 6e 0a 63 6c 65 61 6e 28 29 20 7b 0a 09 72 6d  on.clean() {..rm
0370: 20 2d 66 20 62 75 69 6c 64 2f 63 61 63 6b 65 79   -f build/cackey
0380: 5f 6f 73 78 5f 62 75 69 6c 64 2f 63 61 63 6b 65  _osx_build/cacke
0390: 79 2e 64 79 6c 69 62 0a 09 72 6d 20 2d 72 66 20  y.dylib..rm -rf 
03a0: 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78  build/cackey_osx
03b0: 5f 62 75 69 6c 64 2f 50 4b 43 53 31 31 2e 74 6f  _build/PKCS11.to
03c0: 6b 65 6e 64 0a 09 72 6d 20 2d 72 66 20 50 4b 43  kend..rm -rf PKC
03d0: 53 31 31 2e 74 6f 6b 65 6e 64 0a 09 72 6d 20 2d  S11.tokend..rm -
03e0: 72 66 20 6d 61 63 62 75 69 6c 64 0a 09 72 6d 20  rf macbuild..rm 
03f0: 2d 72 66 20 62 75 69 6c 64 2f 63 61 63 6b 65 79  -rf build/cackey
0400: 5f 6f 73 78 5f 62 75 69 6c 64 2f 2a 2e 70 6d 64  _osx_build/*.pmd
0410: 6f 63 0a 09 6d 61 6b 65 20 64 69 73 74 63 6c 65  oc..make distcle
0420: 61 6e 0a 7d 0a 0a 23 20 44 69 72 65 63 74 6f 72  an.}..# Director
0430: 79 20 63 72 65 61 74 69 6f 6e 20 66 75 6e 63 74  y creation funct
0440: 69 6f 6e 0a 6d 61 6b 65 64 69 72 28 29 20 7b 0a  ion.makedir() {.
0450: 09 69 66 20 5b 20 22 60 75 6e 61 6d 65 20 2d 72  .if [ "`uname -r
0460: 20 7c 20 63 75 74 20 2d 64 20 2e 20 2d 66 20 31   | cut -d . -f 1
0470: 60 22 20 2d 6c 74 20 22 31 30 22 20 5d 3b 20 74  `" -lt "10" ]; t
0480: 68 65 6e 0a 09 09 4c 49 42 54 4f 4f 4c 44 49 52  hen...LIBTOOLDIR
0490: 3d 2f 44 65 76 65 6c 6f 70 65 72 2f 75 73 72 2f  =/Developer/usr/
04a0: 73 68 61 72 65 2f 6c 69 62 74 6f 6f 6c 0a 09 65  share/libtool..e
04b0: 6c 73 65 0a 09 09 4c 49 42 54 4f 4f 4c 44 49 52  lse...LIBTOOLDIR
04c0: 3d 2f 44 65 76 65 6c 6f 70 65 72 2f 75 73 72 2f  =/Developer/usr/
04d0: 73 68 61 72 65 2f 6c 69 62 74 6f 6f 6c 2f 63 6f  share/libtool/co
04e0: 6e 66 69 67 0a 09 66 69 0a 09 69 66 20 5b 20 21  nfig..fi..if [ !
04f0: 20 2d 64 20 6d 61 63 62 75 69 6c 64 20 5d 3b 20   -d macbuild ]; 
0500: 74 68 65 6e 0a 09 09 6d 6b 64 69 72 20 6d 61 63  then...mkdir mac
0510: 62 75 69 6c 64 0a 09 09 6d 6b 64 69 72 20 6d 61  build...mkdir ma
0520: 63 62 75 69 6c 64 2f 4c 65 6f 70 61 72 64 0a 09  cbuild/Leopard..
0530: 09 6d 6b 64 69 72 20 6d 61 63 62 75 69 6c 64 2f  .mkdir macbuild/
0540: 53 6e 6f 77 6c 65 6f 70 61 72 64 0a 09 09 6d 6b  Snowleopard...mk
0550: 64 69 72 20 6d 61 63 62 75 69 6c 64 2f 4c 69 6f  dir macbuild/Lio
0560: 6e 0a 09 09 6d 6b 64 69 72 20 6d 61 63 62 75 69  n...mkdir macbui
0570: 6c 64 2f 53 6c 74 6f 6d 6c 0a 09 09 6d 6b 64 69  ld/Sltoml...mkdi
0580: 72 20 6d 61 63 62 75 69 6c 64 2f 70 6b 67 0a 09  r macbuild/pkg..
0590: 66 69 0a 09 69 66 20 5b 20 21 20 2d 66 20 63 6f  fi..if [ ! -f co
05a0: 6e 66 69 67 2e 67 75 65 73 73 20 5d 3b 20 74 68  nfig.guess ]; th
05b0: 65 6e 0a 09 09 63 70 20 24 7b 4c 49 42 54 4f 4f  en...cp ${LIBTOO
05c0: 4c 44 49 52 7d 2f 63 6f 6e 66 69 67 2e 67 75 65  LDIR}/config.gue
05d0: 73 73 20 2e 0a 09 66 69 0a 09 69 66 20 5b 20 21  ss ...fi..if [ !
05e0: 20 2d 66 20 63 6f 6e 66 69 67 2e 73 75 62 20 5d   -f config.sub ]
05f0: 3b 20 74 68 65 6e 0a 09 09 63 70 20 24 7b 4c 49  ; then...cp ${LI
0600: 42 54 4f 4f 4c 44 49 52 7d 2f 63 6f 6e 66 69 67  BTOOLDIR}/config
0610: 2e 73 75 62 20 2e 0a 09 66 69 0a 09 69 66 20 5b  .sub ...fi..if [
0620: 20 21 20 2d 66 20 69 6e 73 74 61 6c 6c 2d 73 68   ! -f install-sh
0630: 20 5d 3b 20 74 68 65 6e 0a 09 09 63 70 20 24 7b   ]; then...cp ${
0640: 4c 49 42 54 4f 4f 4c 44 49 52 7d 2f 69 6e 73 74  LIBTOOLDIR}/inst
0650: 61 6c 6c 2d 73 68 20 2e 0a 09 66 69 0a 7d 0a 0a  all-sh ...fi.}..
0660: 23 20 42 75 69 6c 64 20 66 75 6e 63 74 69 6f 6e  # Build function
0670: 20 66 6f 72 20 4c 65 6f 70 61 72 64 0a 6c 65 6f   for Leopard.leo
0680: 70 61 72 64 28 29 20 7b 0a 09 6d 61 6b 65 64 69  pard() {..makedi
0690: 72 0a 09 48 45 41 44 45 52 53 3d 2f 44 65 76 65  r..HEADERS=/Deve
06a0: 6c 6f 70 65 72 2f 53 44 4b 73 2f 4d 61 63 4f 53  loper/SDKs/MacOS
06b0: 58 31 30 2e 35 2e 73 64 6b 2f 53 79 73 74 65 6d  X10.5.sdk/System
06c0: 2f 4c 69 62 72 61 72 79 2f 46 72 61 6d 65 77 6f  /Library/Framewo
06d0: 72 6b 73 2f 50 43 53 43 2e 66 72 61 6d 65 77 6f  rks/PCSC.framewo
06e0: 72 6b 2f 56 65 72 73 69 6f 6e 73 2f 41 2f 48 65  rk/Versions/A/He
06f0: 61 64 65 72 73 2f 0a 09 4c 49 42 52 41 52 59 3d  aders/..LIBRARY=
0700: 2f 44 65 76 65 6c 6f 70 65 72 2f 53 44 4b 73 2f  /Developer/SDKs/
0710: 4d 61 63 4f 53 58 31 30 2e 35 2e 73 64 6b 2f 53  MacOSX10.5.sdk/S
0720: 79 73 74 65 6d 2f 4c 69 62 72 61 72 79 2f 46 72  ystem/Library/Fr
0730: 61 6d 65 77 6f 72 6b 73 2f 50 43 53 43 2e 66 72  ameworks/PCSC.fr
0740: 61 6d 65 77 6f 72 6b 2f 50 43 53 43 0a 09 4c 49  amework/PCSC..LI
0750: 42 3d 22 22 0a 09 41 52 43 48 4c 49 53 54 3d 22  B=""..ARCHLIST="
0760: 22 0a 09 44 4c 49 42 3d 22 22 0a 09 44 41 52 43  "..DLIB=""..DARC
0770: 48 4c 49 53 54 3d 22 22 0a 09 4f 53 58 3d 4c 65  HLIST=""..OSX=Le
0780: 6f 70 61 72 64 0a 09 50 4b 54 41 52 47 45 54 4f  opard..PKTARGETO
0790: 53 3d 33 0a 09 4e 45 58 54 4f 53 58 56 45 52 3d  S=3..NEXTOSXVER=
07a0: 31 30 2e 36 0a 09 43 55 52 4f 53 58 56 45 52 3d  10.6..CUROSXVER=
07b0: 31 30 2e 35 0a 09 66 6f 72 20 48 4f 53 54 20 69  10.5..for HOST i
07c0: 6e 20 70 6f 77 65 72 70 63 2d 61 70 70 6c 65 2d  n powerpc-apple-
07d0: 64 61 72 77 69 6e 39 20 69 33 38 36 2d 61 70 70  darwin9 i386-app
07e0: 6c 65 2d 64 61 72 77 69 6e 39 3b 20 64 6f 0a 09  le-darwin9; do..
07f0: 09 67 65 6e 62 75 69 6c 64 0a 09 64 6f 6e 65 0a  .genbuild..done.
0800: 09 6c 69 62 62 75 69 6c 64 0a 09 70 6b 67 62 75  .libbuild..pkgbu
0810: 69 6c 64 0a 7d 0a 0a 23 20 42 75 69 6c 64 20 66  ild.}..# Build f
0820: 75 6e 63 74 69 6f 6e 20 66 6f 72 20 53 6e 6f 77  unction for Snow
0830: 20 4c 65 6f 70 61 72 64 0a 73 6e 6f 77 6c 65 6f   Leopard.snowleo
0840: 70 61 72 64 28 29 20 7b 0a 09 6d 61 6b 65 64 69  pard() {..makedi
0850: 72 0a 09 48 45 41 44 45 52 53 3d 2f 44 65 76 65  r..HEADERS=/Deve
0860: 6c 6f 70 65 72 2f 53 44 4b 73 2f 4d 61 63 4f 53  loper/SDKs/MacOS
0870: 58 31 30 2e 36 2e 73 64 6b 2f 53 79 73 74 65 6d  X10.6.sdk/System
0880: 2f 4c 69 62 72 61 72 79 2f 46 72 61 6d 65 77 6f  /Library/Framewo
0890: 72 6b 73 2f 50 43 53 43 2e 66 72 61 6d 65 77 6f  rks/PCSC.framewo
08a0: 72 6b 2f 56 65 72 73 69 6f 6e 73 2f 41 2f 48 65  rk/Versions/A/He
08b0: 61 64 65 72 73 2f 0a 09 4c 49 42 52 41 52 59 3d  aders/..LIBRARY=
08c0: 2f 44 65 76 65 6c 6f 70 65 72 2f 53 44 4b 73 2f  /Developer/SDKs/
08d0: 4d 61 63 4f 53 58 31 30 2e 36 2e 73 64 6b 2f 53  MacOSX10.6.sdk/S
08e0: 79 73 74 65 6d 2f 4c 69 62 72 61 72 79 2f 46 72  ystem/Library/Fr
08f0: 61 6d 65 77 6f 72 6b 73 2f 50 43 53 43 2e 66 72  ameworks/PCSC.fr
0900: 61 6d 65 77 6f 72 6b 2f 50 43 53 43 0a 09 4c 49  amework/PCSC..LI
0910: 42 3d 22 22 0a 09 41 52 43 48 4c 49 53 54 3d 22  B=""..ARCHLIST="
0920: 22 0a 09 44 4c 49 42 3d 22 22 0a 09 44 41 52 43  "..DLIB=""..DARC
0930: 48 4c 49 53 54 3d 22 22 0a 09 4f 53 58 3d 53 6e  HLIST=""..OSX=Sn
0940: 6f 77 6c 65 6f 70 61 72 64 0a 09 50 4b 54 41 52  owleopard..PKTAR
0950: 47 45 54 4f 53 3d 33 0a 09 4e 45 58 54 4f 53 58  GETOS=3..NEXTOSX
0960: 56 45 52 3d 31 30 2e 37 0a 09 43 55 52 4f 53 58  VER=10.7..CUROSX
0970: 56 45 52 3d 31 30 2e 36 0a 09 66 6f 72 20 48 4f  VER=10.6..for HO
0980: 53 54 20 69 6e 20 69 33 38 36 2d 61 70 70 6c 65  ST in i386-apple
0990: 2d 64 61 72 77 69 6e 31 30 20 78 38 36 5f 36 34  -darwin10 x86_64
09a0: 2d 61 70 70 6c 65 2d 64 61 72 77 69 6e 31 30 3b  -apple-darwin10;
09b0: 20 64 6f 0a 09 09 67 65 6e 62 75 69 6c 64 0a 09   do...genbuild..
09c0: 64 6f 6e 65 0a 09 6c 69 62 62 75 69 6c 64 0a 09  done..libbuild..
09d0: 70 6b 67 62 75 69 6c 64 0a 7d 0a 0a 23 20 42 75  pkgbuild.}..# Bu
09e0: 69 6c 64 20 66 75 6e 63 74 69 6f 6e 20 66 6f 72  ild function for
09f0: 20 4c 69 6f 6e 0a 6c 69 6f 6e 28 29 20 7b 0a 09   Lion.lion() {..
0a00: 6d 61 6b 65 64 69 72 0a 09 48 45 41 44 45 52 53  makedir..HEADERS
0a10: 3d 2f 44 65 76 65 6c 6f 70 65 72 2f 53 44 4b 73  =/Developer/SDKs
0a20: 2f 4d 61 63 4f 53 58 31 30 2e 37 2e 73 64 6b 2f  /MacOSX10.7.sdk/
0a30: 53 79 73 74 65 6d 2f 4c 69 62 72 61 72 79 2f 46  System/Library/F
0a40: 72 61 6d 65 77 6f 72 6b 73 2f 50 43 53 43 2e 66  rameworks/PCSC.f
0a50: 72 61 6d 65 77 6f 72 6b 2f 56 65 72 73 69 6f 6e  ramework/Version
0a60: 73 2f 41 2f 48 65 61 64 65 72 73 2f 0a 09 4c 49  s/A/Headers/..LI
0a70: 42 52 41 52 59 3d 2f 44 65 76 65 6c 6f 70 65 72  BRARY=/Developer
0a80: 2f 53 44 4b 73 2f 4d 61 63 4f 53 58 31 30 2e 37  /SDKs/MacOSX10.7
0a90: 2e 73 64 6b 2f 53 79 73 74 65 6d 2f 4c 69 62 72  .sdk/System/Libr
0aa0: 61 72 79 2f 46 72 61 6d 65 77 6f 72 6b 73 2f 50  ary/Frameworks/P
0ab0: 43 53 43 2e 66 72 61 6d 65 77 6f 72 6b 2f 50 43  CSC.framework/PC
0ac0: 53 43 0a 09 4c 49 42 3d 22 22 0a 09 41 52 43 48  SC..LIB=""..ARCH
0ad0: 4c 49 53 54 3d 22 22 0a 09 44 4c 49 42 3d 22 22  LIST=""..DLIB=""
0ae0: 0a 09 44 41 52 43 48 4c 49 53 54 3d 22 22 0a 09  ..DARCHLIST=""..
0af0: 4f 53 58 3d 4c 69 6f 6e 0a 09 50 4b 54 41 52 47  OSX=Lion..PKTARG
0b00: 45 54 4f 53 3d 33 0a 09 4e 45 58 54 4f 53 58 56  ETOS=3..NEXTOSXV
0b10: 45 52 3d 31 30 2e 38 0a 09 43 55 52 4f 53 58 56  ER=10.8..CUROSXV
0b20: 45 52 3d 31 30 2e 37 0a 09 66 6f 72 20 48 4f 53  ER=10.7..for HOS
0b30: 54 20 69 6e 20 69 33 38 36 2d 61 70 70 6c 65 2d  T in i386-apple-
0b40: 64 61 72 77 69 6e 31 31 20 78 38 36 5f 36 34 2d  darwin11 x86_64-
0b50: 61 70 70 6c 65 2d 64 61 72 77 69 6e 31 31 3b 20  apple-darwin11; 
0b60: 64 6f 0a 09 09 67 65 6e 62 75 69 6c 64 0a 09 64  do...genbuild..d
0b70: 6f 6e 65 0a 09 6c 69 62 62 75 69 6c 64 0a 09 70  one..libbuild..p
0b80: 6b 67 62 75 69 6c 64 0a 7d 0a 0a 23 20 42 75 69  kgbuild.}..# Bui
0b90: 6c 64 20 66 75 6e 63 74 69 6f 6e 20 66 6f 72 20  ld function for 
0ba0: 53 6e 6f 77 20 4c 65 6f 70 61 72 64 2f 4c 69 6f  Snow Leopard/Lio
0bb0: 6e 2f 4d 6f 75 6e 74 61 69 6e 20 4c 69 6f 6e 0a  n/Mountain Lion.
0bc0: 73 6c 74 6f 6d 6c 28 29 20 7b 0a 09 6d 61 6b 65  sltoml() {..make
0bd0: 64 69 72 0a 09 48 45 41 44 45 52 53 3d 2f 44 65  dir..HEADERS=/De
0be0: 76 65 6c 6f 70 65 72 2f 53 44 4b 73 2f 4d 61 63  veloper/SDKs/Mac
0bf0: 4f 53 58 31 30 2e 36 2e 73 64 6b 2f 53 79 73 74  OSX10.6.sdk/Syst
0c00: 65 6d 2f 4c 69 62 72 61 72 79 2f 46 72 61 6d 65  em/Library/Frame
0c10: 77 6f 72 6b 73 2f 50 43 53 43 2e 66 72 61 6d 65  works/PCSC.frame
0c20: 77 6f 72 6b 2f 56 65 72 73 69 6f 6e 73 2f 41 2f  work/Versions/A/
0c30: 48 65 61 64 65 72 73 2f 0a 09 4c 49 42 52 41 52  Headers/..LIBRAR
0c40: 59 3d 2f 44 65 76 65 6c 6f 70 65 72 2f 53 44 4b  Y=/Developer/SDK
0c50: 73 2f 4d 61 63 4f 53 58 31 30 2e 36 2e 73 64 6b  s/MacOSX10.6.sdk
0c60: 2f 53 79 73 74 65 6d 2f 4c 69 62 72 61 72 79 2f  /System/Library/
0c70: 46 72 61 6d 65 77 6f 72 6b 73 2f 50 43 53 43 2e  Frameworks/PCSC.
0c80: 66 72 61 6d 65 77 6f 72 6b 2f 50 43 53 43 0a 09  framework/PCSC..
0c90: 4c 49 42 3d 22 22 0a 09 41 52 43 48 4c 49 53 54  LIB=""..ARCHLIST
0ca0: 3d 22 22 0a 09 44 4c 49 42 3d 22 22 0a 09 44 41  =""..DLIB=""..DA
0cb0: 52 43 48 4c 49 53 54 3d 22 22 0a 09 4f 53 58 3d  RCHLIST=""..OSX=
0cc0: 53 6c 74 6f 6d 6c 0a 09 50 4b 54 41 52 47 45 54  Sltoml..PKTARGET
0cd0: 4f 53 3d 33 0a 09 4e 45 58 54 4f 53 58 56 45 52  OS=3..NEXTOSXVER
0ce0: 3d 31 30 2e 39 0a 09 43 55 52 4f 53 58 56 45 52  =10.9..CUROSXVER
0cf0: 3d 31 30 2e 36 0a 09 66 6f 72 20 48 4f 53 54 20  =10.6..for HOST 
0d00: 69 6e 20 69 33 38 36 2d 61 70 70 6c 65 2d 64 61  in i386-apple-da
0d10: 72 77 69 6e 31 30 20 78 38 36 5f 36 34 2d 61 70  rwin10 x86_64-ap
0d20: 70 6c 65 2d 64 61 72 77 69 6e 31 30 3b 20 64 6f  ple-darwin10; do
0d30: 0a 09 09 67 65 6e 62 75 69 6c 64 0a 09 64 6f 6e  ...genbuild..don
0d40: 65 0a 09 6c 69 62 62 75 69 6c 64 0a 09 70 6b 67  e..libbuild..pkg
0d50: 62 75 69 6c 64 0a 7d 0a 0a 23 20 42 75 69 6c 64  build.}..# Build
0d60: 20 66 75 6e 63 74 69 6f 6e 20 66 6f 72 20 53 6e   function for Sn
0d70: 6f 77 20 4c 65 6f 70 61 72 64 2f 4c 69 6f 6e 2f  ow Leopard/Lion/
0d80: 4d 6f 75 6e 74 61 69 6e 20 4c 69 6f 6e 0a 73 6c  Mountain Lion.sl
0d90: 74 6f 6d 6c 28 29 20 7b 0a 09 6d 61 6b 65 64 69  toml() {..makedi
0da0: 72 0a 09 48 45 41 44 45 52 53 3d 2f 44 65 76 65  r..HEADERS=/Deve
0db0: 6c 6f 70 65 72 2f 53 44 4b 73 2f 4d 61 63 4f 53  loper/SDKs/MacOS
0dc0: 58 31 30 2e 36 2e 73 64 6b 2f 53 79 73 74 65 6d  X10.6.sdk/System
0dd0: 2f 4c 69 62 72 61 72 79 2f 46 72 61 6d 65 77 6f  /Library/Framewo
0de0: 72 6b 73 2f 50 43 53 43 2e 66 72 61 6d 65 77 6f  rks/PCSC.framewo
0df0: 72 6b 2f 56 65 72 73 69 6f 6e 73 2f 41 2f 48 65  rk/Versions/A/He
0e00: 61 64 65 72 73 2f 0a 09 4c 49 42 52 41 52 59 3d  aders/..LIBRARY=
0e10: 2f 44 65 76 65 6c 6f 70 65 72 2f 53 44 4b 73 2f  /Developer/SDKs/
0e20: 4d 61 63 4f 53 58 31 30 2e 36 2e 73 64 6b 2f 53  MacOSX10.6.sdk/S
0e30: 79 73 74 65 6d 2f 4c 69 62 72 61 72 79 2f 46 72  ystem/Library/Fr
0e40: 61 6d 65 77 6f 72 6b 73 2f 50 43 53 43 2e 66 72  ameworks/PCSC.fr
0e50: 61 6d 65 77 6f 72 6b 2f 50 43 53 43 0a 09 4c 49  amework/PCSC..LI
0e60: 42 3d 22 22 0a 09 41 52 43 48 4c 49 53 54 3d 22  B=""..ARCHLIST="
0e70: 22 0a 09 44 4c 49 42 3d 22 22 0a 09 44 41 52 43  "..DLIB=""..DARC
0e80: 48 4c 49 53 54 3d 22 22 0a 09 4f 53 58 3d 53 6c  HLIST=""..OSX=Sl
0e90: 74 6f 6d 6c 0a 09 50 4b 54 41 52 47 45 54 4f 53  toml..PKTARGETOS
0ea0: 3d 33 0a 09 4e 45 58 54 4f 53 58 56 45 52 3d 31  =3..NEXTOSXVER=1
0eb0: 30 2e 39 0a 09 43 55 52 4f 53 58 56 45 52 3d 31  0.9..CUROSXVER=1
0ec0: 30 2e 36 0a 09 66 6f 72 20 48 4f 53 54 20 69 6e  0.6..for HOST in
0ed0: 20 69 33 38 36 2d 61 70 70 6c 65 2d 64 61 72 77   i386-apple-darw
0ee0: 69 6e 31 30 20 78 38 36 5f 36 34 2d 61 70 70 6c  in10 x86_64-appl
0ef0: 65 2d 64 61 72 77 69 6e 31 30 3b 20 64 6f 0a 09  e-darwin10; do..
0f00: 09 67 65 6e 62 75 69 6c 64 0a 09 64 6f 6e 65 0a  .genbuild..done.
0f10: 09 6c 69 62 62 75 69 6c 64 0a 09 70 6b 67 62 75  .libbuild..pkgbu
0f20: 69 6c 64 0a 7d 0a 0a 23 20 47 65 6e 65 72 69 63  ild.}..# Generic
0f30: 20 62 75 69 6c 64 20 66 75 6e 63 74 69 6f 6e 0a   build function.
0f40: 67 65 6e 62 75 69 6c 64 28 29 20 7b 0a 09 6d 61  genbuild() {..ma
0f50: 6b 65 20 64 69 73 74 63 6c 65 61 6e 0a 09 41 52  ke distclean..AR
0f60: 43 48 3d 60 65 63 68 6f 20 24 7b 48 4f 53 54 7d  CH=`echo ${HOST}
0f70: 20 7c 20 63 75 74 20 2d 64 20 22 2d 22 20 2d 66   | cut -d "-" -f
0f80: 20 31 60 0a 09 69 66 20 5b 20 24 7b 41 52 43 48   1`..if [ ${ARCH
0f90: 7d 20 3d 3d 20 22 70 6f 77 65 72 70 63 22 20 5d  } == "powerpc" ]
0fa0: 3b 20 74 68 65 6e 0a 09 09 69 66 20 5b 20 24 7b  ; then...if [ ${
0fb0: 4f 53 58 7d 20 3d 3d 20 22 4c 65 6f 70 61 72 64  OSX} == "Leopard
0fc0: 22 20 5d 3b 20 74 68 65 6e 0a 09 09 09 41 52 43  " ]; then....ARC
0fd0: 48 3d 22 70 70 63 20 2d 6d 63 70 75 3d 47 34 22  H="ppc -mcpu=G4"
0fe0: 0a 09 09 65 6c 73 65 0a 09 09 09 41 52 43 48 3d  ...else....ARCH=
0ff0: 22 70 70 63 20 2d 6d 63 70 75 3d 47 33 22 0a 09  "ppc -mcpu=G3"..
1000: 09 66 69 0a 09 66 69 0a 09 69 66 20 5b 20 22 24  .fi..fi..if [ "$
1010: 7b 4c 49 4f 4e 42 55 49 4c 44 7d 22 20 3d 20 31  {LIONBUILD}" = 1
1020: 20 5d 3b 20 74 68 65 6e 0a 09 09 69 66 20 5b 20   ]; then...if [ 
1030: 22 24 7b 41 52 43 48 7d 22 20 3d 3d 20 22 70 70  "${ARCH}" == "pp
1040: 63 20 2d 6d 63 70 75 3d 47 34 22 20 5d 3b 20 74  c -mcpu=G4" ]; t
1050: 68 65 6e 0a 09 09 09 43 43 3d 70 6f 77 65 72 70  hen....CC=powerp
1060: 63 2d 61 70 70 6c 65 2d 64 61 72 77 69 6e 31 31  c-apple-darwin11
1070: 2d 67 63 63 2d 34 2e 32 2e 31 20 43 50 50 3d 70  -gcc-4.2.1 CPP=p
1080: 6f 77 65 72 70 63 2d 61 70 70 6c 65 2d 64 61 72  owerpc-apple-dar
1090: 77 69 6e 31 31 2d 63 70 70 2d 34 2e 32 2e 31 20  win11-cpp-4.2.1 
10a0: 43 46 4c 41 47 53 3d 22 2d 6d 33 32 20 2d 49 2f  CFLAGS="-m32 -I/
10b0: 44 65 76 65 6c 6f 70 65 72 2f 50 6c 61 74 66 6f  Developer/Platfo
10c0: 72 6d 73 2f 69 50 68 6f 6e 65 4f 53 2e 70 6c 61  rms/iPhoneOS.pla
10d0: 74 66 6f 72 6d 2f 44 65 76 65 6c 6f 70 65 72 2f  tform/Developer/
10e0: 75 73 72 2f 6c 69 62 2f 67 63 63 2f 70 6f 77 65  usr/lib/gcc/powe
10f0: 72 70 63 2d 61 70 70 6c 65 2d 64 61 72 77 69 6e  rpc-apple-darwin
1100: 31 30 2f 34 2e 32 2e 31 2f 69 6e 63 6c 75 64 65  10/4.2.1/include
1110: 20 2d 69 73 79 73 72 6f 6f 74 20 2f 44 65 76 65   -isysroot /Deve
1120: 6c 6f 70 65 72 2f 53 44 4b 73 2f 4d 61 63 4f 53  loper/SDKs/MacOS
1130: 58 31 30 2e 35 2e 73 64 6b 22 20 43 50 50 46 4c  X10.5.sdk" CPPFL
1140: 41 47 53 3d 22 2d 44 5f 4c 49 42 43 5f 4c 49 4d  AGS="-D_LIBC_LIM
1150: 49 54 53 5f 48 5f 22 20 2e 2f 63 6f 6e 66 69 67  ITS_H_" ./config
1160: 75 72 65 20 2d 2d 77 69 74 68 2d 70 63 73 63 2d  ure --with-pcsc-
1170: 68 65 61 64 65 72 73 3d 24 7b 48 45 41 44 45 52  headers=${HEADER
1180: 53 7d 20 2d 2d 77 69 74 68 2d 70 63 73 63 2d 6c  S} --with-pcsc-l
1190: 69 62 73 3d 24 7b 4c 49 42 52 41 52 59 7d 20 2d  ibs=${LIBRARY} -
11a0: 2d 68 6f 73 74 3d 24 7b 48 4f 53 54 7d 20 2d 2d  -host=${HOST} --
11b0: 65 6e 61 62 6c 65 2d 64 6f 64 2d 63 65 72 74 73  enable-dod-certs
11c0: 2d 6f 6e 2d 68 77 2d 73 6c 6f 74 73 0a 09 09 65  -on-hw-slots...e
11d0: 6c 73 65 0a 09 09 09 43 46 4c 41 47 53 3d 22 2d  lse....CFLAGS="-
11e0: 61 72 63 68 20 24 7b 41 52 43 48 7d 22 20 2e 2f  arch ${ARCH}" ./
11f0: 63 6f 6e 66 69 67 75 72 65 20 2d 2d 77 69 74 68  configure --with
1200: 2d 70 63 73 63 2d 68 65 61 64 65 72 73 3d 24 7b  -pcsc-headers=${
1210: 48 45 41 44 45 52 53 7d 20 2d 2d 77 69 74 68 2d  HEADERS} --with-
1220: 70 63 73 63 2d 6c 69 62 73 3d 24 7b 4c 49 42 52  pcsc-libs=${LIBR
1230: 41 52 59 7d 20 2d 2d 68 6f 73 74 3d 24 7b 48 4f  ARY} --host=${HO
1240: 53 54 7d 20 2d 2d 65 6e 61 62 6c 65 2d 64 6f 64  ST} --enable-dod
1250: 2d 63 65 72 74 73 2d 6f 6e 2d 68 77 2d 73 6c 6f  -certs-on-hw-slo
1260: 74 73 0a 09 09 66 69 0a 09 65 6c 73 65 0a 09 09  ts...fi..else...
1270: 43 46 4c 41 47 53 3d 22 2d 61 72 63 68 20 24 7b  CFLAGS="-arch ${
1280: 41 52 43 48 7d 22 20 2e 2f 63 6f 6e 66 69 67 75  ARCH}" ./configu
1290: 72 65 20 2d 2d 77 69 74 68 2d 70 63 73 63 2d 68  re --with-pcsc-h
12a0: 65 61 64 65 72 73 3d 24 7b 48 45 41 44 45 52 53  eaders=${HEADERS
12b0: 7d 20 2d 2d 77 69 74 68 2d 70 63 73 63 2d 6c 69  } --with-pcsc-li
12c0: 62 73 3d 24 7b 4c 49 42 52 41 52 59 7d 20 2d 2d  bs=${LIBRARY} --
12d0: 68 6f 73 74 3d 24 7b 48 4f 53 54 7d 20 2d 2d 65  host=${HOST} --e
12e0: 6e 61 62 6c 65 2d 64 6f 64 2d 63 65 72 74 73 2d  nable-dod-certs-
12f0: 6f 6e 2d 68 77 2d 73 6c 6f 74 73 0a 09 66 69 0a  on-hw-slots..fi.
1300: 09 6d 61 6b 65 0a 09 63 70 20 6c 69 62 63 61 63  .make..cp libcac
1310: 6b 65 79 2e 64 79 6c 69 62 20 6d 61 63 62 75 69  key.dylib macbui
1320: 6c 64 2f 24 7b 4f 53 58 7d 2f 6c 69 62 63 61 63  ld/${OSX}/libcac
1330: 6b 65 79 2e 64 79 6c 69 62 2e 60 65 63 68 6f 20  key.dylib.`echo 
1340: 24 7b 41 52 43 48 7d 20 7c 20 63 75 74 20 2d 64  ${ARCH} | cut -d
1350: 20 27 20 27 20 2d 66 20 31 60 0a 09 63 70 20 6c   ' ' -f 1`..cp l
1360: 69 62 63 61 63 6b 65 79 5f 67 2e 64 79 6c 69 62  ibcackey_g.dylib
1370: 20 6d 61 63 62 75 69 6c 64 2f 24 7b 4f 53 58 7d   macbuild/${OSX}
1380: 2f 6c 69 62 63 61 63 6b 65 79 5f 67 2e 64 79 6c  /libcackey_g.dyl
1390: 69 62 2e 60 65 63 68 6f 20 24 7b 41 52 43 48 7d  ib.`echo ${ARCH}
13a0: 20 7c 20 63 75 74 20 2d 64 20 27 20 27 20 2d 66   | cut -d ' ' -f
13b0: 20 31 60 20 0a 7d 0a 0a 23 20 4c 69 62 72 61 72   1` .}..# Librar
13c0: 79 20 62 75 69 6c 64 20 66 75 6e 63 74 69 6f 6e  y build function
13d0: 0a 6c 69 62 62 75 69 6c 64 28 29 20 7b 0a 09 66  .libbuild() {..f
13e0: 6f 72 20 4c 49 42 20 69 6e 20 6d 61 63 62 75 69  or LIB in macbui
13f0: 6c 64 2f 24 7b 4f 53 58 7d 2f 6c 69 62 63 61 63  ld/${OSX}/libcac
1400: 6b 65 79 2e 64 79 6c 69 62 2e 2a 3b 20 64 6f 0a  key.dylib.*; do.
1410: 09 09 41 52 43 48 4c 49 53 54 3d 22 24 7b 41 52  ..ARCHLIST="${AR
1420: 43 48 4c 49 53 54 7d 20 60 65 63 68 6f 20 27 2d  CHLIST} `echo '-
1430: 61 72 63 68 20 27 60 20 60 65 63 68 6f 20 24 7b  arch '` `echo ${
1440: 4c 49 42 7d 20 7c 20 63 75 74 20 2d 64 20 2e 20  LIB} | cut -d . 
1450: 2d 66 20 33 60 20 60 65 63 68 6f 20 27 20 27 60  -f 3` `echo ' '`
1460: 20 60 65 63 68 6f 20 24 7b 4c 49 42 7d 60 22 0a   `echo ${LIB}`".
1470: 09 64 6f 6e 65 0a 09 6c 69 70 6f 20 2d 63 72 65  .done..lipo -cre
1480: 61 74 65 20 24 7b 41 52 43 48 4c 49 53 54 7d 20  ate ${ARCHLIST} 
1490: 2d 6f 75 74 70 75 74 20 6d 61 63 62 75 69 6c 64  -output macbuild
14a0: 2f 24 7b 4f 53 58 7d 2f 6c 69 62 63 61 63 6b 65  /${OSX}/libcacke
14b0: 79 2e 64 79 6c 69 62 0a 09 66 6f 72 20 44 4c 49  y.dylib..for DLI
14c0: 42 20 69 6e 20 6d 61 63 62 75 69 6c 64 2f 24 7b  B in macbuild/${
14d0: 4f 53 58 7d 2f 6c 69 62 63 61 63 6b 65 79 5f 67  OSX}/libcackey_g
14e0: 2e 64 79 6c 69 62 2e 2a 3b 20 64 6f 0a 09 09 44  .dylib.*; do...D
14f0: 41 52 43 48 4c 49 53 54 3d 22 24 7b 44 41 52 43  ARCHLIST="${DARC
1500: 48 4c 49 53 54 7d 20 60 65 63 68 6f 20 27 2d 61  HLIST} `echo '-a
1510: 72 63 68 20 27 60 20 60 65 63 68 6f 20 24 7b 44  rch '` `echo ${D
1520: 4c 49 42 7d 20 7c 20 63 75 74 20 2d 64 20 2e 20  LIB} | cut -d . 
1530: 2d 66 20 33 60 20 60 65 63 68 6f 20 27 20 27 60  -f 3` `echo ' '`
1540: 20 60 65 63 68 6f 20 24 7b 44 4c 49 42 7d 60 22   `echo ${DLIB}`"
1550: 0a 09 64 6f 6e 65 0a 09 6c 69 70 6f 20 2d 63 72  ..done..lipo -cr
1560: 65 61 74 65 20 24 7b 44 41 52 43 48 4c 49 53 54  eate ${DARCHLIST
1570: 7d 20 2d 6f 75 74 70 75 74 20 6d 61 63 62 75 69  } -output macbui
1580: 6c 64 2f 24 7b 4f 53 58 7d 2f 6c 69 62 63 61 63  ld/${OSX}/libcac
1590: 6b 65 79 5f 67 2e 64 79 6c 69 62 0a 09 72 6d 20  key_g.dylib..rm 
15a0: 6d 61 63 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 2f  macbuild/${OSX}/
15b0: 6c 69 62 63 61 63 6b 65 79 2a 2e 64 79 6c 69 62  libcackey*.dylib
15c0: 2e 2a 0a 7d 0a 0a 23 20 46 75 6e 63 74 69 6f 6e  .*.}..# Function
15d0: 20 74 6f 20 62 75 69 6c 64 20 4d 61 63 20 4f 53   to build Mac OS
15e0: 20 58 20 50 61 63 6b 61 67 65 73 0a 70 6b 67 62   X Packages.pkgb
15f0: 75 69 6c 64 28 29 20 7b 0a 09 69 66 20 5b 20 22  uild() {..if [ "
1600: 60 75 6e 61 6d 65 20 2d 72 20 7c 20 63 75 74 20  `uname -r | cut 
1610: 2d 64 20 2e 20 2d 66 20 31 60 22 20 2d 6c 74 20  -d . -f 1`" -lt 
1620: 22 31 30 22 20 5d 3b 20 74 68 65 6e 0a 09 09 4c  "10" ]; then...L
1630: 49 42 43 41 43 4b 45 59 47 3d 6c 69 62 63 61 63  IBCACKEYG=libcac
1640: 6b 65 79 67 2e 70 6b 67 0a 09 65 6c 73 65 0a 09  keyg.pkg..else..
1650: 09 4c 49 42 43 41 43 4b 45 59 47 3d 6c 69 62 63  .LIBCACKEYG=libc
1660: 61 63 6b 65 79 5f 67 2e 70 6b 67 0a 09 66 69 0a  ackey_g.pkg..fi.
1670: 09 72 6d 20 2d 66 20 62 75 69 6c 64 2f 63 61 63  .rm -f build/cac
1680: 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 63 61  key_osx_build/ca
1690: 63 6b 65 79 2e 64 79 6c 69 62 0a 09 6c 6e 20 6d  ckey.dylib..ln m
16a0: 61 63 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 2f 6c  acbuild/${OSX}/l
16b0: 69 62 63 61 63 6b 65 79 2e 64 79 6c 69 62 20 62  ibcackey.dylib b
16c0: 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f  uild/cackey_osx_
16d0: 62 75 69 6c 64 2f 63 61 63 6b 65 79 2e 64 79 6c  build/cackey.dyl
16e0: 69 62 0a 09 72 6d 20 2d 72 66 20 62 75 69 6c 64  ib..rm -rf build
16f0: 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c  /cackey_osx_buil
1700: 64 2f 50 4b 43 53 31 31 2e 74 6f 6b 65 6e 64 0a  d/PKCS11.tokend.
1710: 09 69 66 20 5b 20 22 24 7b 4c 49 4f 4e 42 55 49  .if [ "${LIONBUI
1720: 4c 44 7d 22 20 3d 20 31 20 5d 3b 20 74 68 65 6e  LD}" = 1 ]; then
1730: 0a 09 09 54 41 52 3d 67 6e 75 74 61 72 0a 09 65  ...TAR=gnutar..e
1740: 6c 73 65 0a 09 09 54 41 52 3d 74 61 72 0a 09 66  lse...TAR=tar..f
1750: 69 0a 09 69 66 20 5b 20 22 24 7b 4f 53 58 7d 22  i..if [ "${OSX}"
1760: 20 3d 20 22 4c 65 6f 70 61 72 64 22 20 5d 3b 20   = "Leopard" ]; 
1770: 74 68 65 6e 0a 09 09 63 75 72 6c 20 68 74 74 70  then...curl http
1780: 3a 2f 2f 64 65 76 65 6c 2e 6b 76 61 6e 61 6c 73  ://devel.kvanals
1790: 2e 6f 72 67 2f 50 4b 43 53 31 31 5f 54 6f 6b 65  .org/PKCS11_Toke
17a0: 6e 64 2f 50 4b 43 53 31 31 5f 74 6f 6b 65 6e 64  nd/PKCS11_tokend
17b0: 2d 6c 61 74 65 73 74 2e 74 61 72 2e 67 7a 20 7c  -latest.tar.gz |
17c0: 20 24 7b 54 41 52 7d 20 2d 2d 73 74 72 69 70 2d   ${TAR} --strip-
17d0: 63 6f 6d 70 6f 6e 65 6e 74 73 20 33 20 2d 2d 77  components 3 --w
17e0: 69 6c 64 63 61 72 64 73 20 2d 78 20 2d 7a 20 2d  ildcards -x -z -
17f0: 66 20 2d 20 22 50 4b 43 53 31 31 5f 74 6f 6b 65  f - "PKCS11_toke
1800: 6e 64 2d 2a 2f 70 72 65 62 75 69 6c 74 2f 6c 65  nd-*/prebuilt/le
1810: 6f 70 61 72 64 2f 50 4b 43 53 31 31 2e 74 6f 6b  opard/PKCS11.tok
1820: 65 6e 64 22 0a 09 09 6d 76 20 50 4b 43 53 31 31  end"...mv PKCS11
1830: 2e 74 6f 6b 65 6e 64 20 62 75 69 6c 64 2f 63 61  .tokend build/ca
1840: 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 50  ckey_osx_build/P
1850: 4b 43 53 31 31 2e 74 6f 6b 65 6e 64 0a 09 65 6c  KCS11.tokend..el
1860: 73 65 0a 09 09 63 75 72 6c 20 68 74 74 70 3a 2f  se...curl http:/
1870: 2f 64 65 76 65 6c 2e 6b 76 61 6e 61 6c 73 2e 6f  /devel.kvanals.o
1880: 72 67 2f 50 4b 43 53 31 31 5f 54 6f 6b 65 6e 64  rg/PKCS11_Tokend
1890: 2f 50 4b 43 53 31 31 5f 74 6f 6b 65 6e 64 2d 6c  /PKCS11_tokend-l
18a0: 61 74 65 73 74 2e 74 61 72 2e 67 7a 20 7c 20 24  atest.tar.gz | $
18b0: 7b 54 41 52 7d 20 2d 2d 73 74 72 69 70 2d 63 6f  {TAR} --strip-co
18c0: 6d 70 6f 6e 65 6e 74 73 20 33 20 2d 2d 77 69 6c  mponents 3 --wil
18d0: 64 63 61 72 64 73 20 2d 78 20 2d 7a 20 2d 66 20  dcards -x -z -f 
18e0: 2d 20 22 50 4b 43 53 31 31 5f 74 6f 6b 65 6e 64  - "PKCS11_tokend
18f0: 2d 2a 2f 70 72 65 62 75 69 6c 74 2f 73 6e 6f 77  -*/prebuilt/snow
1900: 6c 65 6f 70 61 72 64 2f 50 4b 43 53 31 31 2e 74  leopard/PKCS11.t
1910: 6f 6b 65 6e 64 22 0a 09 09 6d 76 20 50 4b 43 53  okend"...mv PKCS
1920: 31 31 2e 74 6f 6b 65 6e 64 20 62 75 69 6c 64 2f  11.tokend build/
1930: 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64  cackey_osx_build
1940: 2f 50 4b 43 53 31 31 2e 74 6f 6b 65 6e 64 0a 09  /PKCS11.tokend..
1950: 66 69 0a 09 66 6f 72 20 50 4d 44 4f 43 20 69 6e  fi..for PMDOC in
1960: 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73   build/cackey_os
1970: 78 5f 62 75 69 6c 64 2f 54 65 6d 70 6c 61 74 65  x_build/Template
1980: 5f 70 6d 62 75 69 6c 64 2f 2a 2e 69 6e 3b 20 64  _pmbuild/*.in; d
1990: 6f 0a 09 09 50 4d 44 4f 43 3d 22 60 65 63 68 6f  o...PMDOC="`echo
19a0: 20 22 24 7b 50 4d 44 4f 43 7d 22 20 7c 20 73 65   "${PMDOC}" | se
19b0: 64 20 27 73 7c 6c 2e 69 6e 7c 6c 7c 67 27 20 7c  d 's|l.in|l|g' |
19c0: 20 73 65 64 20 27 73 7c 62 75 69 6c 64 2f 63 61   sed 's|build/ca
19d0: 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 54  ckey_osx_build/T
19e0: 65 6d 70 6c 61 74 65 5f 70 6d 62 75 69 6c 64 2f  emplate_pmbuild/
19f0: 7c 7c 67 27 60 22 0a 09 09 55 55 49 44 3d 22 60  ||g'`"...UUID="`
1a00: 70 79 74 68 6f 6e 20 2d 63 20 27 69 6d 70 6f 72  python -c 'impor
1a10: 74 20 75 75 69 64 3b 20 70 72 69 6e 74 20 75 75  t uuid; print uu
1a20: 69 64 2e 75 75 69 64 31 28 29 27 20 7c 20 64 64  id.uuid1()' | dd
1a30: 20 63 6f 6e 76 3d 75 63 61 73 65 20 32 3e 2f 64   conv=ucase 2>/d
1a40: 65 76 2f 6e 75 6c 6c 60 22 0a 09 09 6d 6b 64 69  ev/null`"...mkdi
1a50: 72 20 2d 70 20 62 75 69 6c 64 2f 63 61 63 6b 65  r -p build/cacke
1a60: 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53  y_osx_build/${OS
1a70: 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63  X}_pmbuild.pmdoc
1a80: 0a 09 09 73 65 64 20 22 73 7c 40 40 42 55 49 4c  ...sed "s|@@BUIL
1a90: 44 52 4f 4f 54 44 49 52 40 40 7c 24 28 70 77 64  DROOTDIR@@|$(pwd
1aa0: 29 7c 67 22 20 62 75 69 6c 64 2f 63 61 63 6b 65  )|g" build/cacke
1ab0: 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 54 65 6d 70  y_osx_build/Temp
1ac0: 6c 61 74 65 5f 70 6d 62 75 69 6c 64 2f 24 7b 50  late_pmbuild/${P
1ad0: 4d 44 4f 43 7d 2e 69 6e 20 3e 20 62 75 69 6c 64  MDOC}.in > build
1ae0: 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c  /cackey_osx_buil
1af0: 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64  d/${OSX}_pmbuild
1b00: 2e 70 6d 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d 0a  .pmdoc/${PMDOC}.
1b10: 09 09 73 65 64 20 22 73 7c 40 40 4f 53 58 56 45  ..sed "s|@@OSXVE
1b20: 52 53 49 4f 4e 40 40 7c 24 7b 4f 53 58 7d 7c 67  RSION@@|${OSX}|g
1b30: 22 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f  " build/cackey_o
1b40: 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f  sx_build/${OSX}_
1b50: 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f 24 7b  pmbuild.pmdoc/${
1b60: 50 4d 44 4f 43 7d 20 3e 20 62 75 69 6c 64 2f 63  PMDOC} > build/c
1b70: 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f  ackey_osx_build/
1b80: 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70  ${OSX}_pmbuild.p
1b90: 6d 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d 2e 31 0a  mdoc/${PMDOC}.1.
1ba0: 09 09 73 65 64 20 22 73 7c 40 40 55 55 49 44 40  ..sed "s|@@UUID@
1bb0: 40 7c 24 7b 55 55 49 44 7d 7c 67 22 20 62 75 69  @|${UUID}|g" bui
1bc0: 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75  ld/cackey_osx_bu
1bd0: 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69  ild/${OSX}_pmbui
1be0: 6c 64 2e 70 6d 64 6f 63 2f 24 7b 50 4d 44 4f 43  ld.pmdoc/${PMDOC
1bf0: 7d 2e 31 20 3e 20 62 75 69 6c 64 2f 63 61 63 6b  }.1 > build/cack
1c00: 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f  ey_osx_build/${O
1c10: 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f  SX}_pmbuild.pmdo
1c20: 63 2f 24 7b 50 4d 44 4f 43 7d 0a 09 09 73 65 64  c/${PMDOC}...sed
1c30: 20 22 73 7c 40 40 54 41 52 47 45 54 4f 53 40 40   "s|@@TARGETOS@@
1c40: 7c 24 7b 50 4b 54 41 52 47 45 54 4f 53 7d 7c 67  |${PKTARGETOS}|g
1c50: 22 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f  " build/cackey_o
1c60: 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f  sx_build/${OSX}_
1c70: 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f 24 7b  pmbuild.pmdoc/${
1c80: 50 4d 44 4f 43 7d 20 3e 20 62 75 69 6c 64 2f 63  PMDOC} > build/c
1c90: 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f  ackey_osx_build/
1ca0: 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70  ${OSX}_pmbuild.p
1cb0: 6d 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d 2e 31 0a  mdoc/${PMDOC}.1.
1cc0: 09 09 73 65 64 20 22 73 7c 40 40 4e 45 58 54 4f  ..sed "s|@@NEXTO
1cd0: 53 58 56 45 52 40 40 7c 24 7b 4e 45 58 54 4f 53  SXVER@@|${NEXTOS
1ce0: 58 56 45 52 7d 7c 67 22 20 62 75 69 6c 64 2f 63  XVER}|g" build/c
1cf0: 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f  ackey_osx_build/
1d00: 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70  ${OSX}_pmbuild.p
1d10: 6d 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d 2e 31 20  mdoc/${PMDOC}.1 
1d20: 3e 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f  > build/cackey_o
1d30: 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f  sx_build/${OSX}_
1d40: 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f 24 7b  pmbuild.pmdoc/${
1d50: 50 4d 44 4f 43 7d 0a 09 09 73 65 64 20 22 73 7c  PMDOC}...sed "s|
1d60: 40 40 43 55 52 4f 53 58 56 45 52 40 40 7c 24 7b  @@CUROSXVER@@|${
1d70: 43 55 52 4f 53 58 56 45 52 7d 7c 67 22 20 62 75  CUROSXVER}|g" bu
1d80: 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62  ild/cackey_osx_b
1d90: 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75  uild/${OSX}_pmbu
1da0: 69 6c 64 2e 70 6d 64 6f 63 2f 24 7b 50 4d 44 4f  ild.pmdoc/${PMDO
1db0: 43 7d 20 3e 20 62 75 69 6c 64 2f 63 61 63 6b 65  C} > build/cacke
1dc0: 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53  y_osx_build/${OS
1dd0: 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63  X}_pmbuild.pmdoc
1de0: 2f 24 7b 50 4d 44 4f 43 7d 2e 31 0a 09 09 73 65  /${PMDOC}.1...se
1df0: 64 20 22 73 7c 40 40 4c 49 42 43 41 43 4b 45 59  d "s|@@LIBCACKEY
1e00: 47 40 40 7c 24 7b 4c 49 42 43 41 43 4b 45 59 47  G@@|${LIBCACKEYG
1e10: 7d 7c 67 22 20 62 75 69 6c 64 2f 63 61 63 6b 65  }|g" build/cacke
1e20: 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53  y_osx_build/${OS
1e30: 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63  X}_pmbuild.pmdoc
1e40: 2f 24 7b 50 4d 44 4f 43 7d 2e 31 20 3e 20 62 75  /${PMDOC}.1 > bu
1e50: 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62  ild/cackey_osx_b
1e60: 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75  uild/${OSX}_pmbu
1e70: 69 6c 64 2e 70 6d 64 6f 63 2f 24 7b 50 4d 44 4f  ild.pmdoc/${PMDO
1e80: 43 7d 0a 09 09 63 70 20 62 75 69 6c 64 2f 63 61  C}...cp build/ca
1e90: 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24  ckey_osx_build/$
1ea0: 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d  {OSX}_pmbuild.pm
1eb0: 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d 20 62 75 69  doc/${PMDOC} bui
1ec0: 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75  ld/cackey_osx_bu
1ed0: 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69  ild/${OSX}_pmbui
1ee0: 6c 64 2e 70 6d 64 6f 63 2f 24 7b 50 4d 44 4f 43  ld.pmdoc/${PMDOC
1ef0: 7d 2e 31 0a 09 09 6d 76 20 62 75 69 6c 64 2f 63  }.1...mv build/c
1f00: 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f  ackey_osx_build/
1f10: 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70  ${OSX}_pmbuild.p
1f20: 6d 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d 2e 31 20  mdoc/${PMDOC}.1 
1f30: 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78  build/cackey_osx
1f40: 5f 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d  _build/${OSX}_pm
1f50: 62 75 69 6c 64 2e 70 6d 64 6f 63 2f 24 7b 50 4d  build.pmdoc/${PM
1f60: 44 4f 43 7d 0a 09 64 6f 6e 65 0a 09 45 58 54 3d  DOC}..done..EXT=
1f70: 70 6b 67 0a 09 69 66 20 5b 20 24 7b 4f 53 58 7d  pkg..if [ ${OSX}
1f80: 20 3d 3d 20 22 53 6e 6f 77 6c 65 6f 70 61 72 64   == "Snowleopard
1f90: 22 20 5d 3b 20 74 68 65 6e 0a 09 09 63 61 74 20  " ]; then...cat 
1fa0: 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78  build/cackey_osx
1fb0: 5f 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d  _build/${OSX}_pm
1fc0: 62 75 69 6c 64 2e 70 6d 64 6f 63 2f 69 6e 64 65  build.pmdoc/inde
1fd0: 78 2e 78 6d 6c 20 7c 20 73 65 64 20 27 73 7c 66  x.xml | sed 's|f
1fe0: 6f 72 20 4d 61 63 20 4f 53 20 58 20 53 6e 6f 77  or Mac OS X Snow
1ff0: 6c 65 6f 70 61 72 64 7c 66 6f 72 20 4d 61 63 20  leopard|for Mac 
2000: 4f 53 20 58 20 53 6e 6f 77 4c 65 6f 70 61 72 64  OS X SnowLeopard
2010: 7c 67 27 20 3e 20 62 75 69 6c 64 2f 63 61 63 6b  |g' > build/cack
2020: 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f  ey_osx_build/${O
2030: 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f  SX}_pmbuild.pmdo
2040: 63 2f 69 6e 64 65 78 2e 78 6d 6c 2e 6e 65 77 0a  c/index.xml.new.
2050: 09 09 6d 76 20 62 75 69 6c 64 2f 63 61 63 6b 65  ..mv build/cacke
2060: 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53  y_osx_build/${OS
2070: 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63  X}_pmbuild.pmdoc
2080: 2f 69 6e 64 65 78 2e 78 6d 6c 2e 6e 65 77 20 62  /index.xml.new b
2090: 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f  uild/cackey_osx_
20a0: 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62  build/${OSX}_pmb
20b0: 75 69 6c 64 2e 70 6d 64 6f 63 2f 69 6e 64 65 78  uild.pmdoc/index
20c0: 2e 78 6d 6c 0a 09 66 69 0a 09 69 66 20 5b 20 24  .xml..fi..if [ $
20d0: 7b 4f 53 58 7d 20 3d 3d 20 22 53 6c 74 6f 6d 6c  {OSX} == "Sltoml
20e0: 22 20 5d 3b 20 74 68 65 6e 0a 09 09 63 61 74 20  " ]; then...cat 
20f0: 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78  build/cackey_osx
2100: 5f 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d  _build/${OSX}_pm
2110: 62 75 69 6c 64 2e 70 6d 64 6f 63 2f 69 6e 64 65  build.pmdoc/inde
2120: 78 2e 78 6d 6c 20 7c 20 73 65 64 20 27 73 7c 66  x.xml | sed 's|f
2130: 6f 72 20 4d 61 63 20 4f 53 20 58 20 53 6c 74 6f  or Mac OS X Slto
2140: 6d 6c 7c 66 6f 72 20 4d 61 63 20 4f 53 20 58 20  ml|for Mac OS X 
2150: 53 4c 74 6f 4d 4c 7c 67 27 20 3e 20 62 75 69 6c  SLtoML|g' > buil
2160: 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69  d/cackey_osx_bui
2170: 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c  ld/${OSX}_pmbuil
2180: 64 2e 70 6d 64 6f 63 2f 69 6e 64 65 78 2e 78 6d  d.pmdoc/index.xm
2190: 6c 2e 6e 65 77 0a 09 09 6d 76 20 62 75 69 6c 64  l.new...mv build
21a0: 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c  /cackey_osx_buil
21b0: 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64  d/${OSX}_pmbuild
21c0: 2e 70 6d 64 6f 63 2f 69 6e 64 65 78 2e 78 6d 6c  .pmdoc/index.xml
21d0: 2e 6e 65 77 20 62 75 69 6c 64 2f 63 61 63 6b 65  .new build/cacke
21e0: 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53  y_osx_build/${OS
21f0: 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63  X}_pmbuild.pmdoc
2200: 2f 69 6e 64 65 78 2e 78 6d 6c 0a 09 66 69 0a 09  /index.xml..fi..
2210: 2f 44 65 76 65 6c 6f 70 65 72 2f 41 70 70 6c 69  /Developer/Appli
2220: 63 61 74 69 6f 6e 73 2f 55 74 69 6c 69 74 69 65  cations/Utilitie
2230: 73 2f 50 61 63 6b 61 67 65 4d 61 6b 65 72 2e 61  s/PackageMaker.a
2240: 70 70 2f 43 6f 6e 74 65 6e 74 73 2f 4d 61 63 4f  pp/Contents/MacO
2250: 53 2f 50 61 63 6b 61 67 65 4d 61 6b 65 72 20 2d  S/PackageMaker -
2260: 64 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f  d build/cackey_o
2270: 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f  sx_build/${OSX}_
2280: 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 20 2d 6f  pmbuild.pmdoc -o
2290: 20 6d 61 63 62 75 69 6c 64 2f 70 6b 67 2f 43 41   macbuild/pkg/CA
22a0: 43 4b 65 79 5f 24 7b 43 41 43 4b 45 59 5f 56 45  CKey_${CACKEY_VE
22b0: 52 53 49 4f 4e 7d 5f 24 7b 4f 53 58 7d 2e 24 7b  RSION}_${OSX}.${
22c0: 45 58 54 7d 0a 09 74 61 72 20 2d 2d 63 72 65 61  EXT}..tar --crea
22d0: 74 65 20 2d 2d 64 69 72 65 63 74 6f 72 79 20 6d  te --directory m
22e0: 61 63 62 75 69 6c 64 2f 70 6b 67 2f 20 2d 2d 66  acbuild/pkg/ --f
22f0: 69 6c 65 20 6d 61 63 62 75 69 6c 64 2f 70 6b 67  ile macbuild/pkg
2300: 2f 43 41 43 4b 65 79 5f 24 7b 43 41 43 4b 45 59  /CACKey_${CACKEY
2310: 5f 56 45 52 53 49 4f 4e 7d 5f 24 7b 4f 53 58 7d  _VERSION}_${OSX}
2320: 2e 24 7b 45 58 54 7d 2e 74 61 72 20 43 41 43 4b  .${EXT}.tar CACK
2330: 65 79 5f 24 7b 43 41 43 4b 45 59 5f 56 45 52 53  ey_${CACKEY_VERS
2340: 49 4f 4e 7d 5f 24 7b 4f 53 58 7d 2e 24 7b 45 58  ION}_${OSX}.${EX
2350: 54 7d 0a 09 67 7a 69 70 20 2d 39 20 6d 61 63 62  T}..gzip -9 macb
2360: 75 69 6c 64 2f 70 6b 67 2f 43 41 43 4b 65 79 5f  uild/pkg/CACKey_
2370: 24 7b 43 41 43 4b 45 59 5f 56 45 52 53 49 4f 4e  ${CACKEY_VERSION
2380: 7d 5f 24 7b 4f 53 58 7d 2e 24 7b 45 58 54 7d 2e  }_${OSX}.${EXT}.
2390: 74 61 72 0a 09 72 6d 20 2d 72 66 20 6d 61 63 62  tar..rm -rf macb
23a0: 75 69 6c 64 2f 70 6b 67 2f 43 41 43 4b 65 79 5f  uild/pkg/CACKey_
23b0: 24 7b 43 41 43 4b 45 59 5f 56 45 52 53 49 4f 4e  ${CACKEY_VERSION
23c0: 7d 5f 24 7b 4f 53 58 7d 2e 24 7b 45 58 54 7d 0a  }_${OSX}.${EXT}.
23d0: 09 72 6d 20 2d 66 20 62 75 69 6c 64 2f 63 61 63  .rm -f build/cac
23e0: 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 63 61  key_osx_build/ca
23f0: 63 6b 65 79 2e 64 79 6c 69 62 0a 09 72 6d 20 2d  ckey.dylib..rm -
2400: 72 66 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f  rf build/cackey_
2410: 6f 73 78 5f 62 75 69 6c 64 2f 50 4b 43 53 31 31  osx_build/PKCS11
2420: 2e 74 6f 6b 65 6e 64 0a 09 65 63 68 6f 20 22 24  .tokend..echo "$
2430: 7b 4f 53 58 7d 20 62 75 69 6c 64 20 63 6f 6d 70  {OSX} build comp
2440: 6c 65 74 65 22 0a 7d 0a 0a 23 20 54 61 6b 65 20  lete".}..# Take 
2450: 63 6f 6d 6d 61 6e 64 20 6c 69 6e 65 20 61 72 67  command line arg
2460: 75 6d 65 6e 74 73 20 61 6e 64 20 65 78 65 63 75  uments and execu
2470: 74 65 0a 63 61 73 65 20 22 24 31 22 20 69 6e 0a  te.case "$1" in.
2480: 09 22 22 29 0a 09 09 75 73 61 67 65 0a 09 09 65  ."")...usage...e
2490: 78 69 74 20 24 3f 0a 09 3b 3b 0a 0a 09 22 6c 65  xit $?..;;..."le
24a0: 6f 70 61 72 64 22 29 0a 09 09 2e 2f 61 75 74 6f  opard")..../auto
24b0: 67 65 6e 2e 73 68 0a 09 09 6c 65 6f 70 61 72 64  gen.sh...leopard
24c0: 0a 09 09 65 78 69 74 20 24 3f 0a 09 3b 3b 0a 0a  ...exit $?..;;..
24d0: 09 22 73 6e 6f 77 6c 65 6f 70 61 72 64 22 29 0a  ."snowleopard").
24e0: 09 09 2e 2f 61 75 74 6f 67 65 6e 2e 73 68 0a 09  .../autogen.sh..
24f0: 09 73 6e 6f 77 6c 65 6f 70 61 72 64 0a 09 09 65  .snowleopard...e
2500: 78 69 74 20 24 3f 0a 09 3b 3b 0a 09 0a 09 22 6c  xit $?..;;...."l
2510: 69 6f 6e 22 29 0a 09 09 2e 2f 61 75 74 6f 67 65  ion")..../autoge
2520: 6e 2e 73 68 0a 09 09 6c 69 6f 6e 0a 09 09 65 78  n.sh...lion...ex
2530: 69 74 20 24 3f 0a 09 3b 3b 0a 09 0a 09 22 73 6c  it $?..;;...."sl
2540: 74 6f 6d 6c 22 29 0a 09 09 2e 2f 61 75 74 6f 67  toml")..../autog
2550: 65 6e 2e 73 68 0a 09 09 73 6c 74 6f 6d 6c 0a 09  en.sh...sltoml..
2560: 09 65 78 69 74 20 24 3f 0a 09 3b 3b 0a 0a 09 22  .exit $?..;;..."
2570: 61 6c 6c 22 29 0a 09 09 2e 2f 61 75 74 6f 67 65  all")..../autoge
2580: 6e 2e 73 68 0a 09 09 6c 65 6f 70 61 72 64 0a 09  n.sh...leopard..
2590: 09 73 6c 74 6f 6d 6c 0a 09 09 65 63 68 6f 20 22  .sltoml...echo "
25a0: 22 0a 09 09 65 63 68 6f 20 22 41 6c 6c 20 62 75  "...echo "All bu
25b0: 69 6c 64 73 20 63 6f 6d 70 6c 65 74 65 2e 22 0a  ilds complete.".
25c0: 09 09 65 78 69 74 20 24 3f 0a 09 3b 3b 0a 0a 09  ..exit $?..;;...
25d0: 22 63 6c 65 61 6e 22 29 0a 09 09 63 6c 65 61 6e  "clean")...clean
25e0: 0a 09 09 65 78 69 74 20 24 3f 0a 09 3b 3b 0a 0a  ...exit $?..;;..
25f0: 09 2a 29 0a 09 09 75 73 61 67 65 0a 09 09 65 78  .*)...usage...ex
2600: 69 74 20 24 3f 0a 09 3b 3b 0a 65 73 61 63 20 0a  it $?..;;.esac .