Hex Artifact Content

Artifact 2a19e4db4639151cf8ba272ae3383bc1daef96cd:


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 47 65 6e 65 72  build.}..# Gener
0d60: 69 63 20 62 75 69 6c 64 20 66 75 6e 63 74 69 6f  ic build functio
0d70: 6e 0a 67 65 6e 62 75 69 6c 64 28 29 20 7b 0a 09  n.genbuild() {..
0d80: 6d 61 6b 65 20 64 69 73 74 63 6c 65 61 6e 0a 09  make distclean..
0d90: 41 52 43 48 3d 60 65 63 68 6f 20 24 7b 48 4f 53  ARCH=`echo ${HOS
0da0: 54 7d 20 7c 20 63 75 74 20 2d 64 20 22 2d 22 20  T} | cut -d "-" 
0db0: 2d 66 20 31 60 0a 09 69 66 20 5b 20 24 7b 41 52  -f 1`..if [ ${AR
0dc0: 43 48 7d 20 3d 3d 20 22 70 6f 77 65 72 70 63 22  CH} == "powerpc"
0dd0: 20 5d 3b 20 74 68 65 6e 0a 09 09 69 66 20 5b 20   ]; then...if [ 
0de0: 24 7b 4f 53 58 7d 20 3d 3d 20 22 4c 65 6f 70 61  ${OSX} == "Leopa
0df0: 72 64 22 20 5d 3b 20 74 68 65 6e 0a 09 09 09 41  rd" ]; then....A
0e00: 52 43 48 3d 22 70 70 63 20 2d 6d 63 70 75 3d 47  RCH="ppc -mcpu=G
0e10: 34 22 0a 09 09 65 6c 73 65 0a 09 09 09 41 52 43  4"...else....ARC
0e20: 48 3d 22 70 70 63 20 2d 6d 63 70 75 3d 47 33 22  H="ppc -mcpu=G3"
0e30: 0a 09 09 66 69 0a 09 66 69 0a 09 69 66 20 5b 20  ...fi..fi..if [ 
0e40: 22 24 7b 4c 49 4f 4e 42 55 49 4c 44 7d 22 20 3d  "${LIONBUILD}" =
0e50: 20 31 20 5d 3b 20 74 68 65 6e 0a 09 09 69 66 20   1 ]; then...if 
0e60: 5b 20 22 24 7b 41 52 43 48 7d 22 20 3d 3d 20 22  [ "${ARCH}" == "
0e70: 70 70 63 20 2d 6d 63 70 75 3d 47 34 22 20 5d 3b  ppc -mcpu=G4" ];
0e80: 20 74 68 65 6e 0a 09 09 09 43 43 3d 70 6f 77 65   then....CC=powe
0e90: 72 70 63 2d 61 70 70 6c 65 2d 64 61 72 77 69 6e  rpc-apple-darwin
0ea0: 31 31 2d 67 63 63 2d 34 2e 32 2e 31 20 43 50 50  11-gcc-4.2.1 CPP
0eb0: 3d 70 6f 77 65 72 70 63 2d 61 70 70 6c 65 2d 64  =powerpc-apple-d
0ec0: 61 72 77 69 6e 31 31 2d 63 70 70 2d 34 2e 32 2e  arwin11-cpp-4.2.
0ed0: 31 20 43 46 4c 41 47 53 3d 22 2d 6d 33 32 20 2d  1 CFLAGS="-m32 -
0ee0: 49 2f 44 65 76 65 6c 6f 70 65 72 2f 50 6c 61 74  I/Developer/Plat
0ef0: 66 6f 72 6d 73 2f 69 50 68 6f 6e 65 4f 53 2e 70  forms/iPhoneOS.p
0f00: 6c 61 74 66 6f 72 6d 2f 44 65 76 65 6c 6f 70 65  latform/Develope
0f10: 72 2f 75 73 72 2f 6c 69 62 2f 67 63 63 2f 70 6f  r/usr/lib/gcc/po
0f20: 77 65 72 70 63 2d 61 70 70 6c 65 2d 64 61 72 77  werpc-apple-darw
0f30: 69 6e 31 30 2f 34 2e 32 2e 31 2f 69 6e 63 6c 75  in10/4.2.1/inclu
0f40: 64 65 20 2d 69 73 79 73 72 6f 6f 74 20 2f 44 65  de -isysroot /De
0f50: 76 65 6c 6f 70 65 72 2f 53 44 4b 73 2f 4d 61 63  veloper/SDKs/Mac
0f60: 4f 53 58 31 30 2e 35 2e 73 64 6b 22 20 43 50 50  OSX10.5.sdk" CPP
0f70: 46 4c 41 47 53 3d 22 2d 44 5f 4c 49 42 43 5f 4c  FLAGS="-D_LIBC_L
0f80: 49 4d 49 54 53 5f 48 5f 22 20 2e 2f 63 6f 6e 66  IMITS_H_" ./conf
0f90: 69 67 75 72 65 20 2d 2d 77 69 74 68 2d 70 63 73  igure --with-pcs
0fa0: 63 2d 68 65 61 64 65 72 73 3d 24 7b 48 45 41 44  c-headers=${HEAD
0fb0: 45 52 53 7d 20 2d 2d 77 69 74 68 2d 70 63 73 63  ERS} --with-pcsc
0fc0: 2d 6c 69 62 73 3d 24 7b 4c 49 42 52 41 52 59 7d  -libs=${LIBRARY}
0fd0: 20 2d 2d 68 6f 73 74 3d 24 7b 48 4f 53 54 7d 20   --host=${HOST} 
0fe0: 2d 2d 65 6e 61 62 6c 65 2d 64 6f 64 2d 63 65 72  --enable-dod-cer
0ff0: 74 73 2d 6f 6e 2d 68 77 2d 73 6c 6f 74 73 0a 09  ts-on-hw-slots..
1000: 09 65 6c 73 65 0a 09 09 09 43 46 4c 41 47 53 3d  .else....CFLAGS=
1010: 22 2d 61 72 63 68 20 24 7b 41 52 43 48 7d 22 20  "-arch ${ARCH}" 
1020: 2e 2f 63 6f 6e 66 69 67 75 72 65 20 2d 2d 77 69  ./configure --wi
1030: 74 68 2d 70 63 73 63 2d 68 65 61 64 65 72 73 3d  th-pcsc-headers=
1040: 24 7b 48 45 41 44 45 52 53 7d 20 2d 2d 77 69 74  ${HEADERS} --wit
1050: 68 2d 70 63 73 63 2d 6c 69 62 73 3d 24 7b 4c 49  h-pcsc-libs=${LI
1060: 42 52 41 52 59 7d 20 2d 2d 68 6f 73 74 3d 24 7b  BRARY} --host=${
1070: 48 4f 53 54 7d 20 2d 2d 65 6e 61 62 6c 65 2d 64  HOST} --enable-d
1080: 6f 64 2d 63 65 72 74 73 2d 6f 6e 2d 68 77 2d 73  od-certs-on-hw-s
1090: 6c 6f 74 73 0a 09 09 66 69 0a 09 65 6c 73 65 0a  lots...fi..else.
10a0: 09 09 43 46 4c 41 47 53 3d 22 2d 61 72 63 68 20  ..CFLAGS="-arch 
10b0: 24 7b 41 52 43 48 7d 22 20 2e 2f 63 6f 6e 66 69  ${ARCH}" ./confi
10c0: 67 75 72 65 20 2d 2d 77 69 74 68 2d 70 63 73 63  gure --with-pcsc
10d0: 2d 68 65 61 64 65 72 73 3d 24 7b 48 45 41 44 45  -headers=${HEADE
10e0: 52 53 7d 20 2d 2d 77 69 74 68 2d 70 63 73 63 2d  RS} --with-pcsc-
10f0: 6c 69 62 73 3d 24 7b 4c 49 42 52 41 52 59 7d 20  libs=${LIBRARY} 
1100: 2d 2d 68 6f 73 74 3d 24 7b 48 4f 53 54 7d 20 2d  --host=${HOST} -
1110: 2d 65 6e 61 62 6c 65 2d 64 6f 64 2d 63 65 72 74  -enable-dod-cert
1120: 73 2d 6f 6e 2d 68 77 2d 73 6c 6f 74 73 0a 09 66  s-on-hw-slots..f
1130: 69 0a 09 6d 61 6b 65 0a 09 63 70 20 6c 69 62 63  i..make..cp libc
1140: 61 63 6b 65 79 2e 64 79 6c 69 62 20 6d 61 63 62  ackey.dylib macb
1150: 75 69 6c 64 2f 24 7b 4f 53 58 7d 2f 6c 69 62 63  uild/${OSX}/libc
1160: 61 63 6b 65 79 2e 64 79 6c 69 62 2e 60 65 63 68  ackey.dylib.`ech
1170: 6f 20 24 7b 41 52 43 48 7d 20 7c 20 63 75 74 20  o ${ARCH} | cut 
1180: 2d 64 20 27 20 27 20 2d 66 20 31 60 0a 09 63 70  -d ' ' -f 1`..cp
1190: 20 6c 69 62 63 61 63 6b 65 79 5f 67 2e 64 79 6c   libcackey_g.dyl
11a0: 69 62 20 6d 61 63 62 75 69 6c 64 2f 24 7b 4f 53  ib macbuild/${OS
11b0: 58 7d 2f 6c 69 62 63 61 63 6b 65 79 5f 67 2e 64  X}/libcackey_g.d
11c0: 79 6c 69 62 2e 60 65 63 68 6f 20 24 7b 41 52 43  ylib.`echo ${ARC
11d0: 48 7d 20 7c 20 63 75 74 20 2d 64 20 27 20 27 20  H} | cut -d ' ' 
11e0: 2d 66 20 31 60 20 0a 7d 0a 0a 23 20 4c 69 62 72  -f 1` .}..# Libr
11f0: 61 72 79 20 62 75 69 6c 64 20 66 75 6e 63 74 69  ary build functi
1200: 6f 6e 0a 6c 69 62 62 75 69 6c 64 28 29 20 7b 0a  on.libbuild() {.
1210: 09 66 6f 72 20 4c 49 42 20 69 6e 20 6d 61 63 62  .for LIB in macb
1220: 75 69 6c 64 2f 24 7b 4f 53 58 7d 2f 6c 69 62 63  uild/${OSX}/libc
1230: 61 63 6b 65 79 2e 64 79 6c 69 62 2e 2a 3b 20 64  ackey.dylib.*; d
1240: 6f 0a 09 09 41 52 43 48 4c 49 53 54 3d 22 24 7b  o...ARCHLIST="${
1250: 41 52 43 48 4c 49 53 54 7d 20 60 65 63 68 6f 20  ARCHLIST} `echo 
1260: 27 2d 61 72 63 68 20 27 60 20 60 65 63 68 6f 20  '-arch '` `echo 
1270: 24 7b 4c 49 42 7d 20 7c 20 63 75 74 20 2d 64 20  ${LIB} | cut -d 
1280: 2e 20 2d 66 20 33 60 20 60 65 63 68 6f 20 27 20  . -f 3` `echo ' 
1290: 27 60 20 60 65 63 68 6f 20 24 7b 4c 49 42 7d 60  '` `echo ${LIB}`
12a0: 22 0a 09 64 6f 6e 65 0a 09 6c 69 70 6f 20 2d 63  "..done..lipo -c
12b0: 72 65 61 74 65 20 24 7b 41 52 43 48 4c 49 53 54  reate ${ARCHLIST
12c0: 7d 20 2d 6f 75 74 70 75 74 20 6d 61 63 62 75 69  } -output macbui
12d0: 6c 64 2f 24 7b 4f 53 58 7d 2f 6c 69 62 63 61 63  ld/${OSX}/libcac
12e0: 6b 65 79 2e 64 79 6c 69 62 0a 09 66 6f 72 20 44  key.dylib..for D
12f0: 4c 49 42 20 69 6e 20 6d 61 63 62 75 69 6c 64 2f  LIB in macbuild/
1300: 24 7b 4f 53 58 7d 2f 6c 69 62 63 61 63 6b 65 79  ${OSX}/libcackey
1310: 5f 67 2e 64 79 6c 69 62 2e 2a 3b 20 64 6f 0a 09  _g.dylib.*; do..
1320: 09 44 41 52 43 48 4c 49 53 54 3d 22 24 7b 44 41  .DARCHLIST="${DA
1330: 52 43 48 4c 49 53 54 7d 20 60 65 63 68 6f 20 27  RCHLIST} `echo '
1340: 2d 61 72 63 68 20 27 60 20 60 65 63 68 6f 20 24  -arch '` `echo $
1350: 7b 44 4c 49 42 7d 20 7c 20 63 75 74 20 2d 64 20  {DLIB} | cut -d 
1360: 2e 20 2d 66 20 33 60 20 60 65 63 68 6f 20 27 20  . -f 3` `echo ' 
1370: 27 60 20 60 65 63 68 6f 20 24 7b 44 4c 49 42 7d  '` `echo ${DLIB}
1380: 60 22 0a 09 64 6f 6e 65 0a 09 6c 69 70 6f 20 2d  `"..done..lipo -
1390: 63 72 65 61 74 65 20 24 7b 44 41 52 43 48 4c 49  create ${DARCHLI
13a0: 53 54 7d 20 2d 6f 75 74 70 75 74 20 6d 61 63 62  ST} -output macb
13b0: 75 69 6c 64 2f 24 7b 4f 53 58 7d 2f 6c 69 62 63  uild/${OSX}/libc
13c0: 61 63 6b 65 79 5f 67 2e 64 79 6c 69 62 0a 09 72  ackey_g.dylib..r
13d0: 6d 20 6d 61 63 62 75 69 6c 64 2f 24 7b 4f 53 58  m macbuild/${OSX
13e0: 7d 2f 6c 69 62 63 61 63 6b 65 79 2a 2e 64 79 6c  }/libcackey*.dyl
13f0: 69 62 2e 2a 0a 7d 0a 0a 23 20 46 75 6e 63 74 69  ib.*.}..# Functi
1400: 6f 6e 20 74 6f 20 62 75 69 6c 64 20 4d 61 63 20  on to build Mac 
1410: 4f 53 20 58 20 50 61 63 6b 61 67 65 73 0a 70 6b  OS X Packages.pk
1420: 67 62 75 69 6c 64 28 29 20 7b 0a 09 69 66 20 5b  gbuild() {..if [
1430: 20 22 60 75 6e 61 6d 65 20 2d 72 20 7c 20 63 75   "`uname -r | cu
1440: 74 20 2d 64 20 2e 20 2d 66 20 31 60 22 20 2d 6c  t -d . -f 1`" -l
1450: 74 20 22 31 30 22 20 5d 3b 20 74 68 65 6e 0a 09  t "10" ]; then..
1460: 09 4c 49 42 43 41 43 4b 45 59 47 3d 6c 69 62 63  .LIBCACKEYG=libc
1470: 61 63 6b 65 79 67 2e 70 6b 67 0a 09 65 6c 73 65  ackeyg.pkg..else
1480: 0a 09 09 4c 49 42 43 41 43 4b 45 59 47 3d 6c 69  ...LIBCACKEYG=li
1490: 62 63 61 63 6b 65 79 5f 67 2e 70 6b 67 0a 09 66  bcackey_g.pkg..f
14a0: 69 0a 09 72 6d 20 2d 66 20 62 75 69 6c 64 2f 63  i..rm -f build/c
14b0: 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f  ackey_osx_build/
14c0: 63 61 63 6b 65 79 2e 64 79 6c 69 62 0a 09 6c 6e  cackey.dylib..ln
14d0: 20 6d 61 63 62 75 69 6c 64 2f 24 7b 4f 53 58 7d   macbuild/${OSX}
14e0: 2f 6c 69 62 63 61 63 6b 65 79 2e 64 79 6c 69 62  /libcackey.dylib
14f0: 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73   build/cackey_os
1500: 78 5f 62 75 69 6c 64 2f 63 61 63 6b 65 79 2e 64  x_build/cackey.d
1510: 79 6c 69 62 0a 09 72 6d 20 2d 72 66 20 62 75 69  ylib..rm -rf bui
1520: 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75  ld/cackey_osx_bu
1530: 69 6c 64 2f 50 4b 43 53 31 31 2e 74 6f 6b 65 6e  ild/PKCS11.token
1540: 64 0a 09 69 66 20 5b 20 22 24 7b 4c 49 4f 4e 42  d..if [ "${LIONB
1550: 55 49 4c 44 7d 22 20 3d 20 31 20 5d 3b 20 74 68  UILD}" = 1 ]; th
1560: 65 6e 0a 09 09 54 41 52 3d 67 6e 75 74 61 72 0a  en...TAR=gnutar.
1570: 09 65 6c 73 65 0a 09 09 54 41 52 3d 74 61 72 0a  .else...TAR=tar.
1580: 09 66 69 0a 09 69 66 20 5b 20 22 24 7b 4f 53 58  .fi..if [ "${OSX
1590: 7d 22 20 3d 20 22 4c 65 6f 70 61 72 64 22 20 5d  }" = "Leopard" ]
15a0: 3b 20 74 68 65 6e 0a 09 09 63 75 72 6c 20 68 74  ; then...curl ht
15b0: 74 70 3a 2f 2f 64 65 76 65 6c 2e 6b 76 61 6e 61  tp://devel.kvana
15c0: 6c 73 2e 6f 72 67 2f 50 4b 43 53 31 31 5f 54 6f  ls.org/PKCS11_To
15d0: 6b 65 6e 64 2f 50 4b 43 53 31 31 5f 74 6f 6b 65  kend/PKCS11_toke
15e0: 6e 64 2d 6c 61 74 65 73 74 2e 74 61 72 2e 67 7a  nd-latest.tar.gz
15f0: 20 7c 20 24 7b 54 41 52 7d 20 2d 2d 73 74 72 69   | ${TAR} --stri
1600: 70 2d 63 6f 6d 70 6f 6e 65 6e 74 73 20 33 20 2d  p-components 3 -
1610: 2d 77 69 6c 64 63 61 72 64 73 20 2d 78 20 2d 7a  -wildcards -x -z
1620: 20 2d 66 20 2d 20 22 50 4b 43 53 31 31 5f 74 6f   -f - "PKCS11_to
1630: 6b 65 6e 64 2d 2a 2f 70 72 65 62 75 69 6c 74 2f  kend-*/prebuilt/
1640: 6c 65 6f 70 61 72 64 2f 50 4b 43 53 31 31 2e 74  leopard/PKCS11.t
1650: 6f 6b 65 6e 64 22 0a 09 09 6d 76 20 50 4b 43 53  okend"...mv PKCS
1660: 31 31 2e 74 6f 6b 65 6e 64 20 62 75 69 6c 64 2f  11.tokend build/
1670: 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64  cackey_osx_build
1680: 2f 50 4b 43 53 31 31 2e 74 6f 6b 65 6e 64 0a 09  /PKCS11.tokend..
1690: 65 6c 73 65 0a 09 09 63 75 72 6c 20 68 74 74 70  else...curl http
16a0: 3a 2f 2f 64 65 76 65 6c 2e 6b 76 61 6e 61 6c 73  ://devel.kvanals
16b0: 2e 6f 72 67 2f 50 4b 43 53 31 31 5f 54 6f 6b 65  .org/PKCS11_Toke
16c0: 6e 64 2f 50 4b 43 53 31 31 5f 74 6f 6b 65 6e 64  nd/PKCS11_tokend
16d0: 2d 6c 61 74 65 73 74 2e 74 61 72 2e 67 7a 20 7c  -latest.tar.gz |
16e0: 20 24 7b 54 41 52 7d 20 2d 2d 73 74 72 69 70 2d   ${TAR} --strip-
16f0: 63 6f 6d 70 6f 6e 65 6e 74 73 20 33 20 2d 2d 77  components 3 --w
1700: 69 6c 64 63 61 72 64 73 20 2d 78 20 2d 7a 20 2d  ildcards -x -z -
1710: 66 20 2d 20 22 50 4b 43 53 31 31 5f 74 6f 6b 65  f - "PKCS11_toke
1720: 6e 64 2d 2a 2f 70 72 65 62 75 69 6c 74 2f 73 6e  nd-*/prebuilt/sn
1730: 6f 77 6c 65 6f 70 61 72 64 2f 50 4b 43 53 31 31  owleopard/PKCS11
1740: 2e 74 6f 6b 65 6e 64 22 0a 09 09 6d 76 20 50 4b  .tokend"...mv PK
1750: 43 53 31 31 2e 74 6f 6b 65 6e 64 20 62 75 69 6c  CS11.tokend buil
1760: 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69  d/cackey_osx_bui
1770: 6c 64 2f 50 4b 43 53 31 31 2e 74 6f 6b 65 6e 64  ld/PKCS11.tokend
1780: 0a 09 66 69 0a 09 66 6f 72 20 50 4d 44 4f 43 20  ..fi..for PMDOC 
1790: 69 6e 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f  in build/cackey_
17a0: 6f 73 78 5f 62 75 69 6c 64 2f 54 65 6d 70 6c 61  osx_build/Templa
17b0: 74 65 5f 70 6d 62 75 69 6c 64 2f 2a 2e 69 6e 3b  te_pmbuild/*.in;
17c0: 20 64 6f 0a 09 09 50 4d 44 4f 43 3d 22 60 65 63   do...PMDOC="`ec
17d0: 68 6f 20 22 24 7b 50 4d 44 4f 43 7d 22 20 7c 20  ho "${PMDOC}" | 
17e0: 73 65 64 20 27 73 7c 6c 2e 69 6e 7c 6c 7c 67 27  sed 's|l.in|l|g'
17f0: 20 7c 20 73 65 64 20 27 73 7c 62 75 69 6c 64 2f   | sed 's|build/
1800: 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64  cackey_osx_build
1810: 2f 54 65 6d 70 6c 61 74 65 5f 70 6d 62 75 69 6c  /Template_pmbuil
1820: 64 2f 7c 7c 67 27 60 22 0a 09 09 55 55 49 44 3d  d/||g'`"...UUID=
1830: 22 60 70 79 74 68 6f 6e 20 2d 63 20 27 69 6d 70  "`python -c 'imp
1840: 6f 72 74 20 75 75 69 64 3b 20 70 72 69 6e 74 20  ort uuid; print 
1850: 75 75 69 64 2e 75 75 69 64 31 28 29 27 20 7c 20  uuid.uuid1()' | 
1860: 64 64 20 63 6f 6e 76 3d 75 63 61 73 65 20 32 3e  dd conv=ucase 2>
1870: 2f 64 65 76 2f 6e 75 6c 6c 60 22 0a 09 09 6d 6b  /dev/null`"...mk
1880: 64 69 72 20 2d 70 20 62 75 69 6c 64 2f 63 61 63  dir -p build/cac
1890: 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b  key_osx_build/${
18a0: 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64  OSX}_pmbuild.pmd
18b0: 6f 63 0a 09 09 73 65 64 20 22 73 7c 40 40 42 55  oc...sed "s|@@BU
18c0: 49 4c 44 52 4f 4f 54 44 49 52 40 40 7c 24 28 70  ILDROOTDIR@@|$(p
18d0: 77 64 29 7c 67 22 20 62 75 69 6c 64 2f 63 61 63  wd)|g" build/cac
18e0: 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 54 65  key_osx_build/Te
18f0: 6d 70 6c 61 74 65 5f 70 6d 62 75 69 6c 64 2f 24  mplate_pmbuild/$
1900: 7b 50 4d 44 4f 43 7d 2e 69 6e 20 3e 20 62 75 69  {PMDOC}.in > bui
1910: 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75  ld/cackey_osx_bu
1920: 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69  ild/${OSX}_pmbui
1930: 6c 64 2e 70 6d 64 6f 63 2f 24 7b 50 4d 44 4f 43  ld.pmdoc/${PMDOC
1940: 7d 0a 09 09 73 65 64 20 22 73 7c 40 40 4f 53 58  }...sed "s|@@OSX
1950: 56 45 52 53 49 4f 4e 40 40 7c 24 7b 4f 53 58 7d  VERSION@@|${OSX}
1960: 7c 67 22 20 62 75 69 6c 64 2f 63 61 63 6b 65 79  |g" build/cackey
1970: 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58  _osx_build/${OSX
1980: 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f  }_pmbuild.pmdoc/
1990: 24 7b 50 4d 44 4f 43 7d 20 3e 20 62 75 69 6c 64  ${PMDOC} > build
19a0: 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c  /cackey_osx_buil
19b0: 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64  d/${OSX}_pmbuild
19c0: 2e 70 6d 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d 2e  .pmdoc/${PMDOC}.
19d0: 31 0a 09 09 73 65 64 20 22 73 7c 40 40 55 55 49  1...sed "s|@@UUI
19e0: 44 40 40 7c 24 7b 55 55 49 44 7d 7c 67 22 20 62  D@@|${UUID}|g" b
19f0: 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f  uild/cackey_osx_
1a00: 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62  build/${OSX}_pmb
1a10: 75 69 6c 64 2e 70 6d 64 6f 63 2f 24 7b 50 4d 44  uild.pmdoc/${PMD
1a20: 4f 43 7d 2e 31 20 3e 20 62 75 69 6c 64 2f 63 61  OC}.1 > 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 0a 09 09 73  doc/${PMDOC}...s
1a60: 65 64 20 22 73 7c 40 40 54 41 52 47 45 54 4f 53  ed "s|@@TARGETOS
1a70: 40 40 7c 24 7b 50 4b 54 41 52 47 45 54 4f 53 7d  @@|${PKTARGETOS}
1a80: 7c 67 22 20 62 75 69 6c 64 2f 63 61 63 6b 65 79  |g" build/cackey
1a90: 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58  _osx_build/${OSX
1aa0: 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f  }_pmbuild.pmdoc/
1ab0: 24 7b 50 4d 44 4f 43 7d 20 3e 20 62 75 69 6c 64  ${PMDOC} > build
1ac0: 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c  /cackey_osx_buil
1ad0: 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64  d/${OSX}_pmbuild
1ae0: 2e 70 6d 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d 2e  .pmdoc/${PMDOC}.
1af0: 31 0a 09 09 73 65 64 20 22 73 7c 40 40 4e 45 58  1...sed "s|@@NEX
1b00: 54 4f 53 58 56 45 52 40 40 7c 24 7b 4e 45 58 54  TOSXVER@@|${NEXT
1b10: 4f 53 58 56 45 52 7d 7c 67 22 20 62 75 69 6c 64  OSXVER}|g" build
1b20: 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c  /cackey_osx_buil
1b30: 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64  d/${OSX}_pmbuild
1b40: 2e 70 6d 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d 2e  .pmdoc/${PMDOC}.
1b50: 31 20 3e 20 62 75 69 6c 64 2f 63 61 63 6b 65 79  1 > build/cackey
1b60: 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58  _osx_build/${OSX
1b70: 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f  }_pmbuild.pmdoc/
1b80: 24 7b 50 4d 44 4f 43 7d 0a 09 09 73 65 64 20 22  ${PMDOC}...sed "
1b90: 73 7c 40 40 43 55 52 4f 53 58 56 45 52 40 40 7c  s|@@CUROSXVER@@|
1ba0: 24 7b 43 55 52 4f 53 58 56 45 52 7d 7c 67 22 20  ${CUROSXVER}|g" 
1bb0: 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78  build/cackey_osx
1bc0: 5f 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d  _build/${OSX}_pm
1bd0: 62 75 69 6c 64 2e 70 6d 64 6f 63 2f 24 7b 50 4d  build.pmdoc/${PM
1be0: 44 4f 43 7d 20 3e 20 62 75 69 6c 64 2f 63 61 63  DOC} > build/cac
1bf0: 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b  key_osx_build/${
1c00: 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64  OSX}_pmbuild.pmd
1c10: 6f 63 2f 24 7b 50 4d 44 4f 43 7d 2e 31 0a 09 09  oc/${PMDOC}.1...
1c20: 73 65 64 20 22 73 7c 40 40 4c 49 42 43 41 43 4b  sed "s|@@LIBCACK
1c30: 45 59 47 40 40 7c 24 7b 4c 49 42 43 41 43 4b 45  EYG@@|${LIBCACKE
1c40: 59 47 7d 7c 67 22 20 62 75 69 6c 64 2f 63 61 63  YG}|g" build/cac
1c50: 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b  key_osx_build/${
1c60: 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64  OSX}_pmbuild.pmd
1c70: 6f 63 2f 24 7b 50 4d 44 4f 43 7d 2e 31 20 3e 20  oc/${PMDOC}.1 > 
1c80: 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78  build/cackey_osx
1c90: 5f 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d  _build/${OSX}_pm
1ca0: 62 75 69 6c 64 2e 70 6d 64 6f 63 2f 24 7b 50 4d  build.pmdoc/${PM
1cb0: 44 4f 43 7d 0a 09 09 63 70 20 62 75 69 6c 64 2f  DOC}...cp build/
1cc0: 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64  cackey_osx_build
1cd0: 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e  /${OSX}_pmbuild.
1ce0: 70 6d 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d 20 62  pmdoc/${PMDOC} b
1cf0: 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f  uild/cackey_osx_
1d00: 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62  build/${OSX}_pmb
1d10: 75 69 6c 64 2e 70 6d 64 6f 63 2f 24 7b 50 4d 44  uild.pmdoc/${PMD
1d20: 4f 43 7d 2e 31 0a 09 09 6d 76 20 62 75 69 6c 64  OC}.1...mv build
1d30: 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c  /cackey_osx_buil
1d40: 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64  d/${OSX}_pmbuild
1d50: 2e 70 6d 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d 2e  .pmdoc/${PMDOC}.
1d60: 31 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f  1 build/cackey_o
1d70: 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f  sx_build/${OSX}_
1d80: 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f 24 7b  pmbuild.pmdoc/${
1d90: 50 4d 44 4f 43 7d 0a 09 64 6f 6e 65 0a 09 45 58  PMDOC}..done..EX
1da0: 54 3d 70 6b 67 0a 09 69 66 20 5b 20 24 7b 4f 53  T=pkg..if [ ${OS
1db0: 58 7d 20 3d 3d 20 22 53 6e 6f 77 6c 65 6f 70 61  X} == "Snowleopa
1dc0: 72 64 22 20 5d 3b 20 74 68 65 6e 0a 09 09 63 61  rd" ]; then...ca
1dd0: 74 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f  t build/cackey_o
1de0: 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f  sx_build/${OSX}_
1df0: 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f 69 6e  pmbuild.pmdoc/in
1e00: 64 65 78 2e 78 6d 6c 20 7c 20 73 65 64 20 27 73  dex.xml | sed 's
1e10: 7c 66 6f 72 20 4d 61 63 20 4f 53 20 58 20 53 6e  |for Mac OS X Sn
1e20: 6f 77 6c 65 6f 70 61 72 64 7c 66 6f 72 20 4d 61  owleopard|for Ma
1e30: 63 20 4f 53 20 58 20 53 6e 6f 77 4c 65 6f 70 61  c OS X SnowLeopa
1e40: 72 64 7c 67 27 20 3e 20 62 75 69 6c 64 2f 63 61  rd|g' > build/ca
1e50: 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24  ckey_osx_build/$
1e60: 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d  {OSX}_pmbuild.pm
1e70: 64 6f 63 2f 69 6e 64 65 78 2e 78 6d 6c 2e 6e 65  doc/index.xml.ne
1e80: 77 0a 09 09 6d 76 20 62 75 69 6c 64 2f 63 61 63  w...mv build/cac
1e90: 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b  key_osx_build/${
1ea0: 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64  OSX}_pmbuild.pmd
1eb0: 6f 63 2f 69 6e 64 65 78 2e 78 6d 6c 2e 6e 65 77  oc/index.xml.new
1ec0: 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73   build/cackey_os
1ed0: 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70  x_build/${OSX}_p
1ee0: 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f 69 6e 64  mbuild.pmdoc/ind
1ef0: 65 78 2e 78 6d 6c 0a 09 66 69 0a 09 69 66 20 5b  ex.xml..fi..if [
1f00: 20 24 7b 4f 53 58 7d 20 3d 3d 20 22 53 6c 74 6f   ${OSX} == "Slto
1f10: 6d 6c 22 20 5d 3b 20 74 68 65 6e 0a 09 09 63 61  ml" ]; then...ca
1f20: 74 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f  t build/cackey_o
1f30: 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f  sx_build/${OSX}_
1f40: 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f 69 6e  pmbuild.pmdoc/in
1f50: 64 65 78 2e 78 6d 6c 20 7c 20 73 65 64 20 27 73  dex.xml | sed 's
1f60: 7c 66 6f 72 20 4d 61 63 20 4f 53 20 58 20 53 6c  |for Mac OS X Sl
1f70: 74 6f 6d 6c 7c 66 6f 72 20 4d 61 63 20 4f 53 20  toml|for Mac OS 
1f80: 58 20 53 4c 74 6f 4d 4c 7c 67 27 20 3e 20 62 75  X SLtoML|g' > bu
1f90: 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62  ild/cackey_osx_b
1fa0: 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75  uild/${OSX}_pmbu
1fb0: 69 6c 64 2e 70 6d 64 6f 63 2f 69 6e 64 65 78 2e  ild.pmdoc/index.
1fc0: 78 6d 6c 2e 6e 65 77 0a 09 09 6d 76 20 62 75 69  xml.new...mv bui
1fd0: 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75  ld/cackey_osx_bu
1fe0: 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69  ild/${OSX}_pmbui
1ff0: 6c 64 2e 70 6d 64 6f 63 2f 69 6e 64 65 78 2e 78  ld.pmdoc/index.x
2000: 6d 6c 2e 6e 65 77 20 62 75 69 6c 64 2f 63 61 63  ml.new build/cac
2010: 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b  key_osx_build/${
2020: 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64  OSX}_pmbuild.pmd
2030: 6f 63 2f 69 6e 64 65 78 2e 78 6d 6c 0a 09 66 69  oc/index.xml..fi
2040: 0a 09 2f 44 65 76 65 6c 6f 70 65 72 2f 41 70 70  ../Developer/App
2050: 6c 69 63 61 74 69 6f 6e 73 2f 55 74 69 6c 69 74  lications/Utilit
2060: 69 65 73 2f 50 61 63 6b 61 67 65 4d 61 6b 65 72  ies/PackageMaker
2070: 2e 61 70 70 2f 43 6f 6e 74 65 6e 74 73 2f 4d 61  .app/Contents/Ma
2080: 63 4f 53 2f 50 61 63 6b 61 67 65 4d 61 6b 65 72  cOS/PackageMaker
2090: 20 2d 64 20 62 75 69 6c 64 2f 63 61 63 6b 65 79   -d build/cackey
20a0: 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58  _osx_build/${OSX
20b0: 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 20  }_pmbuild.pmdoc 
20c0: 2d 6f 20 6d 61 63 62 75 69 6c 64 2f 70 6b 67 2f  -o macbuild/pkg/
20d0: 43 41 43 4b 65 79 5f 24 7b 43 41 43 4b 45 59 5f  CACKey_${CACKEY_
20e0: 56 45 52 53 49 4f 4e 7d 5f 24 7b 4f 53 58 7d 2e  VERSION}_${OSX}.
20f0: 24 7b 45 58 54 7d 0a 09 74 61 72 20 2d 2d 63 72  ${EXT}..tar --cr
2100: 65 61 74 65 20 2d 2d 64 69 72 65 63 74 6f 72 79  eate --directory
2110: 20 6d 61 63 62 75 69 6c 64 2f 70 6b 67 2f 20 2d   macbuild/pkg/ -
2120: 2d 66 69 6c 65 20 6d 61 63 62 75 69 6c 64 2f 70  -file macbuild/p
2130: 6b 67 2f 43 41 43 4b 65 79 5f 24 7b 43 41 43 4b  kg/CACKey_${CACK
2140: 45 59 5f 56 45 52 53 49 4f 4e 7d 5f 24 7b 4f 53  EY_VERSION}_${OS
2150: 58 7d 2e 24 7b 45 58 54 7d 2e 74 61 72 20 43 41  X}.${EXT}.tar CA
2160: 43 4b 65 79 5f 24 7b 43 41 43 4b 45 59 5f 56 45  CKey_${CACKEY_VE
2170: 52 53 49 4f 4e 7d 5f 24 7b 4f 53 58 7d 2e 24 7b  RSION}_${OSX}.${
2180: 45 58 54 7d 0a 09 67 7a 69 70 20 2d 39 20 6d 61  EXT}..gzip -9 ma
2190: 63 62 75 69 6c 64 2f 70 6b 67 2f 43 41 43 4b 65  cbuild/pkg/CACKe
21a0: 79 5f 24 7b 43 41 43 4b 45 59 5f 56 45 52 53 49  y_${CACKEY_VERSI
21b0: 4f 4e 7d 5f 24 7b 4f 53 58 7d 2e 24 7b 45 58 54  ON}_${OSX}.${EXT
21c0: 7d 2e 74 61 72 0a 09 72 6d 20 2d 72 66 20 6d 61  }.tar..rm -rf ma
21d0: 63 62 75 69 6c 64 2f 70 6b 67 2f 43 41 43 4b 65  cbuild/pkg/CACKe
21e0: 79 5f 24 7b 43 41 43 4b 45 59 5f 56 45 52 53 49  y_${CACKEY_VERSI
21f0: 4f 4e 7d 5f 24 7b 4f 53 58 7d 2e 24 7b 45 58 54  ON}_${OSX}.${EXT
2200: 7d 0a 09 72 6d 20 2d 66 20 62 75 69 6c 64 2f 63  }..rm -f build/c
2210: 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f  ackey_osx_build/
2220: 63 61 63 6b 65 79 2e 64 79 6c 69 62 0a 09 72 6d  cackey.dylib..rm
2230: 20 2d 72 66 20 62 75 69 6c 64 2f 63 61 63 6b 65   -rf build/cacke
2240: 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 50 4b 43 53  y_osx_build/PKCS
2250: 31 31 2e 74 6f 6b 65 6e 64 0a 09 65 63 68 6f 20  11.tokend..echo 
2260: 22 24 7b 4f 53 58 7d 20 62 75 69 6c 64 20 63 6f  "${OSX} build co
2270: 6d 70 6c 65 74 65 22 0a 7d 0a 0a 23 20 54 61 6b  mplete".}..# Tak
2280: 65 20 63 6f 6d 6d 61 6e 64 20 6c 69 6e 65 20 61  e command line a
2290: 72 67 75 6d 65 6e 74 73 20 61 6e 64 20 65 78 65  rguments and exe
22a0: 63 75 74 65 0a 63 61 73 65 20 22 24 31 22 20 69  cute.case "$1" i
22b0: 6e 0a 09 22 22 29 0a 09 09 75 73 61 67 65 0a 09  n.."")...usage..
22c0: 09 65 78 69 74 20 24 3f 0a 09 3b 3b 0a 0a 09 22  .exit $?..;;..."
22d0: 6c 65 6f 70 61 72 64 22 29 0a 09 09 2e 2f 61 75  leopard")..../au
22e0: 74 6f 67 65 6e 2e 73 68 0a 09 09 6c 65 6f 70 61  togen.sh...leopa
22f0: 72 64 0a 09 09 65 78 69 74 20 24 3f 0a 09 3b 3b  rd...exit $?..;;
2300: 0a 0a 09 22 73 6e 6f 77 6c 65 6f 70 61 72 64 22  ..."snowleopard"
2310: 29 0a 09 09 2e 2f 61 75 74 6f 67 65 6e 2e 73 68  )..../autogen.sh
2320: 0a 09 09 73 6e 6f 77 6c 65 6f 70 61 72 64 0a 09  ...snowleopard..
2330: 09 65 78 69 74 20 24 3f 0a 09 3b 3b 0a 09 0a 09  .exit $?..;;....
2340: 22 6c 69 6f 6e 22 29 0a 09 09 2e 2f 61 75 74 6f  "lion")..../auto
2350: 67 65 6e 2e 73 68 0a 09 09 6c 69 6f 6e 0a 09 09  gen.sh...lion...
2360: 65 78 69 74 20 24 3f 0a 09 3b 3b 0a 09 0a 09 22  exit $?..;;...."
2370: 73 6c 74 6f 6d 6c 22 29 0a 09 09 2e 2f 61 75 74  sltoml")..../aut
2380: 6f 67 65 6e 2e 73 68 0a 09 09 73 6c 74 6f 6d 6c  ogen.sh...sltoml
2390: 0a 09 09 65 78 69 74 20 24 3f 0a 09 3b 3b 0a 0a  ...exit $?..;;..
23a0: 09 22 61 6c 6c 22 29 0a 09 09 2e 2f 61 75 74 6f  ."all")..../auto
23b0: 67 65 6e 2e 73 68 0a 09 09 6c 65 6f 70 61 72 64  gen.sh...leopard
23c0: 0a 09 09 73 6c 74 6f 6d 6c 0a 09 09 65 63 68 6f  ...sltoml...echo
23d0: 20 22 22 0a 09 09 65 63 68 6f 20 22 41 6c 6c 20   ""...echo "All 
23e0: 62 75 69 6c 64 73 20 63 6f 6d 70 6c 65 74 65 2e  builds complete.
23f0: 22 0a 09 09 65 78 69 74 20 24 3f 0a 09 3b 3b 0a  "...exit $?..;;.
2400: 0a 09 22 63 6c 65 61 6e 22 29 0a 09 09 63 6c 65  .."clean")...cle
2410: 61 6e 0a 09 09 65 78 69 74 20 24 3f 0a 09 3b 3b  an...exit $?..;;
2420: 0a 0a 09 2a 29 0a 09 09 75 73 61 67 65 0a 09 09  ...*)...usage...
2430: 65 78 69 74 20 24 3f 0a 09 3b 3b 0a 65 73 61 63  exit $?..;;.esac
2440: 20 0a                                             .