Hex Artifact Content

Artifact ee098bd5fca79914cdf9ba3d029cba430b53b958:


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 55  ed 's_)__'`..# U
00d0: 73 61 67 65 20 66 75 6e 63 74 69 6f 6e 0a 75 73  sage function.us
00e0: 61 67 65 28 29 20 7b 0a 09 65 63 68 6f 20 22 55  age() {..echo "U
00f0: 73 61 67 65 3a 20 62 75 69 6c 64 5f 6f 73 78 2e  sage: build_osx.
0100: 73 68 20 3c 74 61 72 67 65 74 3e 22 0a 09 65 63  sh <target>"..ec
0110: 68 6f 20 57 68 65 72 65 20 74 61 72 67 65 74 20  ho Where target 
0120: 69 73 20 6f 6e 65 20 6f 66 3a 0a 09 65 63 68 6f  is one of:..echo
0130: 20 22 20 20 20 20 70 61 6e 74 68 65 72 20 20 2d   "    panther  -
0140: 20 28 42 75 69 6c 64 73 20 31 30 2e 33 20 4c 69   (Builds 10.3 Li
0150: 62 72 61 72 79 20 66 6f 72 20 50 50 43 47 33 29  brary for PPCG3)
0160: 22 0a 09 65 63 68 6f 20 22 20 20 20 20 74 69 67  "..echo "    tig
0170: 65 72 20 20 2d 20 28 42 75 69 6c 64 73 20 55 6e  er  - (Builds Un
0180: 69 76 65 72 73 61 6c 20 31 30 2e 34 20 4c 69 62  iversal 10.4 Lib
0190: 72 61 72 79 20 66 6f 72 20 50 50 43 47 33 2f 69  rary for PPCG3/i
01a0: 33 38 36 29 22 0a 09 65 63 68 6f 20 22 20 20 20  386)"..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 61 6c 6c 20 2d 20 28 42 75 69 6c 64 73 20    all - (Builds 
0250: 66 6f 72 20 61 6c 6c 20 73 75 70 70 6f 72 74 65  for all supporte
0260: 64 20 74 61 72 67 65 74 73 29 22 0a 09 65 63 68  d targets)"..ech
0270: 6f 20 22 20 20 20 20 63 6c 65 61 6e 20 2d 20 28  o "    clean - (
0280: 43 6c 65 61 6e 73 20 75 70 29 22 0a 09 65 63 68  Cleans up)"..ech
0290: 6f 20 22 52 75 6e 20 66 72 6f 6d 20 43 41 43 4b  o "Run from CACK
02a0: 65 79 20 42 75 69 6c 64 20 52 6f 6f 74 2e 22 0a  ey Build Root.".
02b0: 09 65 78 69 74 20 24 3f 0a 7d 0a 0a 23 20 43 6c  .exit $?.}..# Cl
02c0: 65 61 6e 20 75 70 20 66 75 6e 63 74 69 6f 6e 0a  ean up function.
02d0: 63 6c 65 61 6e 28 29 20 7b 0a 09 72 6d 20 2d 66  clean() {..rm -f
02e0: 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73   build/cackey_os
02f0: 78 5f 62 75 69 6c 64 2f 63 61 63 6b 65 79 2e 64  x_build/cackey.d
0300: 79 6c 69 62 0a 09 72 6d 20 2d 72 66 20 6d 61 63  ylib..rm -rf mac
0310: 62 75 69 6c 64 0a 09 72 6d 20 2d 72 66 20 62 75  build..rm -rf bu
0320: 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62  ild/cackey_osx_b
0330: 75 69 6c 64 2f 2a 2e 70 6d 64 6f 63 0a 09 6d 61  uild/*.pmdoc..ma
0340: 6b 65 20 64 69 73 74 63 6c 65 61 6e 0a 7d 0a 0a  ke distclean.}..
0350: 23 20 44 69 72 65 63 74 6f 72 79 20 63 72 65 61  # Directory crea
0360: 74 69 6f 6e 20 66 75 6e 63 74 69 6f 6e 0a 6d 61  tion function.ma
0370: 6b 65 64 69 72 28 29 20 7b 0a 09 69 66 20 5b 20  kedir() {..if [ 
0380: 21 20 2d 64 20 6d 61 63 62 75 69 6c 64 20 5d 3b  ! -d macbuild ];
0390: 20 74 68 65 6e 0a 09 09 6d 6b 64 69 72 20 6d 61   then...mkdir ma
03a0: 63 62 75 69 6c 64 0a 09 09 6d 6b 64 69 72 20 6d  cbuild...mkdir m
03b0: 61 63 62 75 69 6c 64 2f 50 61 6e 74 68 65 72 0a  acbuild/Panther.
03c0: 09 09 6d 6b 64 69 72 20 6d 61 63 62 75 69 6c 64  ..mkdir macbuild
03d0: 2f 54 69 67 65 72 0a 09 09 6d 6b 64 69 72 20 6d  /Tiger...mkdir m
03e0: 61 63 62 75 69 6c 64 2f 4c 65 6f 70 61 72 64 0a  acbuild/Leopard.
03f0: 09 09 6d 6b 64 69 72 20 6d 61 63 62 75 69 6c 64  ..mkdir macbuild
0400: 2f 53 6e 6f 77 6c 65 6f 70 61 72 64 0a 09 09 6d  /Snowleopard...m
0410: 6b 64 69 72 20 6d 61 63 62 75 69 6c 64 2f 70 6b  kdir macbuild/pk
0420: 67 0a 09 66 69 0a 09 69 66 20 5b 20 21 20 2d 66  g..fi..if [ ! -f
0430: 20 63 6f 6e 66 69 67 2e 67 75 65 73 73 20 5d 3b   config.guess ];
0440: 20 74 68 65 6e 0a 09 09 63 70 20 2f 44 65 76 65   then...cp /Deve
0450: 6c 6f 70 65 72 2f 75 73 72 2f 73 68 61 72 65 2f  loper/usr/share/
0460: 6c 69 62 74 6f 6f 6c 2f 63 6f 6e 66 69 67 2e 67  libtool/config.g
0470: 75 65 73 73 20 2e 0a 09 66 69 0a 09 69 66 20 5b  uess ...fi..if [
0480: 20 21 20 2d 66 20 63 6f 6e 66 69 67 2e 73 75 62   ! -f config.sub
0490: 20 5d 3b 20 74 68 65 6e 0a 09 09 63 70 20 2f 44   ]; then...cp /D
04a0: 65 76 65 6c 6f 70 65 72 2f 75 73 72 2f 73 68 61  eveloper/usr/sha
04b0: 72 65 2f 6c 69 62 74 6f 6f 6c 2f 63 6f 6e 66 69  re/libtool/confi
04c0: 67 2e 73 75 62 20 2e 0a 09 66 69 0a 09 69 66 20  g.sub ...fi..if 
04d0: 5b 20 21 20 2d 66 20 69 6e 73 74 61 6c 6c 2d 73  [ ! -f install-s
04e0: 68 20 5d 3b 20 74 68 65 6e 0a 09 09 63 70 20 2f  h ]; then...cp /
04f0: 44 65 76 65 6c 6f 70 65 72 2f 75 73 72 2f 73 68  Developer/usr/sh
0500: 61 72 65 2f 6c 69 62 74 6f 6f 6c 2f 69 6e 73 74  are/libtool/inst
0510: 61 6c 6c 2d 73 68 20 2e 0a 09 66 69 0a 7d 0a 0a  all-sh ...fi.}..
0520: 23 20 42 75 69 6c 64 20 66 75 6e 63 74 69 6f 6e  # Build function
0530: 20 66 6f 72 20 50 61 6e 74 68 65 72 0a 70 61 6e   for Panther.pan
0540: 74 68 65 72 28 29 20 7b 0a 09 6d 61 6b 65 64 69  ther() {..makedi
0550: 72 0a 09 48 45 41 44 45 52 53 3d 2f 44 65 76 65  r..HEADERS=/Deve
0560: 6c 6f 70 65 72 2f 53 44 4b 73 2f 4d 61 63 4f 53  loper/SDKs/MacOS
0570: 58 31 30 2e 33 2e 39 2e 73 64 6b 2f 53 79 73 74  X10.3.9.sdk/Syst
0580: 65 6d 2f 4c 69 62 72 61 72 79 2f 46 72 61 6d 65  em/Library/Frame
0590: 77 6f 72 6b 73 2f 50 43 53 43 2e 66 72 61 6d 65  works/PCSC.frame
05a0: 77 6f 72 6b 2f 56 65 72 73 69 6f 6e 73 2f 41 2f  work/Versions/A/
05b0: 48 65 61 64 65 72 73 2f 0a 09 4c 49 42 52 41 52  Headers/..LIBRAR
05c0: 59 3d 2f 44 65 76 65 6c 6f 70 65 72 2f 53 44 4b  Y=/Developer/SDK
05d0: 73 2f 4d 61 63 4f 53 58 31 30 2e 33 2e 39 2e 73  s/MacOSX10.3.9.s
05e0: 64 6b 2f 53 79 73 74 65 6d 2f 4c 69 62 72 61 72  dk/System/Librar
05f0: 79 2f 46 72 61 6d 65 77 6f 72 6b 73 2f 50 43 53  y/Frameworks/PCS
0600: 43 2e 66 72 61 6d 65 77 6f 72 6b 2f 50 43 53 43  C.framework/PCSC
0610: 0a 09 4f 53 58 3d 50 61 6e 74 68 65 72 0a 09 50  ..OSX=Panther..P
0620: 4b 54 41 52 47 45 54 4f 53 3d 31 0a 09 4e 45 58  KTARGETOS=1..NEX
0630: 54 4f 53 58 56 45 52 3d 31 30 2e 34 0a 09 43 55  TOSXVER=10.4..CU
0640: 52 4f 53 58 56 45 52 3d 31 30 2e 33 0a 09 48 4f  ROSXVER=10.3..HO
0650: 53 54 3d 70 6f 77 65 72 70 63 2d 61 70 70 6c 65  ST=powerpc-apple
0660: 2d 64 61 72 77 69 6e 37 0a 09 6d 61 6b 65 20 64  -darwin7..make d
0670: 69 73 74 63 6c 65 61 6e 0a 09 41 52 43 48 3d 22  istclean..ARCH="
0680: 70 70 63 20 2d 6d 63 70 75 3d 47 33 22 0a 09 43  ppc -mcpu=G3"..C
0690: 46 4c 41 47 53 3d 22 2d 61 72 63 68 20 24 7b 41  FLAGS="-arch ${A
06a0: 52 43 48 7d 22 20 2e 2f 63 6f 6e 66 69 67 75 72  RCH}" ./configur
06b0: 65 20 2d 2d 77 69 74 68 2d 70 63 73 63 2d 68 65  e --with-pcsc-he
06c0: 61 64 65 72 73 3d 24 7b 48 45 41 44 45 52 53 7d  aders=${HEADERS}
06d0: 20 2d 2d 77 69 74 68 2d 70 63 73 63 2d 6c 69 62   --with-pcsc-lib
06e0: 73 3d 24 7b 4c 49 42 52 41 52 59 7d 20 2d 2d 68  s=${LIBRARY} --h
06f0: 6f 73 74 3d 24 7b 48 4f 53 54 7d 0a 09 6d 61 6b  ost=${HOST}..mak
0700: 65 0a 09 63 70 20 6c 69 62 63 61 63 6b 65 79 2e  e..cp libcackey.
0710: 64 79 6c 69 62 20 6d 61 63 62 75 69 6c 64 2f 24  dylib macbuild/$
0720: 7b 4f 53 58 7d 2f 6c 69 62 63 61 63 6b 65 79 2e  {OSX}/libcackey.
0730: 64 79 6c 69 62 0a 09 63 70 20 6c 69 62 63 61 63  dylib..cp libcac
0740: 6b 65 79 5f 67 2e 64 79 6c 69 62 20 6d 61 63 62  key_g.dylib macb
0750: 75 69 6c 64 2f 24 7b 4f 53 58 7d 2f 6c 69 62 63  uild/${OSX}/libc
0760: 61 63 6b 65 79 5f 67 2e 64 79 6c 69 62 0a 09 70  ackey_g.dylib..p
0770: 6b 67 62 75 69 6c 64 0a 7d 0a 0a 23 20 42 75 69  kgbuild.}..# Bui
0780: 6c 64 20 66 75 6e 63 74 69 6f 6e 20 66 6f 72 20  ld function for 
0790: 54 69 67 65 72 0a 74 69 67 65 72 28 29 20 7b 0a  Tiger.tiger() {.
07a0: 09 6d 61 6b 65 64 69 72 0a 09 48 45 41 44 45 52  .makedir..HEADER
07b0: 53 3d 2f 44 65 76 65 6c 6f 70 65 72 2f 53 44 4b  S=/Developer/SDK
07c0: 73 2f 4d 61 63 4f 53 58 31 30 2e 34 75 2e 73 64  s/MacOSX10.4u.sd
07d0: 6b 2f 53 79 73 74 65 6d 2f 4c 69 62 72 61 72 79  k/System/Library
07e0: 2f 46 72 61 6d 65 77 6f 72 6b 73 2f 50 43 53 43  /Frameworks/PCSC
07f0: 2e 66 72 61 6d 65 77 6f 72 6b 2f 56 65 72 73 69  .framework/Versi
0800: 6f 6e 73 2f 41 2f 48 65 61 64 65 72 73 2f 0a 09  ons/A/Headers/..
0810: 4c 49 42 52 41 52 59 3d 2f 44 65 76 65 6c 6f 70  LIBRARY=/Develop
0820: 65 72 2f 53 44 4b 73 2f 4d 61 63 4f 53 58 31 30  er/SDKs/MacOSX10
0830: 2e 34 75 2e 73 64 6b 2f 53 79 73 74 65 6d 2f 4c  .4u.sdk/System/L
0840: 69 62 72 61 72 79 2f 46 72 61 6d 65 77 6f 72 6b  ibrary/Framework
0850: 73 2f 50 43 53 43 2e 66 72 61 6d 65 77 6f 72 6b  s/PCSC.framework
0860: 2f 50 43 53 43 0a 09 4c 49 42 3d 22 22 0a 09 41  /PCSC..LIB=""..A
0870: 52 43 48 4c 49 53 54 3d 22 22 0a 09 44 4c 49 42  RCHLIST=""..DLIB
0880: 3d 22 22 0a 09 44 41 52 43 48 4c 49 53 54 3d 22  =""..DARCHLIST="
0890: 22 0a 09 4f 53 58 3d 54 69 67 65 72 0a 09 50 4b  "..OSX=Tiger..PK
08a0: 54 41 52 47 45 54 4f 53 3d 32 0a 09 4e 45 58 54  TARGETOS=2..NEXT
08b0: 4f 53 58 56 45 52 3d 31 30 2e 35 0a 09 43 55 52  OSXVER=10.5..CUR
08c0: 4f 53 58 56 45 52 3d 31 30 2e 34 0a 09 66 6f 72  OSXVER=10.4..for
08d0: 20 48 4f 53 54 20 69 6e 20 70 6f 77 65 72 70 63   HOST in powerpc
08e0: 2d 61 70 70 6c 65 2d 64 61 72 77 69 6e 38 20 69  -apple-darwin8 i
08f0: 33 38 36 2d 61 70 70 6c 65 2d 64 61 72 77 69 6e  386-apple-darwin
0900: 38 3b 20 64 6f 0a 09 09 67 65 6e 62 75 69 6c 64  8; do...genbuild
0910: 0a 09 64 6f 6e 65 0a 09 6c 69 62 62 75 69 6c 64  ..done..libbuild
0920: 0a 09 70 6b 67 62 75 69 6c 64 0a 7d 0a 0a 23 20  ..pkgbuild.}..# 
0930: 42 75 69 6c 64 20 66 75 6e 63 74 69 6f 6e 20 66  Build function f
0940: 6f 72 20 4c 65 6f 70 61 72 64 0a 6c 65 6f 70 61  or Leopard.leopa
0950: 72 64 28 29 20 7b 0a 09 6d 61 6b 65 64 69 72 0a  rd() {..makedir.
0960: 09 48 45 41 44 45 52 53 3d 2f 44 65 76 65 6c 6f  .HEADERS=/Develo
0970: 70 65 72 2f 53 44 4b 73 2f 4d 61 63 4f 53 58 31  per/SDKs/MacOSX1
0980: 30 2e 35 2e 73 64 6b 2f 53 79 73 74 65 6d 2f 4c  0.5.sdk/System/L
0990: 69 62 72 61 72 79 2f 46 72 61 6d 65 77 6f 72 6b  ibrary/Framework
09a0: 73 2f 50 43 53 43 2e 66 72 61 6d 65 77 6f 72 6b  s/PCSC.framework
09b0: 2f 56 65 72 73 69 6f 6e 73 2f 41 2f 48 65 61 64  /Versions/A/Head
09c0: 65 72 73 2f 0a 09 4c 49 42 52 41 52 59 3d 2f 44  ers/..LIBRARY=/D
09d0: 65 76 65 6c 6f 70 65 72 2f 53 44 4b 73 2f 4d 61  eveloper/SDKs/Ma
09e0: 63 4f 53 58 31 30 2e 35 2e 73 64 6b 2f 53 79 73  cOSX10.5.sdk/Sys
09f0: 74 65 6d 2f 4c 69 62 72 61 72 79 2f 46 72 61 6d  tem/Library/Fram
0a00: 65 77 6f 72 6b 73 2f 50 43 53 43 2e 66 72 61 6d  eworks/PCSC.fram
0a10: 65 77 6f 72 6b 2f 50 43 53 43 0a 09 4c 49 42 3d  ework/PCSC..LIB=
0a20: 22 22 0a 09 41 52 43 48 4c 49 53 54 3d 22 22 0a  ""..ARCHLIST="".
0a30: 09 44 4c 49 42 3d 22 22 0a 09 44 41 52 43 48 4c  .DLIB=""..DARCHL
0a40: 49 53 54 3d 22 22 0a 09 4f 53 58 3d 4c 65 6f 70  IST=""..OSX=Leop
0a50: 61 72 64 0a 09 50 4b 54 41 52 47 45 54 4f 53 3d  ard..PKTARGETOS=
0a60: 33 0a 09 4e 45 58 54 4f 53 58 56 45 52 3d 31 30  3..NEXTOSXVER=10
0a70: 2e 36 0a 09 43 55 52 4f 53 58 56 45 52 3d 31 30  .6..CUROSXVER=10
0a80: 2e 35 0a 09 66 6f 72 20 48 4f 53 54 20 69 6e 20  .5..for HOST in 
0a90: 70 6f 77 65 72 70 63 2d 61 70 70 6c 65 2d 64 61  powerpc-apple-da
0aa0: 72 77 69 6e 39 20 69 33 38 36 2d 61 70 70 6c 65  rwin9 i386-apple
0ab0: 2d 64 61 72 77 69 6e 39 3b 20 64 6f 0a 09 09 67  -darwin9; do...g
0ac0: 65 6e 62 75 69 6c 64 0a 09 64 6f 6e 65 0a 09 6c  enbuild..done..l
0ad0: 69 62 62 75 69 6c 64 0a 09 70 6b 67 62 75 69 6c  ibbuild..pkgbuil
0ae0: 64 0a 7d 0a 0a 23 20 42 75 69 6c 64 20 66 75 6e  d.}..# Build fun
0af0: 63 74 69 6f 6e 20 66 6f 72 20 53 6e 6f 77 20 4c  ction for Snow L
0b00: 65 6f 70 61 72 64 0a 73 6e 6f 77 6c 65 6f 70 61  eopard.snowleopa
0b10: 72 64 28 29 20 7b 0a 09 6d 61 6b 65 64 69 72 0a  rd() {..makedir.
0b20: 09 48 45 41 44 45 52 53 3d 2f 44 65 76 65 6c 6f  .HEADERS=/Develo
0b30: 70 65 72 2f 53 44 4b 73 2f 4d 61 63 4f 53 58 31  per/SDKs/MacOSX1
0b40: 30 2e 36 2e 73 64 6b 2f 53 79 73 74 65 6d 2f 4c  0.6.sdk/System/L
0b50: 69 62 72 61 72 79 2f 46 72 61 6d 65 77 6f 72 6b  ibrary/Framework
0b60: 73 2f 50 43 53 43 2e 66 72 61 6d 65 77 6f 72 6b  s/PCSC.framework
0b70: 2f 56 65 72 73 69 6f 6e 73 2f 41 2f 48 65 61 64  /Versions/A/Head
0b80: 65 72 73 2f 0a 09 4c 49 42 52 41 52 59 3d 2f 44  ers/..LIBRARY=/D
0b90: 65 76 65 6c 6f 70 65 72 2f 53 44 4b 73 2f 4d 61  eveloper/SDKs/Ma
0ba0: 63 4f 53 58 31 30 2e 36 2e 73 64 6b 2f 53 79 73  cOSX10.6.sdk/Sys
0bb0: 74 65 6d 2f 4c 69 62 72 61 72 79 2f 46 72 61 6d  tem/Library/Fram
0bc0: 65 77 6f 72 6b 73 2f 50 43 53 43 2e 66 72 61 6d  eworks/PCSC.fram
0bd0: 65 77 6f 72 6b 2f 50 43 53 43 0a 09 4c 49 42 3d  ework/PCSC..LIB=
0be0: 22 22 0a 09 41 52 43 48 4c 49 53 54 3d 22 22 0a  ""..ARCHLIST="".
0bf0: 09 44 4c 49 42 3d 22 22 0a 09 44 41 52 43 48 4c  .DLIB=""..DARCHL
0c00: 49 53 54 3d 22 22 0a 09 4f 53 58 3d 53 6e 6f 77  IST=""..OSX=Snow
0c10: 6c 65 6f 70 61 72 64 0a 09 50 4b 54 41 52 47 45  leopard..PKTARGE
0c20: 54 4f 53 3d 33 0a 09 4e 45 58 54 4f 53 58 56 45  TOS=3..NEXTOSXVE
0c30: 52 3d 31 30 2e 37 0a 09 43 55 52 4f 53 58 56 45  R=10.7..CUROSXVE
0c40: 52 3d 31 30 2e 36 0a 09 66 6f 72 20 48 4f 53 54  R=10.6..for HOST
0c50: 20 69 6e 20 69 33 38 36 2d 61 70 70 6c 65 2d 64   in i386-apple-d
0c60: 61 72 77 69 6e 31 30 20 78 38 36 5f 36 34 2d 61  arwin10 x86_64-a
0c70: 70 70 6c 65 2d 64 61 72 77 69 6e 31 30 3b 20 64  pple-darwin10; d
0c80: 6f 0a 09 09 67 65 6e 62 75 69 6c 64 0a 09 64 6f  o...genbuild..do
0c90: 6e 65 0a 09 6c 69 62 62 75 69 6c 64 0a 09 70 6b  ne..libbuild..pk
0ca0: 67 62 75 69 6c 64 0a 7d 0a 0a 23 20 47 65 6e 65  gbuild.}..# Gene
0cb0: 72 69 63 20 62 75 69 6c 64 20 66 75 6e 63 74 69  ric build functi
0cc0: 6f 6e 0a 67 65 6e 62 75 69 6c 64 28 29 20 7b 0a  on.genbuild() {.
0cd0: 09 6d 61 6b 65 20 64 69 73 74 63 6c 65 61 6e 0a  .make distclean.
0ce0: 09 41 52 43 48 3d 60 65 63 68 6f 20 24 7b 48 4f  .ARCH=`echo ${HO
0cf0: 53 54 7d 20 7c 20 63 75 74 20 2d 64 20 22 2d 22  ST} | cut -d "-"
0d00: 20 2d 66 20 31 60 0a 09 69 66 20 5b 20 24 7b 41   -f 1`..if [ ${A
0d10: 52 43 48 7d 20 3d 3d 20 22 70 6f 77 65 72 70 63  RCH} == "powerpc
0d20: 22 20 5d 3b 20 74 68 65 6e 0a 09 09 69 66 20 5b  " ]; then...if [
0d30: 20 24 7b 4f 53 58 7d 20 3d 3d 20 22 4c 65 6f 70   ${OSX} == "Leop
0d40: 61 72 64 22 20 5d 3b 20 74 68 65 6e 0a 09 09 09  ard" ]; then....
0d50: 41 52 43 48 3d 22 70 70 63 20 2d 6d 63 70 75 3d  ARCH="ppc -mcpu=
0d60: 47 34 22 0a 09 09 65 6c 73 65 0a 09 09 09 41 52  G4"...else....AR
0d70: 43 48 3d 22 70 70 63 20 2d 6d 63 70 75 3d 47 33  CH="ppc -mcpu=G3
0d80: 22 0a 09 09 66 69 0a 09 66 69 0a 09 43 46 4c 41  "...fi..fi..CFLA
0d90: 47 53 3d 22 2d 61 72 63 68 20 24 7b 41 52 43 48  GS="-arch ${ARCH
0da0: 7d 22 20 2e 2f 63 6f 6e 66 69 67 75 72 65 20 2d  }" ./configure -
0db0: 2d 77 69 74 68 2d 70 63 73 63 2d 68 65 61 64 65  -with-pcsc-heade
0dc0: 72 73 3d 24 7b 48 45 41 44 45 52 53 7d 20 2d 2d  rs=${HEADERS} --
0dd0: 77 69 74 68 2d 70 63 73 63 2d 6c 69 62 73 3d 24  with-pcsc-libs=$
0de0: 7b 4c 49 42 52 41 52 59 7d 20 2d 2d 68 6f 73 74  {LIBRARY} --host
0df0: 3d 24 7b 48 4f 53 54 7d 0a 09 6d 61 6b 65 0a 09  =${HOST}..make..
0e00: 63 70 20 6c 69 62 63 61 63 6b 65 79 2e 64 79 6c  cp libcackey.dyl
0e10: 69 62 20 6d 61 63 62 75 69 6c 64 2f 24 7b 4f 53  ib macbuild/${OS
0e20: 58 7d 2f 6c 69 62 63 61 63 6b 65 79 2e 64 79 6c  X}/libcackey.dyl
0e30: 69 62 2e 60 65 63 68 6f 20 24 7b 41 52 43 48 7d  ib.`echo ${ARCH}
0e40: 20 7c 20 63 75 74 20 2d 64 20 27 20 27 20 2d 66   | cut -d ' ' -f
0e50: 20 31 60 0a 09 63 70 20 6c 69 62 63 61 63 6b 65   1`..cp libcacke
0e60: 79 5f 67 2e 64 79 6c 69 62 20 6d 61 63 62 75 69  y_g.dylib macbui
0e70: 6c 64 2f 24 7b 4f 53 58 7d 2f 6c 69 62 63 61 63  ld/${OSX}/libcac
0e80: 6b 65 79 5f 67 2e 64 79 6c 69 62 2e 60 65 63 68  key_g.dylib.`ech
0e90: 6f 20 24 7b 41 52 43 48 7d 20 7c 20 63 75 74 20  o ${ARCH} | cut 
0ea0: 2d 64 20 27 20 27 20 2d 66 20 31 60 20 0a 7d 0a  -d ' ' -f 1` .}.
0eb0: 0a 23 20 4c 69 62 72 61 72 79 20 62 75 69 6c 64  .# Library build
0ec0: 20 66 75 6e 63 74 69 6f 6e 0a 6c 69 62 62 75 69   function.libbui
0ed0: 6c 64 28 29 20 7b 0a 09 66 6f 72 20 4c 49 42 20  ld() {..for LIB 
0ee0: 69 6e 20 6d 61 63 62 75 69 6c 64 2f 24 7b 4f 53  in macbuild/${OS
0ef0: 58 7d 2f 6c 69 62 63 61 63 6b 65 79 2e 64 79 6c  X}/libcackey.dyl
0f00: 69 62 2e 2a 3b 20 64 6f 0a 09 09 41 52 43 48 4c  ib.*; do...ARCHL
0f10: 49 53 54 3d 22 24 7b 41 52 43 48 4c 49 53 54 7d  IST="${ARCHLIST}
0f20: 20 60 65 63 68 6f 20 27 2d 61 72 63 68 20 27 60   `echo '-arch '`
0f30: 20 60 65 63 68 6f 20 24 7b 4c 49 42 7d 20 7c 20   `echo ${LIB} | 
0f40: 63 75 74 20 2d 64 20 2e 20 2d 66 20 33 60 20 60  cut -d . -f 3` `
0f50: 65 63 68 6f 20 27 20 27 60 20 60 65 63 68 6f 20  echo ' '` `echo 
0f60: 24 7b 4c 49 42 7d 60 22 0a 09 64 6f 6e 65 0a 09  ${LIB}`"..done..
0f70: 6c 69 70 6f 20 2d 63 72 65 61 74 65 20 24 7b 41  lipo -create ${A
0f80: 52 43 48 4c 49 53 54 7d 20 2d 6f 75 74 70 75 74  RCHLIST} -output
0f90: 20 6d 61 63 62 75 69 6c 64 2f 24 7b 4f 53 58 7d   macbuild/${OSX}
0fa0: 2f 6c 69 62 63 61 63 6b 65 79 2e 64 79 6c 69 62  /libcackey.dylib
0fb0: 0a 09 66 6f 72 20 44 4c 49 42 20 69 6e 20 6d 61  ..for DLIB in ma
0fc0: 63 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 2f 6c 69  cbuild/${OSX}/li
0fd0: 62 63 61 63 6b 65 79 5f 67 2e 64 79 6c 69 62 2e  bcackey_g.dylib.
0fe0: 2a 3b 20 64 6f 0a 09 09 44 41 52 43 48 4c 49 53  *; do...DARCHLIS
0ff0: 54 3d 22 24 7b 44 41 52 43 48 4c 49 53 54 7d 20  T="${DARCHLIST} 
1000: 60 65 63 68 6f 20 27 2d 61 72 63 68 20 27 60 20  `echo '-arch '` 
1010: 60 65 63 68 6f 20 24 7b 44 4c 49 42 7d 20 7c 20  `echo ${DLIB} | 
1020: 63 75 74 20 2d 64 20 2e 20 2d 66 20 33 60 20 60  cut -d . -f 3` `
1030: 65 63 68 6f 20 27 20 27 60 20 60 65 63 68 6f 20  echo ' '` `echo 
1040: 24 7b 44 4c 49 42 7d 60 22 0a 09 64 6f 6e 65 0a  ${DLIB}`"..done.
1050: 09 6c 69 70 6f 20 2d 63 72 65 61 74 65 20 24 7b  .lipo -create ${
1060: 44 41 52 43 48 4c 49 53 54 7d 20 2d 6f 75 74 70  DARCHLIST} -outp
1070: 75 74 20 6d 61 63 62 75 69 6c 64 2f 24 7b 4f 53  ut macbuild/${OS
1080: 58 7d 2f 6c 69 62 63 61 63 6b 65 79 5f 67 2e 64  X}/libcackey_g.d
1090: 79 6c 69 62 0a 09 72 6d 20 6d 61 63 62 75 69 6c  ylib..rm macbuil
10a0: 64 2f 24 7b 4f 53 58 7d 2f 6c 69 62 63 61 63 6b  d/${OSX}/libcack
10b0: 65 79 2a 2e 64 79 6c 69 62 2e 2a 0a 7d 0a 0a 23  ey*.dylib.*.}..#
10c0: 20 46 75 6e 63 74 69 6f 6e 20 74 6f 20 62 75 69   Function to bui
10d0: 6c 64 20 4d 61 63 20 4f 53 20 58 20 50 61 63 6b  ld Mac OS X Pack
10e0: 61 67 65 73 0a 70 6b 67 62 75 69 6c 64 28 29 20  ages.pkgbuild() 
10f0: 7b 0a 09 72 6d 20 2d 66 20 62 75 69 6c 64 2f 63  {..rm -f build/c
1100: 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f  ackey_osx_build/
1110: 63 61 63 6b 65 79 2e 64 79 6c 69 62 0a 09 6c 6e  cackey.dylib..ln
1120: 20 6d 61 63 62 75 69 6c 64 2f 24 7b 4f 53 58 7d   macbuild/${OSX}
1130: 2f 6c 69 62 63 61 63 6b 65 79 2e 64 79 6c 69 62  /libcackey.dylib
1140: 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73   build/cackey_os
1150: 78 5f 62 75 69 6c 64 2f 63 61 63 6b 65 79 2e 64  x_build/cackey.d
1160: 79 6c 69 62 0a 09 66 6f 72 20 50 4d 44 4f 43 20  ylib..for PMDOC 
1170: 69 6e 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f  in build/cackey_
1180: 6f 73 78 5f 62 75 69 6c 64 2f 54 65 6d 70 6c 61  osx_build/Templa
1190: 74 65 5f 70 6d 62 75 69 6c 64 2f 2a 2e 69 6e 3b  te_pmbuild/*.in;
11a0: 20 64 6f 0a 09 09 50 4d 44 4f 43 3d 22 60 65 63   do...PMDOC="`ec
11b0: 68 6f 20 22 24 7b 50 4d 44 4f 43 7d 22 20 7c 20  ho "${PMDOC}" | 
11c0: 73 65 64 20 27 73 7c 6c 2e 69 6e 7c 6c 7c 67 27  sed 's|l.in|l|g'
11d0: 20 7c 20 73 65 64 20 27 73 7c 62 75 69 6c 64 2f   | sed 's|build/
11e0: 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64  cackey_osx_build
11f0: 2f 54 65 6d 70 6c 61 74 65 5f 70 6d 62 75 69 6c  /Template_pmbuil
1200: 64 2f 7c 7c 67 27 60 22 0a 09 09 55 55 49 44 3d  d/||g'`"...UUID=
1210: 22 60 70 79 74 68 6f 6e 20 2d 63 20 27 69 6d 70  "`python -c 'imp
1220: 6f 72 74 20 75 75 69 64 3b 20 70 72 69 6e 74 20  ort uuid; print 
1230: 75 75 69 64 2e 75 75 69 64 31 28 29 27 20 7c 20  uuid.uuid1()' | 
1240: 64 64 20 63 6f 6e 76 3d 75 63 61 73 65 20 32 3e  dd conv=ucase 2>
1250: 2f 64 65 76 2f 6e 75 6c 6c 60 22 0a 09 09 6d 6b  /dev/null`"...mk
1260: 64 69 72 20 2d 70 20 62 75 69 6c 64 2f 63 61 63  dir -p build/cac
1270: 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b  key_osx_build/${
1280: 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64  OSX}_pmbuild.pmd
1290: 6f 63 0a 09 09 73 65 64 20 22 73 7c 40 40 42 55  oc...sed "s|@@BU
12a0: 49 4c 44 52 4f 4f 54 44 49 52 40 40 7c 24 28 70  ILDROOTDIR@@|$(p
12b0: 77 64 29 7c 67 22 20 62 75 69 6c 64 2f 63 61 63  wd)|g" build/cac
12c0: 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 54 65  key_osx_build/Te
12d0: 6d 70 6c 61 74 65 5f 70 6d 62 75 69 6c 64 2f 24  mplate_pmbuild/$
12e0: 7b 50 4d 44 4f 43 7d 2e 69 6e 20 3e 20 62 75 69  {PMDOC}.in > bui
12f0: 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75  ld/cackey_osx_bu
1300: 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69  ild/${OSX}_pmbui
1310: 6c 64 2e 70 6d 64 6f 63 2f 24 7b 50 4d 44 4f 43  ld.pmdoc/${PMDOC
1320: 7d 0a 09 09 73 65 64 20 22 73 7c 40 40 4f 53 58  }...sed "s|@@OSX
1330: 56 45 52 53 49 4f 4e 40 40 7c 24 7b 4f 53 58 7d  VERSION@@|${OSX}
1340: 7c 67 22 20 62 75 69 6c 64 2f 63 61 63 6b 65 79  |g" build/cackey
1350: 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58  _osx_build/${OSX
1360: 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f  }_pmbuild.pmdoc/
1370: 24 7b 50 4d 44 4f 43 7d 20 3e 20 62 75 69 6c 64  ${PMDOC} > build
1380: 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c  /cackey_osx_buil
1390: 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64  d/${OSX}_pmbuild
13a0: 2e 70 6d 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d 2e  .pmdoc/${PMDOC}.
13b0: 31 0a 09 09 73 65 64 20 22 73 7c 40 40 55 55 49  1...sed "s|@@UUI
13c0: 44 40 40 7c 24 7b 55 55 49 44 7d 7c 67 22 20 62  D@@|${UUID}|g" b
13d0: 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f  uild/cackey_osx_
13e0: 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62  build/${OSX}_pmb
13f0: 75 69 6c 64 2e 70 6d 64 6f 63 2f 24 7b 50 4d 44  uild.pmdoc/${PMD
1400: 4f 43 7d 2e 31 20 3e 20 62 75 69 6c 64 2f 63 61  OC}.1 > build/ca
1410: 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24  ckey_osx_build/$
1420: 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d  {OSX}_pmbuild.pm
1430: 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d 0a 09 09 73  doc/${PMDOC}...s
1440: 65 64 20 22 73 7c 40 40 54 41 52 47 45 54 4f 53  ed "s|@@TARGETOS
1450: 40 40 7c 24 7b 50 4b 54 41 52 47 45 54 4f 53 7d  @@|${PKTARGETOS}
1460: 7c 67 22 20 62 75 69 6c 64 2f 63 61 63 6b 65 79  |g" build/cackey
1470: 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58  _osx_build/${OSX
1480: 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f  }_pmbuild.pmdoc/
1490: 24 7b 50 4d 44 4f 43 7d 20 3e 20 62 75 69 6c 64  ${PMDOC} > build
14a0: 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c  /cackey_osx_buil
14b0: 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64  d/${OSX}_pmbuild
14c0: 2e 70 6d 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d 2e  .pmdoc/${PMDOC}.
14d0: 31 0a 09 09 73 65 64 20 22 73 7c 40 40 4e 45 58  1...sed "s|@@NEX
14e0: 54 4f 53 58 56 45 52 40 40 7c 24 7b 4e 45 58 54  TOSXVER@@|${NEXT
14f0: 4f 53 58 56 45 52 7d 7c 67 22 20 62 75 69 6c 64  OSXVER}|g" build
1500: 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c  /cackey_osx_buil
1510: 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64  d/${OSX}_pmbuild
1520: 2e 70 6d 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d 2e  .pmdoc/${PMDOC}.
1530: 31 20 3e 20 62 75 69 6c 64 2f 63 61 63 6b 65 79  1 > build/cackey
1540: 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58  _osx_build/${OSX
1550: 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f  }_pmbuild.pmdoc/
1560: 24 7b 50 4d 44 4f 43 7d 0a 09 09 73 65 64 20 22  ${PMDOC}...sed "
1570: 73 7c 40 40 43 55 52 4f 53 58 56 45 52 40 40 7c  s|@@CUROSXVER@@|
1580: 24 7b 43 55 52 4f 53 58 56 45 52 7d 7c 67 22 20  ${CUROSXVER}|g" 
1590: 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78  build/cackey_osx
15a0: 5f 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d  _build/${OSX}_pm
15b0: 62 75 69 6c 64 2e 70 6d 64 6f 63 2f 24 7b 50 4d  build.pmdoc/${PM
15c0: 44 4f 43 7d 20 3e 20 62 75 69 6c 64 2f 63 61 63  DOC} > build/cac
15d0: 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b  key_osx_build/${
15e0: 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64  OSX}_pmbuild.pmd
15f0: 6f 63 2f 24 7b 50 4d 44 4f 43 7d 2e 31 0a 09 09  oc/${PMDOC}.1...
1600: 6d 76 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f  mv build/cackey_
1610: 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58 7d  osx_build/${OSX}
1620: 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f 24  _pmbuild.pmdoc/$
1630: 7b 50 4d 44 4f 43 7d 2e 31 20 62 75 69 6c 64 2f  {PMDOC}.1 build/
1640: 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64  cackey_osx_build
1650: 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e  /${OSX}_pmbuild.
1660: 70 6d 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d 0a 09  pmdoc/${PMDOC}..
1670: 64 6f 6e 65 0a 09 69 66 20 5b 20 24 7b 4f 53 58  done..if [ ${OSX
1680: 7d 20 3d 3d 20 22 50 61 6e 74 68 65 72 22 20 5d  } == "Panther" ]
1690: 3b 20 74 68 65 6e 0a 09 09 45 58 54 3d 6d 70 6b  ; then...EXT=mpk
16a0: 67 0a 09 09 63 61 74 20 62 75 69 6c 64 2f 63 61  g...cat build/ca
16b0: 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24  ckey_osx_build/$
16c0: 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d  {OSX}_pmbuild.pm
16d0: 64 6f 63 2f 69 6e 64 65 78 2e 78 6d 6c 20 7c 20  doc/index.xml | 
16e0: 67 72 65 70 20 2d 76 20 2d 69 20 72 65 71 75 69  grep -v -i requi
16f0: 72 65 20 3e 20 62 75 69 6c 64 2f 63 61 63 6b 65  re > build/cacke
1700: 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53  y_osx_build/${OS
1710: 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63  X}_pmbuild.pmdoc
1720: 2f 69 6e 64 65 78 2e 78 6d 6c 2e 6e 65 77 0a 09  /index.xml.new..
1730: 09 6d 76 20 62 75 69 6c 64 2f 63 61 63 6b 65 79  .mv build/cackey
1740: 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58  _osx_build/${OSX
1750: 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f  }_pmbuild.pmdoc/
1760: 69 6e 64 65 78 2e 78 6d 6c 2e 6e 65 77 20 62 75  index.xml.new bu
1770: 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62  ild/cackey_osx_b
1780: 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75  uild/${OSX}_pmbu
1790: 69 6c 64 2e 70 6d 64 6f 63 2f 69 6e 64 65 78 2e  ild.pmdoc/index.
17a0: 78 6d 6c 0a 09 65 6c 73 65 0a 09 09 45 58 54 3d  xml..else...EXT=
17b0: 70 6b 67 0a 09 66 69 0a 09 69 66 20 5b 20 24 7b  pkg..fi..if [ ${
17c0: 4f 53 58 7d 20 3d 3d 20 22 53 6e 6f 77 6c 65 6f  OSX} == "Snowleo
17d0: 70 61 72 64 22 20 5d 3b 20 74 68 65 6e 0a 09 09  pard" ]; then...
17e0: 63 61 74 20 62 75 69 6c 64 2f 63 61 63 6b 65 79  cat build/cackey
17f0: 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58  _osx_build/${OSX
1800: 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f  }_pmbuild.pmdoc/
1810: 69 6e 64 65 78 2e 78 6d 6c 20 7c 20 73 65 64 20  index.xml | sed 
1820: 27 73 7c 66 6f 72 20 4d 61 63 20 4f 53 20 58 20  's|for Mac OS X 
1830: 53 6e 6f 77 6c 65 6f 70 61 72 64 7c 66 6f 72 20  Snowleopard|for 
1840: 4d 61 63 20 4f 53 20 58 20 53 6e 6f 77 4c 65 6f  Mac OS X SnowLeo
1850: 70 61 72 64 7c 67 27 20 3e 20 62 75 69 6c 64 2f  pard|g' > build/
1860: 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64  cackey_osx_build
1870: 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e  /${OSX}_pmbuild.
1880: 70 6d 64 6f 63 2f 69 6e 64 65 78 2e 78 6d 6c 2e  pmdoc/index.xml.
1890: 6e 65 77 0a 09 6d 76 20 62 75 69 6c 64 2f 63 61  new..mv build/ca
18a0: 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24  ckey_osx_build/$
18b0: 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d  {OSX}_pmbuild.pm
18c0: 64 6f 63 2f 69 6e 64 65 78 2e 78 6d 6c 2e 6e 65  doc/index.xml.ne
18d0: 77 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f  w build/cackey_o
18e0: 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f  sx_build/${OSX}_
18f0: 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f 69 6e  pmbuild.pmdoc/in
1900: 64 65 78 2e 78 6d 6c 0a 09 66 69 0a 09 2f 44 65  dex.xml..fi../De
1910: 76 65 6c 6f 70 65 72 2f 41 70 70 6c 69 63 61 74  veloper/Applicat
1920: 69 6f 6e 73 2f 55 74 69 6c 69 74 69 65 73 2f 50  ions/Utilities/P
1930: 61 63 6b 61 67 65 4d 61 6b 65 72 2e 61 70 70 2f  ackageMaker.app/
1940: 43 6f 6e 74 65 6e 74 73 2f 4d 61 63 4f 53 2f 50  Contents/MacOS/P
1950: 61 63 6b 61 67 65 4d 61 6b 65 72 20 2d 64 20 62  ackageMaker -d b
1960: 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f  uild/cackey_osx_
1970: 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62  build/${OSX}_pmb
1980: 75 69 6c 64 2e 70 6d 64 6f 63 20 2d 6f 20 6d 61  uild.pmdoc -o ma
1990: 63 62 75 69 6c 64 2f 70 6b 67 2f 43 41 43 4b 65  cbuild/pkg/CACKe
19a0: 79 5f 24 7b 43 41 43 4b 45 59 5f 56 45 52 53 49  y_${CACKEY_VERSI
19b0: 4f 4e 7d 5f 24 7b 4f 53 58 7d 2e 24 7b 45 58 54  ON}_${OSX}.${EXT
19c0: 7d 0a 09 74 61 72 20 2d 2d 63 72 65 61 74 65 20  }..tar --create 
19d0: 2d 2d 64 69 72 65 63 74 6f 72 79 20 6d 61 63 62  --directory macb
19e0: 75 69 6c 64 2f 70 6b 67 2f 20 2d 2d 66 69 6c 65  uild/pkg/ --file
19f0: 20 6d 61 63 62 75 69 6c 64 2f 70 6b 67 2f 43 41   macbuild/pkg/CA
1a00: 43 4b 65 79 5f 24 7b 43 41 43 4b 45 59 5f 56 45  CKey_${CACKEY_VE
1a10: 52 53 49 4f 4e 7d 5f 24 7b 4f 53 58 7d 2e 24 7b  RSION}_${OSX}.${
1a20: 45 58 54 7d 2e 74 61 72 20 43 41 43 4b 65 79 5f  EXT}.tar CACKey_
1a30: 24 7b 43 41 43 4b 45 59 5f 56 45 52 53 49 4f 4e  ${CACKEY_VERSION
1a40: 7d 5f 24 7b 4f 53 58 7d 2e 24 7b 45 58 54 7d 0a  }_${OSX}.${EXT}.
1a50: 09 67 7a 69 70 20 2d 39 20 6d 61 63 62 75 69 6c  .gzip -9 macbuil
1a60: 64 2f 70 6b 67 2f 43 41 43 4b 65 79 5f 24 7b 43  d/pkg/CACKey_${C
1a70: 41 43 4b 45 59 5f 56 45 52 53 49 4f 4e 7d 5f 24  ACKEY_VERSION}_$
1a80: 7b 4f 53 58 7d 2e 24 7b 45 58 54 7d 2e 74 61 72  {OSX}.${EXT}.tar
1a90: 0a 09 72 6d 20 2d 72 66 20 6d 61 63 62 75 69 6c  ..rm -rf macbuil
1aa0: 64 2f 70 6b 67 2f 43 41 43 4b 65 79 5f 24 7b 43  d/pkg/CACKey_${C
1ab0: 41 43 4b 45 59 5f 56 45 52 53 49 4f 4e 7d 5f 24  ACKEY_VERSION}_$
1ac0: 7b 4f 53 58 7d 2e 24 7b 45 58 54 7d 0a 09 72 6d  {OSX}.${EXT}..rm
1ad0: 20 2d 66 20 62 75 69 6c 64 2f 63 61 63 6b 65 79   -f build/cackey
1ae0: 5f 6f 73 78 5f 62 75 69 6c 64 2f 63 61 63 6b 65  _osx_build/cacke
1af0: 79 2e 64 79 6c 69 62 0a 09 65 63 68 6f 20 22 24  y.dylib..echo "$
1b00: 7b 4f 53 58 7d 20 62 75 69 6c 64 20 63 6f 6d 70  {OSX} build comp
1b10: 6c 65 74 65 22 0a 7d 0a 0a 23 20 54 61 6b 65 20  lete".}..# Take 
1b20: 63 6f 6d 6d 61 6e 64 20 6c 69 6e 65 20 61 72 67  command line arg
1b30: 75 6d 65 6e 74 73 20 61 6e 64 20 65 78 65 63 75  uments and execu
1b40: 74 65 0a 63 61 73 65 20 22 24 31 22 20 69 6e 0a  te.case "$1" in.
1b50: 09 22 22 29 0a 09 09 75 73 61 67 65 0a 09 09 65  ."")...usage...e
1b60: 78 69 74 20 24 3f 0a 09 3b 3b 0a 0a 09 22 70 61  xit $?..;;..."pa
1b70: 6e 74 68 65 72 22 29 0a 09 09 2e 2f 61 75 74 6f  nther")..../auto
1b80: 67 65 6e 2e 73 68 0a 09 09 70 61 6e 74 68 65 72  gen.sh...panther
1b90: 0a 09 09 65 78 69 74 20 24 3f 0a 09 3b 3b 0a 0a  ...exit $?..;;..
1ba0: 09 22 74 69 67 65 72 22 29 0a 09 09 2e 2f 61 75  ."tiger")..../au
1bb0: 74 6f 67 65 6e 2e 73 68 0a 09 09 74 69 67 65 72  togen.sh...tiger
1bc0: 0a 09 09 65 78 69 74 20 24 3f 0a 09 3b 3b 0a 0a  ...exit $?..;;..
1bd0: 09 22 6c 65 6f 70 61 72 64 22 29 0a 09 09 2e 2f  ."leopard")..../
1be0: 61 75 74 6f 67 65 6e 2e 73 68 0a 09 09 6c 65 6f  autogen.sh...leo
1bf0: 70 61 72 64 0a 09 09 65 78 69 74 20 24 3f 0a 09  pard...exit $?..
1c00: 3b 3b 0a 0a 09 22 73 6e 6f 77 6c 65 6f 70 61 72  ;;..."snowleopar
1c10: 64 22 29 0a 09 09 2e 2f 61 75 74 6f 67 65 6e 2e  d")..../autogen.
1c20: 73 68 0a 09 09 73 6e 6f 77 6c 65 6f 70 61 72 64  sh...snowleopard
1c30: 0a 09 09 65 78 69 74 20 24 3f 0a 09 3b 3b 0a 0a  ...exit $?..;;..
1c40: 09 22 61 6c 6c 22 29 0a 09 09 2e 2f 61 75 74 6f  ."all")..../auto
1c50: 67 65 6e 2e 73 68 0a 09 09 70 61 6e 74 68 65 72  gen.sh...panther
1c60: 0a 09 09 74 69 67 65 72 0a 09 09 6c 65 6f 70 61  ...tiger...leopa
1c70: 72 64 0a 09 09 73 6e 6f 77 6c 65 6f 70 61 72 64  rd...snowleopard
1c80: 0a 09 09 65 78 69 74 20 24 3f 0a 09 3b 3b 0a 0a  ...exit $?..;;..
1c90: 09 22 63 6c 65 61 6e 22 29 0a 09 09 63 6c 65 61  ."clean")...clea
1ca0: 6e 0a 09 09 65 78 69 74 20 24 3f 0a 09 3b 3b 0a  n...exit $?..;;.
1cb0: 0a 09 2a 29 0a 09 09 75 73 61 67 65 0a 09 09 65  ..*)...usage...e
1cc0: 78 69 74 20 24 3f 0a 09 3b 3b 0a 65 73 61 63 20  xit $?..;;.esac 
1cd0: 0a                                               .