Hex Artifact Content

Artifact b98bcd81f7d113df95773c3e775c2d4bc076b89a:


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 61 6c 6c 20 2d 20 28 42 75 69   "    all - (Bui
0290: 6c 64 73 20 66 6f 72 20 61 6c 6c 20 73 75 70 70  lds for all supp
02a0: 6f 72 74 65 64 20 74 61 72 67 65 74 73 29 22 0a  orted targets)".
02b0: 09 65 63 68 6f 20 22 20 20 20 20 63 6c 65 61 6e  .echo "    clean
02c0: 20 2d 20 28 43 6c 65 61 6e 73 20 75 70 29 22 0a   - (Cleans up)".
02d0: 09 65 63 68 6f 20 22 52 75 6e 20 66 72 6f 6d 20  .echo "Run from 
02e0: 43 41 43 4b 65 79 20 42 75 69 6c 64 20 52 6f 6f  CACKey Build Roo
02f0: 74 2e 22 0a 09 65 78 69 74 20 24 3f 0a 7d 0a 0a  t."..exit $?.}..
0300: 23 20 43 6c 65 61 6e 20 75 70 20 66 75 6e 63 74  # Clean up funct
0310: 69 6f 6e 0a 63 6c 65 61 6e 28 29 20 7b 0a 09 72  ion.clean() {..r
0320: 6d 20 2d 66 20 62 75 69 6c 64 2f 63 61 63 6b 65  m -f build/cacke
0330: 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 63 61 63 6b  y_osx_build/cack
0340: 65 79 2e 64 79 6c 69 62 0a 09 72 6d 20 2d 72 66  ey.dylib..rm -rf
0350: 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73   build/cackey_os
0360: 78 5f 62 75 69 6c 64 2f 50 4b 43 53 31 31 2e 74  x_build/PKCS11.t
0370: 6f 6b 65 6e 64 0a 09 72 6d 20 2d 72 66 20 50 4b  okend..rm -rf PK
0380: 43 53 31 31 2e 74 6f 6b 65 6e 64 0a 09 72 6d 20  CS11.tokend..rm 
0390: 2d 72 66 20 6d 61 63 62 75 69 6c 64 0a 09 72 6d  -rf macbuild..rm
03a0: 20 2d 72 66 20 62 75 69 6c 64 2f 63 61 63 6b 65   -rf build/cacke
03b0: 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 2a 2e 70 6d  y_osx_build/*.pm
03c0: 64 6f 63 0a 09 6d 61 6b 65 20 64 69 73 74 63 6c  doc..make distcl
03d0: 65 61 6e 0a 7d 0a 0a 23 20 44 69 72 65 63 74 6f  ean.}..# Directo
03e0: 72 79 20 63 72 65 61 74 69 6f 6e 20 66 75 6e 63  ry creation func
03f0: 74 69 6f 6e 0a 6d 61 6b 65 64 69 72 28 29 20 7b  tion.makedir() {
0400: 0a 09 69 66 20 5b 20 22 60 75 6e 61 6d 65 20 2d  ..if [ "`uname -
0410: 72 20 7c 20 63 75 74 20 2d 64 20 2e 20 2d 66 20  r | cut -d . -f 
0420: 31 60 22 20 2d 6c 74 20 22 31 30 22 20 5d 3b 20  1`" -lt "10" ]; 
0430: 74 68 65 6e 0a 09 09 4c 49 42 54 4f 4f 4c 44 49  then...LIBTOOLDI
0440: 52 3d 2f 44 65 76 65 6c 6f 70 65 72 2f 75 73 72  R=/Developer/usr
0450: 2f 73 68 61 72 65 2f 6c 69 62 74 6f 6f 6c 0a 09  /share/libtool..
0460: 65 6c 73 65 0a 09 09 4c 49 42 54 4f 4f 4c 44 49  else...LIBTOOLDI
0470: 52 3d 2f 44 65 76 65 6c 6f 70 65 72 2f 75 73 72  R=/Developer/usr
0480: 2f 73 68 61 72 65 2f 6c 69 62 74 6f 6f 6c 2f 63  /share/libtool/c
0490: 6f 6e 66 69 67 0a 09 66 69 0a 09 69 66 20 5b 20  onfig..fi..if [ 
04a0: 21 20 2d 64 20 6d 61 63 62 75 69 6c 64 20 5d 3b  ! -d macbuild ];
04b0: 20 74 68 65 6e 0a 09 09 6d 6b 64 69 72 20 6d 61   then...mkdir ma
04c0: 63 62 75 69 6c 64 0a 09 09 6d 6b 64 69 72 20 6d  cbuild...mkdir m
04d0: 61 63 62 75 69 6c 64 2f 4c 65 6f 70 61 72 64 0a  acbuild/Leopard.
04e0: 09 09 6d 6b 64 69 72 20 6d 61 63 62 75 69 6c 64  ..mkdir macbuild
04f0: 2f 53 6e 6f 77 6c 65 6f 70 61 72 64 0a 09 09 6d  /Snowleopard...m
0500: 6b 64 69 72 20 6d 61 63 62 75 69 6c 64 2f 4c 69  kdir macbuild/Li
0510: 6f 6e 0a 09 09 6d 6b 64 69 72 20 6d 61 63 62 75  on...mkdir macbu
0520: 69 6c 64 2f 70 6b 67 0a 09 66 69 0a 09 69 66 20  ild/pkg..fi..if 
0530: 5b 20 21 20 2d 66 20 63 6f 6e 66 69 67 2e 67 75  [ ! -f config.gu
0540: 65 73 73 20 5d 3b 20 74 68 65 6e 0a 09 09 63 70  ess ]; then...cp
0550: 20 24 7b 4c 49 42 54 4f 4f 4c 44 49 52 7d 2f 63   ${LIBTOOLDIR}/c
0560: 6f 6e 66 69 67 2e 67 75 65 73 73 20 2e 0a 09 66  onfig.guess ...f
0570: 69 0a 09 69 66 20 5b 20 21 20 2d 66 20 63 6f 6e  i..if [ ! -f con
0580: 66 69 67 2e 73 75 62 20 5d 3b 20 74 68 65 6e 0a  fig.sub ]; then.
0590: 09 09 63 70 20 24 7b 4c 49 42 54 4f 4f 4c 44 49  ..cp ${LIBTOOLDI
05a0: 52 7d 2f 63 6f 6e 66 69 67 2e 73 75 62 20 2e 0a  R}/config.sub ..
05b0: 09 66 69 0a 09 69 66 20 5b 20 21 20 2d 66 20 69  .fi..if [ ! -f i
05c0: 6e 73 74 61 6c 6c 2d 73 68 20 5d 3b 20 74 68 65  nstall-sh ]; the
05d0: 6e 0a 09 09 63 70 20 24 7b 4c 49 42 54 4f 4f 4c  n...cp ${LIBTOOL
05e0: 44 49 52 7d 2f 69 6e 73 74 61 6c 6c 2d 73 68 20  DIR}/install-sh 
05f0: 2e 0a 09 66 69 0a 7d 0a 0a 23 20 42 75 69 6c 64  ...fi.}..# Build
0600: 20 66 75 6e 63 74 69 6f 6e 20 66 6f 72 20 4c 65   function for Le
0610: 6f 70 61 72 64 0a 6c 65 6f 70 61 72 64 28 29 20  opard.leopard() 
0620: 7b 0a 09 6d 61 6b 65 64 69 72 0a 09 48 45 41 44  {..makedir..HEAD
0630: 45 52 53 3d 2f 44 65 76 65 6c 6f 70 65 72 2f 53  ERS=/Developer/S
0640: 44 4b 73 2f 4d 61 63 4f 53 58 31 30 2e 35 2e 73  DKs/MacOSX10.5.s
0650: 64 6b 2f 53 79 73 74 65 6d 2f 4c 69 62 72 61 72  dk/System/Librar
0660: 79 2f 46 72 61 6d 65 77 6f 72 6b 73 2f 50 43 53  y/Frameworks/PCS
0670: 43 2e 66 72 61 6d 65 77 6f 72 6b 2f 56 65 72 73  C.framework/Vers
0680: 69 6f 6e 73 2f 41 2f 48 65 61 64 65 72 73 2f 0a  ions/A/Headers/.
0690: 09 4c 49 42 52 41 52 59 3d 2f 44 65 76 65 6c 6f  .LIBRARY=/Develo
06a0: 70 65 72 2f 53 44 4b 73 2f 4d 61 63 4f 53 58 31  per/SDKs/MacOSX1
06b0: 30 2e 35 2e 73 64 6b 2f 53 79 73 74 65 6d 2f 4c  0.5.sdk/System/L
06c0: 69 62 72 61 72 79 2f 46 72 61 6d 65 77 6f 72 6b  ibrary/Framework
06d0: 73 2f 50 43 53 43 2e 66 72 61 6d 65 77 6f 72 6b  s/PCSC.framework
06e0: 2f 50 43 53 43 0a 09 4c 49 42 3d 22 22 0a 09 41  /PCSC..LIB=""..A
06f0: 52 43 48 4c 49 53 54 3d 22 22 0a 09 44 4c 49 42  RCHLIST=""..DLIB
0700: 3d 22 22 0a 09 44 41 52 43 48 4c 49 53 54 3d 22  =""..DARCHLIST="
0710: 22 0a 09 4f 53 58 3d 4c 65 6f 70 61 72 64 0a 09  "..OSX=Leopard..
0720: 50 4b 54 41 52 47 45 54 4f 53 3d 33 0a 09 4e 45  PKTARGETOS=3..NE
0730: 58 54 4f 53 58 56 45 52 3d 31 30 2e 36 0a 09 43  XTOSXVER=10.6..C
0740: 55 52 4f 53 58 56 45 52 3d 31 30 2e 35 0a 09 66  UROSXVER=10.5..f
0750: 6f 72 20 48 4f 53 54 20 69 6e 20 70 6f 77 65 72  or HOST in power
0760: 70 63 2d 61 70 70 6c 65 2d 64 61 72 77 69 6e 39  pc-apple-darwin9
0770: 20 69 33 38 36 2d 61 70 70 6c 65 2d 64 61 72 77   i386-apple-darw
0780: 69 6e 39 3b 20 64 6f 0a 09 09 67 65 6e 62 75 69  in9; do...genbui
0790: 6c 64 0a 09 64 6f 6e 65 0a 09 6c 69 62 62 75 69  ld..done..libbui
07a0: 6c 64 0a 09 70 6b 67 62 75 69 6c 64 0a 7d 0a 0a  ld..pkgbuild.}..
07b0: 23 20 42 75 69 6c 64 20 66 75 6e 63 74 69 6f 6e  # Build function
07c0: 20 66 6f 72 20 53 6e 6f 77 20 4c 65 6f 70 61 72   for Snow Leopar
07d0: 64 0a 73 6e 6f 77 6c 65 6f 70 61 72 64 28 29 20  d.snowleopard() 
07e0: 7b 0a 09 6d 61 6b 65 64 69 72 0a 09 48 45 41 44  {..makedir..HEAD
07f0: 45 52 53 3d 2f 44 65 76 65 6c 6f 70 65 72 2f 53  ERS=/Developer/S
0800: 44 4b 73 2f 4d 61 63 4f 53 58 31 30 2e 36 2e 73  DKs/MacOSX10.6.s
0810: 64 6b 2f 53 79 73 74 65 6d 2f 4c 69 62 72 61 72  dk/System/Librar
0820: 79 2f 46 72 61 6d 65 77 6f 72 6b 73 2f 50 43 53  y/Frameworks/PCS
0830: 43 2e 66 72 61 6d 65 77 6f 72 6b 2f 56 65 72 73  C.framework/Vers
0840: 69 6f 6e 73 2f 41 2f 48 65 61 64 65 72 73 2f 0a  ions/A/Headers/.
0850: 09 4c 49 42 52 41 52 59 3d 2f 44 65 76 65 6c 6f  .LIBRARY=/Develo
0860: 70 65 72 2f 53 44 4b 73 2f 4d 61 63 4f 53 58 31  per/SDKs/MacOSX1
0870: 30 2e 36 2e 73 64 6b 2f 53 79 73 74 65 6d 2f 4c  0.6.sdk/System/L
0880: 69 62 72 61 72 79 2f 46 72 61 6d 65 77 6f 72 6b  ibrary/Framework
0890: 73 2f 50 43 53 43 2e 66 72 61 6d 65 77 6f 72 6b  s/PCSC.framework
08a0: 2f 50 43 53 43 0a 09 4c 49 42 3d 22 22 0a 09 41  /PCSC..LIB=""..A
08b0: 52 43 48 4c 49 53 54 3d 22 22 0a 09 44 4c 49 42  RCHLIST=""..DLIB
08c0: 3d 22 22 0a 09 44 41 52 43 48 4c 49 53 54 3d 22  =""..DARCHLIST="
08d0: 22 0a 09 4f 53 58 3d 53 6e 6f 77 6c 65 6f 70 61  "..OSX=Snowleopa
08e0: 72 64 0a 09 50 4b 54 41 52 47 45 54 4f 53 3d 33  rd..PKTARGETOS=3
08f0: 0a 09 4e 45 58 54 4f 53 58 56 45 52 3d 31 30 2e  ..NEXTOSXVER=10.
0900: 37 0a 09 43 55 52 4f 53 58 56 45 52 3d 31 30 2e  7..CUROSXVER=10.
0910: 36 0a 09 66 6f 72 20 48 4f 53 54 20 69 6e 20 69  6..for HOST in i
0920: 33 38 36 2d 61 70 70 6c 65 2d 64 61 72 77 69 6e  386-apple-darwin
0930: 31 30 20 78 38 36 5f 36 34 2d 61 70 70 6c 65 2d  10 x86_64-apple-
0940: 64 61 72 77 69 6e 31 30 3b 20 64 6f 0a 09 09 67  darwin10; do...g
0950: 65 6e 62 75 69 6c 64 0a 09 64 6f 6e 65 0a 09 6c  enbuild..done..l
0960: 69 62 62 75 69 6c 64 0a 09 70 6b 67 62 75 69 6c  ibbuild..pkgbuil
0970: 64 0a 7d 0a 0a 23 20 42 75 69 6c 64 20 66 75 6e  d.}..# Build fun
0980: 63 74 69 6f 6e 20 66 6f 72 20 4c 69 6f 6e 0a 6c  ction for Lion.l
0990: 69 6f 6e 28 29 20 7b 0a 09 6d 61 6b 65 64 69 72  ion() {..makedir
09a0: 0a 09 48 45 41 44 45 52 53 3d 2f 44 65 76 65 6c  ..HEADERS=/Devel
09b0: 6f 70 65 72 2f 53 44 4b 73 2f 4d 61 63 4f 53 58  oper/SDKs/MacOSX
09c0: 31 30 2e 37 2e 73 64 6b 2f 53 79 73 74 65 6d 2f  10.7.sdk/System/
09d0: 4c 69 62 72 61 72 79 2f 46 72 61 6d 65 77 6f 72  Library/Framewor
09e0: 6b 73 2f 50 43 53 43 2e 66 72 61 6d 65 77 6f 72  ks/PCSC.framewor
09f0: 6b 2f 56 65 72 73 69 6f 6e 73 2f 41 2f 48 65 61  k/Versions/A/Hea
0a00: 64 65 72 73 2f 0a 09 4c 49 42 52 41 52 59 3d 2f  ders/..LIBRARY=/
0a10: 44 65 76 65 6c 6f 70 65 72 2f 53 44 4b 73 2f 4d  Developer/SDKs/M
0a20: 61 63 4f 53 58 31 30 2e 37 2e 73 64 6b 2f 53 79  acOSX10.7.sdk/Sy
0a30: 73 74 65 6d 2f 4c 69 62 72 61 72 79 2f 46 72 61  stem/Library/Fra
0a40: 6d 65 77 6f 72 6b 73 2f 50 43 53 43 2e 66 72 61  meworks/PCSC.fra
0a50: 6d 65 77 6f 72 6b 2f 50 43 53 43 0a 09 4c 49 42  mework/PCSC..LIB
0a60: 3d 22 22 0a 09 41 52 43 48 4c 49 53 54 3d 22 22  =""..ARCHLIST=""
0a70: 0a 09 44 4c 49 42 3d 22 22 0a 09 44 41 52 43 48  ..DLIB=""..DARCH
0a80: 4c 49 53 54 3d 22 22 0a 09 4f 53 58 3d 4c 69 6f  LIST=""..OSX=Lio
0a90: 6e 0a 09 50 4b 54 41 52 47 45 54 4f 53 3d 33 0a  n..PKTARGETOS=3.
0aa0: 09 4e 45 58 54 4f 53 58 56 45 52 3d 31 30 2e 38  .NEXTOSXVER=10.8
0ab0: 0a 09 43 55 52 4f 53 58 56 45 52 3d 31 30 2e 37  ..CUROSXVER=10.7
0ac0: 0a 09 66 6f 72 20 48 4f 53 54 20 69 6e 20 69 33  ..for HOST in i3
0ad0: 38 36 2d 61 70 70 6c 65 2d 64 61 72 77 69 6e 31  86-apple-darwin1
0ae0: 31 20 78 38 36 5f 36 34 2d 61 70 70 6c 65 2d 64  1 x86_64-apple-d
0af0: 61 72 77 69 6e 31 31 3b 20 64 6f 0a 09 09 67 65  arwin11; do...ge
0b00: 6e 62 75 69 6c 64 0a 09 64 6f 6e 65 0a 09 6c 69  nbuild..done..li
0b10: 62 62 75 69 6c 64 0a 09 70 6b 67 62 75 69 6c 64  bbuild..pkgbuild
0b20: 0a 7d 0a 0a 23 20 47 65 6e 65 72 69 63 20 62 75  .}..# Generic bu
0b30: 69 6c 64 20 66 75 6e 63 74 69 6f 6e 0a 67 65 6e  ild function.gen
0b40: 62 75 69 6c 64 28 29 20 7b 0a 09 6d 61 6b 65 20  build() {..make 
0b50: 64 69 73 74 63 6c 65 61 6e 0a 09 41 52 43 48 3d  distclean..ARCH=
0b60: 60 65 63 68 6f 20 24 7b 48 4f 53 54 7d 20 7c 20  `echo ${HOST} | 
0b70: 63 75 74 20 2d 64 20 22 2d 22 20 2d 66 20 31 60  cut -d "-" -f 1`
0b80: 0a 09 69 66 20 5b 20 24 7b 41 52 43 48 7d 20 3d  ..if [ ${ARCH} =
0b90: 3d 20 22 70 6f 77 65 72 70 63 22 20 5d 3b 20 74  = "powerpc" ]; t
0ba0: 68 65 6e 0a 09 09 69 66 20 5b 20 24 7b 4f 53 58  hen...if [ ${OSX
0bb0: 7d 20 3d 3d 20 22 4c 65 6f 70 61 72 64 22 20 5d  } == "Leopard" ]
0bc0: 3b 20 74 68 65 6e 0a 09 09 09 41 52 43 48 3d 22  ; then....ARCH="
0bd0: 70 70 63 20 2d 6d 63 70 75 3d 47 34 22 0a 09 09  ppc -mcpu=G4"...
0be0: 65 6c 73 65 0a 09 09 09 41 52 43 48 3d 22 70 70  else....ARCH="pp
0bf0: 63 20 2d 6d 63 70 75 3d 47 33 22 0a 09 09 66 69  c -mcpu=G3"...fi
0c00: 0a 09 66 69 0a 09 69 66 20 5b 20 22 24 7b 4c 49  ..fi..if [ "${LI
0c10: 4f 4e 42 55 49 4c 44 7d 22 20 3d 20 31 20 5d 3b  ONBUILD}" = 1 ];
0c20: 20 74 68 65 6e 0a 09 09 69 66 20 5b 20 22 24 7b   then...if [ "${
0c30: 41 52 43 48 7d 22 20 3d 3d 20 22 70 70 63 20 2d  ARCH}" == "ppc -
0c40: 6d 63 70 75 3d 47 34 22 20 5d 3b 20 74 68 65 6e  mcpu=G4" ]; then
0c50: 0a 09 09 09 43 43 3d 70 6f 77 65 72 70 63 2d 61  ....CC=powerpc-a
0c60: 70 70 6c 65 2d 64 61 72 77 69 6e 31 31 2d 67 63  pple-darwin11-gc
0c70: 63 2d 34 2e 32 2e 31 20 43 50 50 3d 70 6f 77 65  c-4.2.1 CPP=powe
0c80: 72 70 63 2d 61 70 70 6c 65 2d 64 61 72 77 69 6e  rpc-apple-darwin
0c90: 31 31 2d 63 70 70 2d 34 2e 32 2e 31 20 43 46 4c  11-cpp-4.2.1 CFL
0ca0: 41 47 53 3d 22 2d 6d 33 32 20 2d 49 2f 44 65 76  AGS="-m32 -I/Dev
0cb0: 65 6c 6f 70 65 72 2f 50 6c 61 74 66 6f 72 6d 73  eloper/Platforms
0cc0: 2f 69 50 68 6f 6e 65 4f 53 2e 70 6c 61 74 66 6f  /iPhoneOS.platfo
0cd0: 72 6d 2f 44 65 76 65 6c 6f 70 65 72 2f 75 73 72  rm/Developer/usr
0ce0: 2f 6c 69 62 2f 67 63 63 2f 70 6f 77 65 72 70 63  /lib/gcc/powerpc
0cf0: 2d 61 70 70 6c 65 2d 64 61 72 77 69 6e 31 30 2f  -apple-darwin10/
0d00: 34 2e 32 2e 31 2f 69 6e 63 6c 75 64 65 20 2d 69  4.2.1/include -i
0d10: 73 79 73 72 6f 6f 74 20 2f 44 65 76 65 6c 6f 70  sysroot /Develop
0d20: 65 72 2f 53 44 4b 73 2f 4d 61 63 4f 53 58 31 30  er/SDKs/MacOSX10
0d30: 2e 35 2e 73 64 6b 22 20 43 50 50 46 4c 41 47 53  .5.sdk" CPPFLAGS
0d40: 3d 22 2d 44 5f 4c 49 42 43 5f 4c 49 4d 49 54 53  ="-D_LIBC_LIMITS
0d50: 5f 48 5f 22 20 2e 2f 63 6f 6e 66 69 67 75 72 65  _H_" ./configure
0d60: 20 2d 2d 77 69 74 68 2d 70 63 73 63 2d 68 65 61   --with-pcsc-hea
0d70: 64 65 72 73 3d 24 7b 48 45 41 44 45 52 53 7d 20  ders=${HEADERS} 
0d80: 2d 2d 77 69 74 68 2d 70 63 73 63 2d 6c 69 62 73  --with-pcsc-libs
0d90: 3d 24 7b 4c 49 42 52 41 52 59 7d 20 2d 2d 68 6f  =${LIBRARY} --ho
0da0: 73 74 3d 24 7b 48 4f 53 54 7d 0a 09 09 65 6c 73  st=${HOST}...els
0db0: 65 0a 09 09 09 43 46 4c 41 47 53 3d 22 2d 61 72  e....CFLAGS="-ar
0dc0: 63 68 20 24 7b 41 52 43 48 7d 22 20 2e 2f 63 6f  ch ${ARCH}" ./co
0dd0: 6e 66 69 67 75 72 65 20 2d 2d 77 69 74 68 2d 70  nfigure --with-p
0de0: 63 73 63 2d 68 65 61 64 65 72 73 3d 24 7b 48 45  csc-headers=${HE
0df0: 41 44 45 52 53 7d 20 2d 2d 77 69 74 68 2d 70 63  ADERS} --with-pc
0e00: 73 63 2d 6c 69 62 73 3d 24 7b 4c 49 42 52 41 52  sc-libs=${LIBRAR
0e10: 59 7d 20 2d 2d 68 6f 73 74 3d 24 7b 48 4f 53 54  Y} --host=${HOST
0e20: 7d 0a 09 09 66 69 0a 09 65 6c 73 65 0a 09 09 43  }...fi..else...C
0e30: 46 4c 41 47 53 3d 22 2d 61 72 63 68 20 24 7b 41  FLAGS="-arch ${A
0e40: 52 43 48 7d 22 20 2e 2f 63 6f 6e 66 69 67 75 72  RCH}" ./configur
0e50: 65 20 2d 2d 77 69 74 68 2d 70 63 73 63 2d 68 65  e --with-pcsc-he
0e60: 61 64 65 72 73 3d 24 7b 48 45 41 44 45 52 53 7d  aders=${HEADERS}
0e70: 20 2d 2d 77 69 74 68 2d 70 63 73 63 2d 6c 69 62   --with-pcsc-lib
0e80: 73 3d 24 7b 4c 49 42 52 41 52 59 7d 20 2d 2d 68  s=${LIBRARY} --h
0e90: 6f 73 74 3d 24 7b 48 4f 53 54 7d 0a 09 66 69 0a  ost=${HOST}..fi.
0ea0: 09 6d 61 6b 65 0a 09 63 70 20 6c 69 62 63 61 63  .make..cp libcac
0eb0: 6b 65 79 2e 64 79 6c 69 62 20 6d 61 63 62 75 69  key.dylib macbui
0ec0: 6c 64 2f 24 7b 4f 53 58 7d 2f 6c 69 62 63 61 63  ld/${OSX}/libcac
0ed0: 6b 65 79 2e 64 79 6c 69 62 2e 60 65 63 68 6f 20  key.dylib.`echo 
0ee0: 24 7b 41 52 43 48 7d 20 7c 20 63 75 74 20 2d 64  ${ARCH} | cut -d
0ef0: 20 27 20 27 20 2d 66 20 31 60 0a 09 63 70 20 6c   ' ' -f 1`..cp l
0f00: 69 62 63 61 63 6b 65 79 5f 67 2e 64 79 6c 69 62  ibcackey_g.dylib
0f10: 20 6d 61 63 62 75 69 6c 64 2f 24 7b 4f 53 58 7d   macbuild/${OSX}
0f20: 2f 6c 69 62 63 61 63 6b 65 79 5f 67 2e 64 79 6c  /libcackey_g.dyl
0f30: 69 62 2e 60 65 63 68 6f 20 24 7b 41 52 43 48 7d  ib.`echo ${ARCH}
0f40: 20 7c 20 63 75 74 20 2d 64 20 27 20 27 20 2d 66   | cut -d ' ' -f
0f50: 20 31 60 20 0a 7d 0a 0a 23 20 4c 69 62 72 61 72   1` .}..# Librar
0f60: 79 20 62 75 69 6c 64 20 66 75 6e 63 74 69 6f 6e  y build function
0f70: 0a 6c 69 62 62 75 69 6c 64 28 29 20 7b 0a 09 66  .libbuild() {..f
0f80: 6f 72 20 4c 49 42 20 69 6e 20 6d 61 63 62 75 69  or LIB in macbui
0f90: 6c 64 2f 24 7b 4f 53 58 7d 2f 6c 69 62 63 61 63  ld/${OSX}/libcac
0fa0: 6b 65 79 2e 64 79 6c 69 62 2e 2a 3b 20 64 6f 0a  key.dylib.*; do.
0fb0: 09 09 41 52 43 48 4c 49 53 54 3d 22 24 7b 41 52  ..ARCHLIST="${AR
0fc0: 43 48 4c 49 53 54 7d 20 60 65 63 68 6f 20 27 2d  CHLIST} `echo '-
0fd0: 61 72 63 68 20 27 60 20 60 65 63 68 6f 20 24 7b  arch '` `echo ${
0fe0: 4c 49 42 7d 20 7c 20 63 75 74 20 2d 64 20 2e 20  LIB} | cut -d . 
0ff0: 2d 66 20 33 60 20 60 65 63 68 6f 20 27 20 27 60  -f 3` `echo ' '`
1000: 20 60 65 63 68 6f 20 24 7b 4c 49 42 7d 60 22 0a   `echo ${LIB}`".
1010: 09 64 6f 6e 65 0a 09 6c 69 70 6f 20 2d 63 72 65  .done..lipo -cre
1020: 61 74 65 20 24 7b 41 52 43 48 4c 49 53 54 7d 20  ate ${ARCHLIST} 
1030: 2d 6f 75 74 70 75 74 20 6d 61 63 62 75 69 6c 64  -output macbuild
1040: 2f 24 7b 4f 53 58 7d 2f 6c 69 62 63 61 63 6b 65  /${OSX}/libcacke
1050: 79 2e 64 79 6c 69 62 0a 09 66 6f 72 20 44 4c 49  y.dylib..for DLI
1060: 42 20 69 6e 20 6d 61 63 62 75 69 6c 64 2f 24 7b  B in macbuild/${
1070: 4f 53 58 7d 2f 6c 69 62 63 61 63 6b 65 79 5f 67  OSX}/libcackey_g
1080: 2e 64 79 6c 69 62 2e 2a 3b 20 64 6f 0a 09 09 44  .dylib.*; do...D
1090: 41 52 43 48 4c 49 53 54 3d 22 24 7b 44 41 52 43  ARCHLIST="${DARC
10a0: 48 4c 49 53 54 7d 20 60 65 63 68 6f 20 27 2d 61  HLIST} `echo '-a
10b0: 72 63 68 20 27 60 20 60 65 63 68 6f 20 24 7b 44  rch '` `echo ${D
10c0: 4c 49 42 7d 20 7c 20 63 75 74 20 2d 64 20 2e 20  LIB} | cut -d . 
10d0: 2d 66 20 33 60 20 60 65 63 68 6f 20 27 20 27 60  -f 3` `echo ' '`
10e0: 20 60 65 63 68 6f 20 24 7b 44 4c 49 42 7d 60 22   `echo ${DLIB}`"
10f0: 0a 09 64 6f 6e 65 0a 09 6c 69 70 6f 20 2d 63 72  ..done..lipo -cr
1100: 65 61 74 65 20 24 7b 44 41 52 43 48 4c 49 53 54  eate ${DARCHLIST
1110: 7d 20 2d 6f 75 74 70 75 74 20 6d 61 63 62 75 69  } -output macbui
1120: 6c 64 2f 24 7b 4f 53 58 7d 2f 6c 69 62 63 61 63  ld/${OSX}/libcac
1130: 6b 65 79 5f 67 2e 64 79 6c 69 62 0a 09 72 6d 20  key_g.dylib..rm 
1140: 6d 61 63 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 2f  macbuild/${OSX}/
1150: 6c 69 62 63 61 63 6b 65 79 2a 2e 64 79 6c 69 62  libcackey*.dylib
1160: 2e 2a 0a 7d 0a 0a 23 20 46 75 6e 63 74 69 6f 6e  .*.}..# Function
1170: 20 74 6f 20 62 75 69 6c 64 20 4d 61 63 20 4f 53   to build Mac OS
1180: 20 58 20 50 61 63 6b 61 67 65 73 0a 70 6b 67 62   X Packages.pkgb
1190: 75 69 6c 64 28 29 20 7b 0a 09 69 66 20 5b 20 22  uild() {..if [ "
11a0: 60 75 6e 61 6d 65 20 2d 72 20 7c 20 63 75 74 20  `uname -r | cut 
11b0: 2d 64 20 2e 20 2d 66 20 31 60 22 20 2d 6c 74 20  -d . -f 1`" -lt 
11c0: 22 31 30 22 20 5d 3b 20 74 68 65 6e 0a 09 09 4c  "10" ]; then...L
11d0: 49 42 43 41 43 4b 45 59 47 3d 6c 69 62 63 61 63  IBCACKEYG=libcac
11e0: 6b 65 79 67 2e 70 6b 67 0a 09 65 6c 73 65 0a 09  keyg.pkg..else..
11f0: 09 4c 49 42 43 41 43 4b 45 59 47 3d 6c 69 62 63  .LIBCACKEYG=libc
1200: 61 63 6b 65 79 5f 67 2e 70 6b 67 0a 09 66 69 0a  ackey_g.pkg..fi.
1210: 09 72 6d 20 2d 66 20 62 75 69 6c 64 2f 63 61 63  .rm -f build/cac
1220: 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 63 61  key_osx_build/ca
1230: 63 6b 65 79 2e 64 79 6c 69 62 0a 09 6c 6e 20 6d  ckey.dylib..ln m
1240: 61 63 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 2f 6c  acbuild/${OSX}/l
1250: 69 62 63 61 63 6b 65 79 2e 64 79 6c 69 62 20 62  ibcackey.dylib b
1260: 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f  uild/cackey_osx_
1270: 62 75 69 6c 64 2f 63 61 63 6b 65 79 2e 64 79 6c  build/cackey.dyl
1280: 69 62 0a 09 72 6d 20 2d 72 66 20 62 75 69 6c 64  ib..rm -rf build
1290: 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c  /cackey_osx_buil
12a0: 64 2f 50 4b 43 53 31 31 2e 74 6f 6b 65 6e 64 0a  d/PKCS11.tokend.
12b0: 09 69 66 20 5b 20 22 24 7b 4c 49 4f 4e 42 55 49  .if [ "${LIONBUI
12c0: 4c 44 7d 22 20 3d 20 31 20 5d 3b 20 74 68 65 6e  LD}" = 1 ]; then
12d0: 0a 09 09 54 41 52 3d 67 6e 75 74 61 72 0a 09 65  ...TAR=gnutar..e
12e0: 6c 73 65 0a 09 09 54 41 52 3d 74 61 72 0a 09 66  lse...TAR=tar..f
12f0: 69 0a 09 69 66 20 5b 20 22 24 7b 4f 53 58 7d 22  i..if [ "${OSX}"
1300: 20 3d 20 22 4c 65 6f 70 61 72 64 22 20 5d 3b 20   = "Leopard" ]; 
1310: 74 68 65 6e 0a 09 09 63 75 72 6c 20 68 74 74 70  then...curl http
1320: 3a 2f 2f 64 65 76 65 6c 2e 6b 76 61 6e 61 6c 73  ://devel.kvanals
1330: 2e 6f 72 67 2f 50 4b 43 53 31 31 5f 54 6f 6b 65  .org/PKCS11_Toke
1340: 6e 64 2f 50 4b 43 53 31 31 5f 74 6f 6b 65 6e 64  nd/PKCS11_tokend
1350: 2d 6c 61 74 65 73 74 2e 74 61 72 2e 67 7a 20 7c  -latest.tar.gz |
1360: 20 24 7b 54 41 52 7d 20 2d 2d 73 74 72 69 70 2d   ${TAR} --strip-
1370: 63 6f 6d 70 6f 6e 65 6e 74 73 20 33 20 2d 2d 77  components 3 --w
1380: 69 6c 64 63 61 72 64 73 20 2d 78 20 2d 7a 20 2d  ildcards -x -z -
1390: 66 20 2d 20 22 50 4b 43 53 31 31 5f 74 6f 6b 65  f - "PKCS11_toke
13a0: 6e 64 2d 2a 2f 70 72 65 62 75 69 6c 74 2f 6c 65  nd-*/prebuilt/le
13b0: 6f 70 61 72 64 2f 50 4b 43 53 31 31 2e 74 6f 6b  opard/PKCS11.tok
13c0: 65 6e 64 22 0a 09 09 6d 76 20 50 4b 43 53 31 31  end"...mv PKCS11
13d0: 2e 74 6f 6b 65 6e 64 20 62 75 69 6c 64 2f 63 61  .tokend build/ca
13e0: 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 50  ckey_osx_build/P
13f0: 4b 43 53 31 31 2e 74 6f 6b 65 6e 64 0a 09 65 6c  KCS11.tokend..el
1400: 73 65 0a 09 09 63 75 72 6c 20 68 74 74 70 3a 2f  se...curl http:/
1410: 2f 64 65 76 65 6c 2e 6b 76 61 6e 61 6c 73 2e 6f  /devel.kvanals.o
1420: 72 67 2f 50 4b 43 53 31 31 5f 54 6f 6b 65 6e 64  rg/PKCS11_Tokend
1430: 2f 50 4b 43 53 31 31 5f 74 6f 6b 65 6e 64 2d 6c  /PKCS11_tokend-l
1440: 61 74 65 73 74 2e 74 61 72 2e 67 7a 20 7c 20 24  atest.tar.gz | $
1450: 7b 54 41 52 7d 20 2d 2d 73 74 72 69 70 2d 63 6f  {TAR} --strip-co
1460: 6d 70 6f 6e 65 6e 74 73 20 33 20 2d 2d 77 69 6c  mponents 3 --wil
1470: 64 63 61 72 64 73 20 2d 78 20 2d 7a 20 2d 66 20  dcards -x -z -f 
1480: 2d 20 22 50 4b 43 53 31 31 5f 74 6f 6b 65 6e 64  - "PKCS11_tokend
1490: 2d 2a 2f 70 72 65 62 75 69 6c 74 2f 73 6e 6f 77  -*/prebuilt/snow
14a0: 6c 65 6f 70 61 72 64 2f 50 4b 43 53 31 31 2e 74  leopard/PKCS11.t
14b0: 6f 6b 65 6e 64 22 0a 09 09 6d 76 20 50 4b 43 53  okend"...mv PKCS
14c0: 31 31 2e 74 6f 6b 65 6e 64 20 62 75 69 6c 64 2f  11.tokend build/
14d0: 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64  cackey_osx_build
14e0: 2f 50 4b 43 53 31 31 2e 74 6f 6b 65 6e 64 0a 09  /PKCS11.tokend..
14f0: 66 69 0a 09 66 6f 72 20 50 4d 44 4f 43 20 69 6e  fi..for PMDOC in
1500: 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73   build/cackey_os
1510: 78 5f 62 75 69 6c 64 2f 54 65 6d 70 6c 61 74 65  x_build/Template
1520: 5f 70 6d 62 75 69 6c 64 2f 2a 2e 69 6e 3b 20 64  _pmbuild/*.in; d
1530: 6f 0a 09 09 50 4d 44 4f 43 3d 22 60 65 63 68 6f  o...PMDOC="`echo
1540: 20 22 24 7b 50 4d 44 4f 43 7d 22 20 7c 20 73 65   "${PMDOC}" | se
1550: 64 20 27 73 7c 6c 2e 69 6e 7c 6c 7c 67 27 20 7c  d 's|l.in|l|g' |
1560: 20 73 65 64 20 27 73 7c 62 75 69 6c 64 2f 63 61   sed 's|build/ca
1570: 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 54  ckey_osx_build/T
1580: 65 6d 70 6c 61 74 65 5f 70 6d 62 75 69 6c 64 2f  emplate_pmbuild/
1590: 7c 7c 67 27 60 22 0a 09 09 55 55 49 44 3d 22 60  ||g'`"...UUID="`
15a0: 70 79 74 68 6f 6e 20 2d 63 20 27 69 6d 70 6f 72  python -c 'impor
15b0: 74 20 75 75 69 64 3b 20 70 72 69 6e 74 20 75 75  t uuid; print uu
15c0: 69 64 2e 75 75 69 64 31 28 29 27 20 7c 20 64 64  id.uuid1()' | dd
15d0: 20 63 6f 6e 76 3d 75 63 61 73 65 20 32 3e 2f 64   conv=ucase 2>/d
15e0: 65 76 2f 6e 75 6c 6c 60 22 0a 09 09 6d 6b 64 69  ev/null`"...mkdi
15f0: 72 20 2d 70 20 62 75 69 6c 64 2f 63 61 63 6b 65  r -p build/cacke
1600: 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53  y_osx_build/${OS
1610: 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63  X}_pmbuild.pmdoc
1620: 0a 09 09 73 65 64 20 22 73 7c 40 40 42 55 49 4c  ...sed "s|@@BUIL
1630: 44 52 4f 4f 54 44 49 52 40 40 7c 24 28 70 77 64  DROOTDIR@@|$(pwd
1640: 29 7c 67 22 20 62 75 69 6c 64 2f 63 61 63 6b 65  )|g" build/cacke
1650: 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 54 65 6d 70  y_osx_build/Temp
1660: 6c 61 74 65 5f 70 6d 62 75 69 6c 64 2f 24 7b 50  late_pmbuild/${P
1670: 4d 44 4f 43 7d 2e 69 6e 20 3e 20 62 75 69 6c 64  MDOC}.in > build
1680: 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c  /cackey_osx_buil
1690: 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64  d/${OSX}_pmbuild
16a0: 2e 70 6d 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d 0a  .pmdoc/${PMDOC}.
16b0: 09 09 73 65 64 20 22 73 7c 40 40 4f 53 58 56 45  ..sed "s|@@OSXVE
16c0: 52 53 49 4f 4e 40 40 7c 24 7b 4f 53 58 7d 7c 67  RSION@@|${OSX}|g
16d0: 22 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f  " build/cackey_o
16e0: 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f  sx_build/${OSX}_
16f0: 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f 24 7b  pmbuild.pmdoc/${
1700: 50 4d 44 4f 43 7d 20 3e 20 62 75 69 6c 64 2f 63  PMDOC} > build/c
1710: 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f  ackey_osx_build/
1720: 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70  ${OSX}_pmbuild.p
1730: 6d 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d 2e 31 0a  mdoc/${PMDOC}.1.
1740: 09 09 73 65 64 20 22 73 7c 40 40 55 55 49 44 40  ..sed "s|@@UUID@
1750: 40 7c 24 7b 55 55 49 44 7d 7c 67 22 20 62 75 69  @|${UUID}|g" bui
1760: 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75  ld/cackey_osx_bu
1770: 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69  ild/${OSX}_pmbui
1780: 6c 64 2e 70 6d 64 6f 63 2f 24 7b 50 4d 44 4f 43  ld.pmdoc/${PMDOC
1790: 7d 2e 31 20 3e 20 62 75 69 6c 64 2f 63 61 63 6b  }.1 > build/cack
17a0: 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f  ey_osx_build/${O
17b0: 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f  SX}_pmbuild.pmdo
17c0: 63 2f 24 7b 50 4d 44 4f 43 7d 0a 09 09 73 65 64  c/${PMDOC}...sed
17d0: 20 22 73 7c 40 40 54 41 52 47 45 54 4f 53 40 40   "s|@@TARGETOS@@
17e0: 7c 24 7b 50 4b 54 41 52 47 45 54 4f 53 7d 7c 67  |${PKTARGETOS}|g
17f0: 22 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f  " build/cackey_o
1800: 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f  sx_build/${OSX}_
1810: 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f 24 7b  pmbuild.pmdoc/${
1820: 50 4d 44 4f 43 7d 20 3e 20 62 75 69 6c 64 2f 63  PMDOC} > build/c
1830: 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f  ackey_osx_build/
1840: 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70  ${OSX}_pmbuild.p
1850: 6d 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d 2e 31 0a  mdoc/${PMDOC}.1.
1860: 09 09 73 65 64 20 22 73 7c 40 40 4e 45 58 54 4f  ..sed "s|@@NEXTO
1870: 53 58 56 45 52 40 40 7c 24 7b 4e 45 58 54 4f 53  SXVER@@|${NEXTOS
1880: 58 56 45 52 7d 7c 67 22 20 62 75 69 6c 64 2f 63  XVER}|g" build/c
1890: 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f  ackey_osx_build/
18a0: 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70  ${OSX}_pmbuild.p
18b0: 6d 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d 2e 31 20  mdoc/${PMDOC}.1 
18c0: 3e 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f  > build/cackey_o
18d0: 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f  sx_build/${OSX}_
18e0: 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f 24 7b  pmbuild.pmdoc/${
18f0: 50 4d 44 4f 43 7d 0a 09 09 73 65 64 20 22 73 7c  PMDOC}...sed "s|
1900: 40 40 43 55 52 4f 53 58 56 45 52 40 40 7c 24 7b  @@CUROSXVER@@|${
1910: 43 55 52 4f 53 58 56 45 52 7d 7c 67 22 20 62 75  CUROSXVER}|g" bu
1920: 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62  ild/cackey_osx_b
1930: 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75  uild/${OSX}_pmbu
1940: 69 6c 64 2e 70 6d 64 6f 63 2f 24 7b 50 4d 44 4f  ild.pmdoc/${PMDO
1950: 43 7d 20 3e 20 62 75 69 6c 64 2f 63 61 63 6b 65  C} > build/cacke
1960: 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53  y_osx_build/${OS
1970: 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63  X}_pmbuild.pmdoc
1980: 2f 24 7b 50 4d 44 4f 43 7d 2e 31 0a 09 09 73 65  /${PMDOC}.1...se
1990: 64 20 22 73 7c 40 40 4c 49 42 43 41 43 4b 45 59  d "s|@@LIBCACKEY
19a0: 47 40 40 7c 24 7b 4c 49 42 43 41 43 4b 45 59 47  G@@|${LIBCACKEYG
19b0: 7d 7c 67 22 20 62 75 69 6c 64 2f 63 61 63 6b 65  }|g" build/cacke
19c0: 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53  y_osx_build/${OS
19d0: 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63  X}_pmbuild.pmdoc
19e0: 2f 24 7b 50 4d 44 4f 43 7d 2e 31 20 3e 20 62 75  /${PMDOC}.1 > bu
19f0: 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62  ild/cackey_osx_b
1a00: 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75  uild/${OSX}_pmbu
1a10: 69 6c 64 2e 70 6d 64 6f 63 2f 24 7b 50 4d 44 4f  ild.pmdoc/${PMDO
1a20: 43 7d 0a 09 09 63 70 20 62 75 69 6c 64 2f 63 61  C}...cp build/ca
1a30: 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24  ckey_osx_build/$
1a40: 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d  {OSX}_pmbuild.pm
1a50: 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d 20 62 75 69  doc/${PMDOC} bui
1a60: 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75  ld/cackey_osx_bu
1a70: 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69  ild/${OSX}_pmbui
1a80: 6c 64 2e 70 6d 64 6f 63 2f 24 7b 50 4d 44 4f 43  ld.pmdoc/${PMDOC
1a90: 7d 2e 31 0a 09 09 6d 76 20 62 75 69 6c 64 2f 63  }.1...mv build/c
1aa0: 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f  ackey_osx_build/
1ab0: 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70  ${OSX}_pmbuild.p
1ac0: 6d 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d 2e 31 20  mdoc/${PMDOC}.1 
1ad0: 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78  build/cackey_osx
1ae0: 5f 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d  _build/${OSX}_pm
1af0: 62 75 69 6c 64 2e 70 6d 64 6f 63 2f 24 7b 50 4d  build.pmdoc/${PM
1b00: 44 4f 43 7d 0a 09 64 6f 6e 65 0a 09 45 58 54 3d  DOC}..done..EXT=
1b10: 70 6b 67 0a 09 69 66 20 5b 20 24 7b 4f 53 58 7d  pkg..if [ ${OSX}
1b20: 20 3d 3d 20 22 53 6e 6f 77 6c 65 6f 70 61 72 64   == "Snowleopard
1b30: 22 20 5d 3b 20 74 68 65 6e 0a 09 09 63 61 74 20  " ]; then...cat 
1b40: 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78  build/cackey_osx
1b50: 5f 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d  _build/${OSX}_pm
1b60: 62 75 69 6c 64 2e 70 6d 64 6f 63 2f 69 6e 64 65  build.pmdoc/inde
1b70: 78 2e 78 6d 6c 20 7c 20 73 65 64 20 27 73 7c 66  x.xml | sed 's|f
1b80: 6f 72 20 4d 61 63 20 4f 53 20 58 20 53 6e 6f 77  or Mac OS X Snow
1b90: 6c 65 6f 70 61 72 64 7c 66 6f 72 20 4d 61 63 20  leopard|for Mac 
1ba0: 4f 53 20 58 20 53 6e 6f 77 4c 65 6f 70 61 72 64  OS X SnowLeopard
1bb0: 7c 67 27 20 3e 20 62 75 69 6c 64 2f 63 61 63 6b  |g' > build/cack
1bc0: 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f  ey_osx_build/${O
1bd0: 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f  SX}_pmbuild.pmdo
1be0: 63 2f 69 6e 64 65 78 2e 78 6d 6c 2e 6e 65 77 0a  c/index.xml.new.
1bf0: 09 09 6d 76 20 62 75 69 6c 64 2f 63 61 63 6b 65  ..mv build/cacke
1c00: 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53  y_osx_build/${OS
1c10: 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63  X}_pmbuild.pmdoc
1c20: 2f 69 6e 64 65 78 2e 78 6d 6c 2e 6e 65 77 20 62  /index.xml.new b
1c30: 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f  uild/cackey_osx_
1c40: 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62  build/${OSX}_pmb
1c50: 75 69 6c 64 2e 70 6d 64 6f 63 2f 69 6e 64 65 78  uild.pmdoc/index
1c60: 2e 78 6d 6c 0a 09 66 69 0a 09 2f 44 65 76 65 6c  .xml..fi../Devel
1c70: 6f 70 65 72 2f 41 70 70 6c 69 63 61 74 69 6f 6e  oper/Application
1c80: 73 2f 55 74 69 6c 69 74 69 65 73 2f 50 61 63 6b  s/Utilities/Pack
1c90: 61 67 65 4d 61 6b 65 72 2e 61 70 70 2f 43 6f 6e  ageMaker.app/Con
1ca0: 74 65 6e 74 73 2f 4d 61 63 4f 53 2f 50 61 63 6b  tents/MacOS/Pack
1cb0: 61 67 65 4d 61 6b 65 72 20 2d 64 20 62 75 69 6c  ageMaker -d buil
1cc0: 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69  d/cackey_osx_bui
1cd0: 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c  ld/${OSX}_pmbuil
1ce0: 64 2e 70 6d 64 6f 63 20 2d 6f 20 6d 61 63 62 75  d.pmdoc -o macbu
1cf0: 69 6c 64 2f 70 6b 67 2f 43 41 43 4b 65 79 5f 24  ild/pkg/CACKey_$
1d00: 7b 43 41 43 4b 45 59 5f 56 45 52 53 49 4f 4e 7d  {CACKEY_VERSION}
1d10: 5f 24 7b 4f 53 58 7d 2e 24 7b 45 58 54 7d 0a 09  _${OSX}.${EXT}..
1d20: 74 61 72 20 2d 2d 63 72 65 61 74 65 20 2d 2d 64  tar --create --d
1d30: 69 72 65 63 74 6f 72 79 20 6d 61 63 62 75 69 6c  irectory macbuil
1d40: 64 2f 70 6b 67 2f 20 2d 2d 66 69 6c 65 20 6d 61  d/pkg/ --file ma
1d50: 63 62 75 69 6c 64 2f 70 6b 67 2f 43 41 43 4b 65  cbuild/pkg/CACKe
1d60: 79 5f 24 7b 43 41 43 4b 45 59 5f 56 45 52 53 49  y_${CACKEY_VERSI
1d70: 4f 4e 7d 5f 24 7b 4f 53 58 7d 2e 24 7b 45 58 54  ON}_${OSX}.${EXT
1d80: 7d 2e 74 61 72 20 43 41 43 4b 65 79 5f 24 7b 43  }.tar 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 67 7a  {OSX}.${EXT}..gz
1db0: 69 70 20 2d 39 20 6d 61 63 62 75 69 6c 64 2f 70  ip -9 macbuild/p
1dc0: 6b 67 2f 43 41 43 4b 65 79 5f 24 7b 43 41 43 4b  kg/CACKey_${CACK
1dd0: 45 59 5f 56 45 52 53 49 4f 4e 7d 5f 24 7b 4f 53  EY_VERSION}_${OS
1de0: 58 7d 2e 24 7b 45 58 54 7d 2e 74 61 72 0a 09 72  X}.${EXT}.tar..r
1df0: 6d 20 2d 72 66 20 6d 61 63 62 75 69 6c 64 2f 70  m -rf macbuild/p
1e00: 6b 67 2f 43 41 43 4b 65 79 5f 24 7b 43 41 43 4b  kg/CACKey_${CACK
1e10: 45 59 5f 56 45 52 53 49 4f 4e 7d 5f 24 7b 4f 53  EY_VERSION}_${OS
1e20: 58 7d 2e 24 7b 45 58 54 7d 0a 09 72 6d 20 2d 66  X}.${EXT}..rm -f
1e30: 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73   build/cackey_os
1e40: 78 5f 62 75 69 6c 64 2f 63 61 63 6b 65 79 2e 64  x_build/cackey.d
1e50: 79 6c 69 62 0a 09 72 6d 20 2d 72 66 20 62 75 69  ylib..rm -rf bui
1e60: 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75  ld/cackey_osx_bu
1e70: 69 6c 64 2f 50 4b 43 53 31 31 2e 74 6f 6b 65 6e  ild/PKCS11.token
1e80: 64 0a 09 65 63 68 6f 20 22 24 7b 4f 53 58 7d 20  d..echo "${OSX} 
1e90: 62 75 69 6c 64 20 63 6f 6d 70 6c 65 74 65 22 0a  build complete".
1ea0: 7d 0a 0a 23 20 54 61 6b 65 20 63 6f 6d 6d 61 6e  }..# Take comman
1eb0: 64 20 6c 69 6e 65 20 61 72 67 75 6d 65 6e 74 73  d line arguments
1ec0: 20 61 6e 64 20 65 78 65 63 75 74 65 0a 63 61 73   and execute.cas
1ed0: 65 20 22 24 31 22 20 69 6e 0a 09 22 22 29 0a 09  e "$1" in.."")..
1ee0: 09 75 73 61 67 65 0a 09 09 65 78 69 74 20 24 3f  .usage...exit $?
1ef0: 0a 09 3b 3b 0a 0a 09 22 6c 65 6f 70 61 72 64 22  ..;;..."leopard"
1f00: 29 0a 09 09 2e 2f 61 75 74 6f 67 65 6e 2e 73 68  )..../autogen.sh
1f10: 0a 09 09 6c 65 6f 70 61 72 64 0a 09 09 65 78 69  ...leopard...exi
1f20: 74 20 24 3f 0a 09 3b 3b 0a 0a 09 22 73 6e 6f 77  t $?..;;..."snow
1f30: 6c 65 6f 70 61 72 64 22 29 0a 09 09 2e 2f 61 75  leopard")..../au
1f40: 74 6f 67 65 6e 2e 73 68 0a 09 09 73 6e 6f 77 6c  togen.sh...snowl
1f50: 65 6f 70 61 72 64 0a 09 09 65 78 69 74 20 24 3f  eopard...exit $?
1f60: 0a 09 3b 3b 0a 09 0a 09 22 6c 69 6f 6e 22 29 0a  ..;;...."lion").
1f70: 09 09 2e 2f 61 75 74 6f 67 65 6e 2e 73 68 0a 09  .../autogen.sh..
1f80: 09 6c 69 6f 6e 0a 09 09 65 78 69 74 20 24 3f 0a  .lion...exit $?.
1f90: 09 3b 3b 0a 0a 09 22 61 6c 6c 22 29 0a 09 09 2e  .;;..."all")....
1fa0: 2f 61 75 74 6f 67 65 6e 2e 73 68 0a 09 09 6c 65  /autogen.sh...le
1fb0: 6f 70 61 72 64 0a 09 09 73 6e 6f 77 6c 65 6f 70  opard...snowleop
1fc0: 61 72 64 0a 09 09 6c 69 6f 6e 0a 09 09 65 63 68  ard...lion...ech
1fd0: 6f 20 22 22 0a 09 09 65 63 68 6f 20 22 41 6c 6c  o ""...echo "All
1fe0: 20 62 75 69 6c 64 73 20 63 6f 6d 70 6c 65 74 65   builds complete
1ff0: 2e 22 0a 09 09 65 78 69 74 20 24 3f 0a 09 3b 3b  ."...exit $?..;;
2000: 0a 0a 09 22 63 6c 65 61 6e 22 29 0a 09 09 63 6c  ..."clean")...cl
2010: 65 61 6e 0a 09 09 65 78 69 74 20 24 3f 0a 09 3b  ean...exit $?..;
2020: 3b 0a 0a 09 2a 29 0a 09 09 75 73 61 67 65 0a 09  ;...*)...usage..
2030: 09 65 78 69 74 20 24 3f 0a 09 3b 3b 0a 65 73 61  .exit $?..;;.esa
2040: 63 20 0a                                         c .