Hex Artifact Content

Artifact 353b3acaa2d6accdbc088c8549462d76cfce6986:


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 79 40 63 6f 72  tyne.# kenny@cor
0060: 65 61 64 61 70 74 69 76 65 2e 63 6f 6d 0a 43 41  eadaptive.com.CA
0070: 43 4b 45 59 5f 56 45 52 53 49 4f 4e 3d 60 63 61  CKEY_VERSION=`ca
0080: 74 20 63 6f 6e 66 69 67 75 72 65 2e 61 63 20 7c  t configure.ac |
0090: 20 67 72 65 70 20 41 43 5f 49 4e 49 54 20 7c 20   grep AC_INIT | 
00a0: 63 75 74 20 2d 64 20 22 20 22 20 2d 66 20 32 20  cut -d " " -f 2 
00b0: 7c 20 73 65 64 20 27 73 5f 29 5f 5f 27 60 0a 0a  | sed 's_)__'`..
00c0: 23 20 43 68 65 63 6b 20 74 6f 20 73 65 65 20 69  # Check to see i
00d0: 66 20 77 65 27 72 65 20 62 75 69 6c 64 69 6e 67  f we're building
00e0: 20 6f 6e 20 4d 61 63 20 4f 53 20 58 20 31 30 2e   on Mac OS X 10.
00f0: 37 20 22 4c 69 6f 6e 22 20 6f 72 20 6e 65 77 65  7 "Lion" or newe
0100: 72 0a 69 66 20 5b 20 22 60 75 6e 61 6d 65 20 2d  r.if [ "`uname -
0110: 72 20 7c 20 63 75 74 20 2d 64 20 2e 20 2d 66 20  r | cut -d . -f 
0120: 31 60 22 20 2d 67 65 20 22 31 31 22 20 5d 3b 20  1`" -ge "11" ]; 
0130: 74 68 65 6e 0a 09 4c 49 4f 4e 42 55 49 4c 44 3d  then..LIONBUILD=
0140: 31 0a 66 69 0a 0a 23 20 55 73 61 67 65 20 66 75  1.fi..# Usage fu
0150: 6e 63 74 69 6f 6e 0a 75 73 61 67 65 28 29 20 7b  nction.usage() {
0160: 0a 09 65 63 68 6f 20 22 55 73 61 67 65 3a 20 62  ..echo "Usage: b
0170: 75 69 6c 64 5f 6f 73 78 2e 73 68 20 3c 74 61 72  uild_osx.sh <tar
0180: 67 65 74 3e 22 0a 09 65 63 68 6f 20 57 68 65 72  get>"..echo Wher
0190: 65 20 74 61 72 67 65 74 20 69 73 20 6f 6e 65 20  e target is one 
01a0: 6f 66 3a 0a 09 65 63 68 6f 20 22 20 20 20 20 6c  of:..echo "    l
01b0: 65 6f 70 61 72 64 20 20 2d 20 28 42 75 69 6c 64  eopard  - (Build
01c0: 73 20 55 6e 69 76 65 72 73 61 6c 20 31 30 2e 35  s Universal 10.5
01d0: 20 4c 69 62 72 61 72 79 20 66 6f 72 20 50 50 43   Library for PPC
01e0: 47 34 2f 69 33 38 36 29 22 0a 09 65 63 68 6f 20  G4/i386)"..echo 
01f0: 22 20 20 20 20 73 6c 74 6f 79 6f 73 20 2d 20 28  "    sltoyos - (
0200: 42 75 69 6c 64 73 20 55 6e 69 76 65 72 73 61 6c  Builds Universal
0210: 20 31 30 2e 36 2f 31 30 2e 37 2f 31 30 2e 38 2f   10.6/10.7/10.8/
0220: 31 30 2e 39 2f 31 30 2e 31 30 20 4c 69 62 72 61  10.9/10.10 Libra
0230: 72 79 20 66 6f 72 20 69 33 38 36 2f 78 38 36 5f  ry for i386/x86_
0240: 36 34 29 22 0a 09 65 63 68 6f 20 22 20 20 20 20  64)"..echo "    
0250: 61 6c 6c 20 2d 20 28 42 75 69 6c 64 73 20 66 6f  all - (Builds fo
0260: 72 20 61 6c 6c 20 73 75 70 70 6f 72 74 65 64 20  r all supported 
0270: 74 61 72 67 65 74 73 29 22 0a 09 65 63 68 6f 20  targets)"..echo 
0280: 22 20 20 20 20 63 6c 65 61 6e 20 2d 20 28 43 6c  "    clean - (Cl
0290: 65 61 6e 73 20 75 70 29 22 0a 09 65 63 68 6f 20  eans up)"..echo 
02a0: 22 52 75 6e 20 66 72 6f 6d 20 43 41 43 4b 65 79  "Run from CACKey
02b0: 20 42 75 69 6c 64 20 52 6f 6f 74 2e 22 0a 09 65   Build Root."..e
02c0: 63 68 6f 20 22 22 0a 09 65 63 68 6f 20 22 4e 4f  cho ""..echo "NO
02d0: 54 45 3a 20 20 4c 65 6f 70 61 72 64 20 62 75 69  TE:  Leopard bui
02e0: 6c 64 20 72 65 71 75 69 72 65 73 20 6c 65 67 61  ld requires lega
02f0: 63 79 20 58 43 6f 64 65 20 33 20 63 6f 6d 70 6f  cy XCode 3 compo
0300: 6e 65 6e 74 73 20 69 6e 22 0a 09 65 63 68 6f 20  nents in"..echo 
0310: 22 20 20 20 20 20 20 20 2f 44 65 76 65 6c 6f 70  "       /Develop
0320: 65 72 20 62 65 63 61 75 73 65 20 6f 66 20 50 6f  er because of Po
0330: 77 65 72 50 43 20 73 75 70 70 6f 72 74 2e 22 0a  werPC support.".
0340: 09 65 63 68 6f 20 22 20 20 20 20 20 20 20 41 6c  .echo "       Al
0350: 6c 20 62 75 69 6c 64 73 20 72 65 71 75 69 72 65  l builds require
0360: 20 67 6e 75 74 61 72 2c 20 61 75 74 6f 6d 61 6b   gnutar, automak
0370: 65 2c 20 61 6e 64 20 61 75 74 6f 63 6f 6e 66 2e  e, and autoconf.
0380: 22 0a 09 65 63 68 6f 20 22 20 20 20 20 20 20 20  "..echo "       
0390: 49 66 20 79 6f 75 72 20 6e 65 77 65 72 20 72 65  If your newer re
03a0: 6c 65 61 73 65 20 6f 66 20 58 43 6f 64 65 20 64  lease of XCode d
03b0: 6f 65 73 20 6e 6f 74 20 69 6e 63 6c 75 64 65 20  oes not include 
03c0: 74 68 65 73 65 22 0a 09 65 63 68 6f 20 22 20 20  these"..echo "  
03d0: 20 20 20 20 20 63 6f 6d 70 6f 6e 65 6e 74 73 2c       components,
03e0: 20 49 20 72 65 63 6f 6d 6d 65 6e 64 20 69 6e 73   I recommend ins
03f0: 74 61 6c 6c 69 6e 67 20 74 68 65 6d 20 66 72 6f  talling them fro
0400: 6d 20 4d 61 63 50 6f 72 74 73 2e 22 0a 09 65 78  m MacPorts."..ex
0410: 69 74 20 24 3f 0a 7d 0a 0a 23 20 43 6c 65 61 6e  it $?.}..# Clean
0420: 20 75 70 20 66 75 6e 63 74 69 6f 6e 0a 63 6c 65   up function.cle
0430: 61 6e 28 29 20 7b 0a 09 72 6d 20 2d 66 20 62 75  an() {..rm -f bu
0440: 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62  ild/cackey_osx_b
0450: 75 69 6c 64 2f 63 61 63 6b 65 79 2e 64 79 6c 69  uild/cackey.dyli
0460: 62 0a 09 72 6d 20 2d 72 66 20 62 75 69 6c 64 2f  b..rm -rf build/
0470: 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64  cackey_osx_build
0480: 2f 50 4b 43 53 31 31 2e 74 6f 6b 65 6e 64 0a 09  /PKCS11.tokend..
0490: 72 6d 20 2d 72 66 20 50 4b 43 53 31 31 2e 74 6f  rm -rf PKCS11.to
04a0: 6b 65 6e 64 0a 09 72 6d 20 2d 72 66 20 6d 61 63  kend..rm -rf mac
04b0: 62 75 69 6c 64 0a 09 72 6d 20 2d 72 66 20 62 75  build..rm -rf bu
04c0: 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62  ild/cackey_osx_b
04d0: 75 69 6c 64 2f 2a 2e 70 6d 64 6f 63 0a 09 6d 61  uild/*.pmdoc..ma
04e0: 6b 65 20 64 69 73 74 63 6c 65 61 6e 0a 7d 0a 0a  ke distclean.}..
04f0: 23 20 44 69 72 65 63 74 6f 72 79 20 63 72 65 61  # Directory crea
0500: 74 69 6f 6e 20 66 75 6e 63 74 69 6f 6e 0a 6d 61  tion function.ma
0510: 6b 65 64 69 72 28 29 20 7b 0a 09 69 66 20 5b 20  kedir() {..if [ 
0520: 22 60 75 6e 61 6d 65 20 2d 72 20 7c 20 63 75 74  "`uname -r | cut
0530: 20 2d 64 20 2e 20 2d 66 20 31 60 22 20 2d 6c 74   -d . -f 1`" -lt
0540: 20 22 31 30 22 20 5d 3b 20 74 68 65 6e 0a 09 09   "10" ]; then...
0550: 4c 49 42 54 4f 4f 4c 44 49 52 3d 2f 44 65 76 65  LIBTOOLDIR=/Deve
0560: 6c 6f 70 65 72 2f 75 73 72 2f 73 68 61 72 65 2f  loper/usr/share/
0570: 6c 69 62 74 6f 6f 6c 0a 09 65 6c 73 65 0a 09 09  libtool..else...
0580: 4c 49 42 54 4f 4f 4c 44 49 52 3d 2f 44 65 76 65  LIBTOOLDIR=/Deve
0590: 6c 6f 70 65 72 2f 75 73 72 2f 73 68 61 72 65 2f  loper/usr/share/
05a0: 6c 69 62 74 6f 6f 6c 2f 63 6f 6e 66 69 67 0a 09  libtool/config..
05b0: 66 69 0a 09 69 66 20 5b 20 21 20 2d 64 20 6d 61  fi..if [ ! -d ma
05c0: 63 62 75 69 6c 64 20 5d 3b 20 74 68 65 6e 0a 09  cbuild ]; then..
05d0: 09 6d 6b 64 69 72 20 6d 61 63 62 75 69 6c 64 0a  .mkdir macbuild.
05e0: 09 09 6d 6b 64 69 72 20 6d 61 63 62 75 69 6c 64  ..mkdir macbuild
05f0: 2f 4c 65 6f 70 61 72 64 0a 09 09 6d 6b 64 69 72  /Leopard...mkdir
0600: 20 6d 61 63 62 75 69 6c 64 2f 53 6c 74 6f 79 6f   macbuild/Sltoyo
0610: 73 0a 09 09 6d 6b 64 69 72 20 6d 61 63 62 75 69  s...mkdir macbui
0620: 6c 64 2f 70 6b 67 0a 09 66 69 0a 09 69 66 20 5b  ld/pkg..fi..if [
0630: 20 21 20 2d 66 20 63 6f 6e 66 69 67 2e 67 75 65   ! -f config.gue
0640: 73 73 20 5d 3b 20 74 68 65 6e 0a 09 09 63 70 20  ss ]; then...cp 
0650: 24 7b 4c 49 42 54 4f 4f 4c 44 49 52 7d 2f 63 6f  ${LIBTOOLDIR}/co
0660: 6e 66 69 67 2e 67 75 65 73 73 20 2e 0a 09 66 69  nfig.guess ...fi
0670: 0a 09 69 66 20 5b 20 21 20 2d 66 20 63 6f 6e 66  ..if [ ! -f conf
0680: 69 67 2e 73 75 62 20 5d 3b 20 74 68 65 6e 0a 09  ig.sub ]; then..
0690: 09 63 70 20 24 7b 4c 49 42 54 4f 4f 4c 44 49 52  .cp ${LIBTOOLDIR
06a0: 7d 2f 63 6f 6e 66 69 67 2e 73 75 62 20 2e 0a 09  }/config.sub ...
06b0: 66 69 0a 09 69 66 20 5b 20 21 20 2d 66 20 69 6e  fi..if [ ! -f in
06c0: 73 74 61 6c 6c 2d 73 68 20 5d 3b 20 74 68 65 6e  stall-sh ]; then
06d0: 0a 09 09 63 70 20 24 7b 4c 49 42 54 4f 4f 4c 44  ...cp ${LIBTOOLD
06e0: 49 52 7d 2f 69 6e 73 74 61 6c 6c 2d 73 68 20 2e  IR}/install-sh .
06f0: 0a 09 66 69 0a 7d 0a 0a 23 20 42 75 69 6c 64 20  ..fi.}..# Build 
0700: 66 75 6e 63 74 69 6f 6e 20 66 6f 72 20 4c 65 6f  function for Leo
0710: 70 61 72 64 0a 6c 65 6f 70 61 72 64 28 29 20 7b  pard.leopard() {
0720: 0a 09 6d 61 6b 65 64 69 72 0a 09 48 45 41 44 45  ..makedir..HEADE
0730: 52 53 3d 2f 44 65 76 65 6c 6f 70 65 72 2f 53 44  RS=/Developer/SD
0740: 4b 73 2f 4d 61 63 4f 53 58 31 30 2e 35 2e 73 64  Ks/MacOSX10.5.sd
0750: 6b 2f 53 79 73 74 65 6d 2f 4c 69 62 72 61 72 79  k/System/Library
0760: 2f 46 72 61 6d 65 77 6f 72 6b 73 2f 50 43 53 43  /Frameworks/PCSC
0770: 2e 66 72 61 6d 65 77 6f 72 6b 2f 56 65 72 73 69  .framework/Versi
0780: 6f 6e 73 2f 41 2f 48 65 61 64 65 72 73 2f 0a 09  ons/A/Headers/..
0790: 4c 49 42 52 41 52 59 3d 2f 44 65 76 65 6c 6f 70  LIBRARY=/Develop
07a0: 65 72 2f 53 44 4b 73 2f 4d 61 63 4f 53 58 31 30  er/SDKs/MacOSX10
07b0: 2e 35 2e 73 64 6b 2f 53 79 73 74 65 6d 2f 4c 69  .5.sdk/System/Li
07c0: 62 72 61 72 79 2f 46 72 61 6d 65 77 6f 72 6b 73  brary/Frameworks
07d0: 2f 50 43 53 43 2e 66 72 61 6d 65 77 6f 72 6b 2f  /PCSC.framework/
07e0: 50 43 53 43 0a 09 4c 49 42 3d 22 22 0a 09 41 52  PCSC..LIB=""..AR
07f0: 43 48 4c 49 53 54 3d 22 22 0a 09 44 4c 49 42 3d  CHLIST=""..DLIB=
0800: 22 22 0a 09 44 41 52 43 48 4c 49 53 54 3d 22 22  ""..DARCHLIST=""
0810: 0a 09 4f 53 58 3d 4c 65 6f 70 61 72 64 0a 09 50  ..OSX=Leopard..P
0820: 4b 54 41 52 47 45 54 4f 53 3d 33 0a 09 43 55 52  KTARGETOS=3..CUR
0830: 4f 53 58 56 45 52 3d 31 30 2e 35 0a 09 66 6f 72  OSXVER=10.5..for
0840: 20 48 4f 53 54 20 69 6e 20 70 6f 77 65 72 70 63   HOST in powerpc
0850: 2d 61 70 70 6c 65 2d 64 61 72 77 69 6e 39 20 69  -apple-darwin9 i
0860: 33 38 36 2d 61 70 70 6c 65 2d 64 61 72 77 69 6e  386-apple-darwin
0870: 39 3b 20 64 6f 0a 09 09 67 65 6e 62 75 69 6c 64  9; do...genbuild
0880: 0a 09 64 6f 6e 65 0a 09 6c 69 62 62 75 69 6c 64  ..done..libbuild
0890: 0a 09 70 6b 67 62 75 69 6c 64 0a 7d 0a 0a 23 20  ..pkgbuild.}..# 
08a0: 42 75 69 6c 64 20 66 75 6e 63 74 69 6f 6e 20 66  Build function f
08b0: 6f 72 20 53 6e 6f 77 20 4c 65 6f 70 61 72 64 2f  or Snow Leopard/
08c0: 4c 69 6f 6e 2f 4d 6f 75 6e 74 61 69 6e 20 4c 69  Lion/Mountain Li
08d0: 6f 6e 2f 4d 61 76 65 72 69 63 6b 73 2f 59 6f 73  on/Mavericks/Yos
08e0: 65 6d 69 74 65 0a 73 6c 74 6f 79 6f 73 28 29 20  emite.sltoyos() 
08f0: 7b 0a 09 6d 61 6b 65 64 69 72 0a 09 48 45 41 44  {..makedir..HEAD
0900: 45 52 53 3d 2f 44 65 76 65 6c 6f 70 65 72 2f 53  ERS=/Developer/S
0910: 44 4b 73 2f 4d 61 63 4f 53 58 31 30 2e 36 2e 73  DKs/MacOSX10.6.s
0920: 64 6b 2f 53 79 73 74 65 6d 2f 4c 69 62 72 61 72  dk/System/Librar
0930: 79 2f 46 72 61 6d 65 77 6f 72 6b 73 2f 50 43 53  y/Frameworks/PCS
0940: 43 2e 66 72 61 6d 65 77 6f 72 6b 2f 56 65 72 73  C.framework/Vers
0950: 69 6f 6e 73 2f 41 2f 48 65 61 64 65 72 73 2f 0a  ions/A/Headers/.
0960: 09 4c 49 42 52 41 52 59 3d 2f 44 65 76 65 6c 6f  .LIBRARY=/Develo
0970: 70 65 72 2f 53 44 4b 73 2f 4d 61 63 4f 53 58 31  per/SDKs/MacOSX1
0980: 30 2e 36 2e 73 64 6b 2f 53 79 73 74 65 6d 2f 4c  0.6.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 50 43 53 43 0a 09 4c 49 42 3d 22 22 0a 09 41  /PCSC..LIB=""..A
09c0: 52 43 48 4c 49 53 54 3d 22 22 0a 09 44 4c 49 42  RCHLIST=""..DLIB
09d0: 3d 22 22 0a 09 44 41 52 43 48 4c 49 53 54 3d 22  =""..DARCHLIST="
09e0: 22 0a 09 4f 53 58 3d 53 6c 74 6f 79 6f 73 0a 09  "..OSX=Sltoyos..
09f0: 50 4b 54 41 52 47 45 54 4f 53 3d 33 0a 09 43 55  PKTARGETOS=3..CU
0a00: 52 4f 53 58 56 45 52 3d 31 30 2e 36 0a 09 66 6f  ROSXVER=10.6..fo
0a10: 72 20 48 4f 53 54 20 69 6e 20 69 33 38 36 2d 61  r HOST in i386-a
0a20: 70 70 6c 65 2d 64 61 72 77 69 6e 31 30 20 78 38  pple-darwin10 x8
0a30: 36 5f 36 34 2d 61 70 70 6c 65 2d 64 61 72 77 69  6_64-apple-darwi
0a40: 6e 31 30 3b 20 64 6f 0a 09 09 67 65 6e 62 75 69  n10; do...genbui
0a50: 6c 64 0a 09 64 6f 6e 65 0a 09 6c 69 62 62 75 69  ld..done..libbui
0a60: 6c 64 0a 09 70 6b 67 62 75 69 6c 64 0a 7d 0a 0a  ld..pkgbuild.}..
0a70: 23 20 47 65 6e 65 72 69 63 20 62 75 69 6c 64 20  # Generic build 
0a80: 66 75 6e 63 74 69 6f 6e 0a 67 65 6e 62 75 69 6c  function.genbuil
0a90: 64 28 29 20 7b 0a 09 6d 61 6b 65 20 64 69 73 74  d() {..make dist
0aa0: 63 6c 65 61 6e 0a 09 41 52 43 48 3d 60 65 63 68  clean..ARCH=`ech
0ab0: 6f 20 24 7b 48 4f 53 54 7d 20 7c 20 63 75 74 20  o ${HOST} | cut 
0ac0: 2d 64 20 22 2d 22 20 2d 66 20 31 60 0a 09 69 66  -d "-" -f 1`..if
0ad0: 20 5b 20 24 7b 41 52 43 48 7d 20 3d 3d 20 22 70   [ ${ARCH} == "p
0ae0: 6f 77 65 72 70 63 22 20 5d 3b 20 74 68 65 6e 0a  owerpc" ]; then.
0af0: 09 09 41 52 43 48 3d 22 70 70 63 20 2d 6d 63 70  ..ARCH="ppc -mcp
0b00: 75 3d 47 34 22 0a 09 66 69 0a 09 69 66 20 5b 20  u=G4"..fi..if [ 
0b10: 22 24 7b 4c 49 4f 4e 42 55 49 4c 44 7d 22 20 3d  "${LIONBUILD}" =
0b20: 20 31 20 5d 3b 20 74 68 65 6e 0a 09 09 69 66 20   1 ]; then...if 
0b30: 5b 20 22 24 7b 41 52 43 48 7d 22 20 3d 3d 20 22  [ "${ARCH}" == "
0b40: 70 70 63 20 2d 6d 63 70 75 3d 47 34 22 20 5d 3b  ppc -mcpu=G4" ];
0b50: 20 74 68 65 6e 0a 09 09 09 43 43 3d 2f 44 65 76   then....CC=/Dev
0b60: 65 6c 6f 70 65 72 2f 75 73 72 2f 62 69 6e 2f 70  eloper/usr/bin/p
0b70: 6f 77 65 72 70 63 2d 61 70 70 6c 65 2d 64 61 72  owerpc-apple-dar
0b80: 77 69 6e 31 30 2d 67 63 63 2d 34 2e 32 2e 31 20  win10-gcc-4.2.1 
0b90: 43 58 58 3d 2f 44 65 76 65 6c 6f 70 65 72 2f 75  CXX=/Developer/u
0ba0: 73 72 2f 62 69 6e 2f 70 6f 77 65 72 70 63 2d 61  sr/bin/powerpc-a
0bb0: 70 70 6c 65 2d 64 61 72 77 69 6e 31 30 2d 67 2b  pple-darwin10-g+
0bc0: 2b 2d 34 2e 32 2e 31 20 43 46 4c 41 47 53 3d 22  +-4.2.1 CFLAGS="
0bd0: 2d 6d 33 32 20 2d 6d 63 70 75 3d 47 34 20 2d 49  -m32 -mcpu=G4 -I
0be0: 2f 44 65 76 65 6c 6f 70 65 72 2f 75 73 72 2f 6c  /Developer/usr/l
0bf0: 69 62 2f 67 63 63 2f 70 6f 77 65 72 70 63 2d 61  ib/gcc/powerpc-a
0c00: 70 70 6c 65 2d 64 61 72 77 69 6e 31 30 2f 34 2e  pple-darwin10/4.
0c10: 32 2e 31 2f 69 6e 63 6c 75 64 65 20 2d 69 73 79  2.1/include -isy
0c20: 73 72 6f 6f 74 20 2f 44 65 76 65 6c 6f 70 65 72  sroot /Developer
0c30: 2f 53 44 4b 73 2f 4d 61 63 4f 53 58 31 30 2e 35  /SDKs/MacOSX10.5
0c40: 2e 73 64 6b 22 20 43 50 50 46 4c 41 47 53 3d 22  .sdk" CPPFLAGS="
0c50: 2d 44 5f 4c 49 42 43 5f 4c 49 4d 49 54 53 5f 48  -D_LIBC_LIMITS_H
0c60: 5f 22 20 2e 2f 63 6f 6e 66 69 67 75 72 65 20 2d  _" ./configure -
0c70: 2d 77 69 74 68 2d 70 63 73 63 2d 68 65 61 64 65  -with-pcsc-heade
0c80: 72 73 3d 24 7b 48 45 41 44 45 52 53 7d 20 2d 2d  rs=${HEADERS} --
0c90: 77 69 74 68 2d 70 63 73 63 2d 6c 69 62 73 3d 24  with-pcsc-libs=$
0ca0: 7b 4c 49 42 52 41 52 59 7d 20 2d 2d 68 6f 73 74  {LIBRARY} --host
0cb0: 3d 24 7b 48 4f 53 54 7d 20 2d 2d 65 6e 61 62 6c  =${HOST} --enabl
0cc0: 65 2d 64 6f 64 2d 63 65 72 74 73 2d 6f 6e 2d 68  e-dod-certs-on-h
0cd0: 77 2d 73 6c 6f 74 73 0a 09 09 65 6c 73 65 0a 09  w-slots...else..
0ce0: 09 09 43 46 4c 41 47 53 3d 22 2d 61 72 63 68 20  ..CFLAGS="-arch 
0cf0: 24 7b 41 52 43 48 7d 22 20 2e 2f 63 6f 6e 66 69  ${ARCH}" ./confi
0d00: 67 75 72 65 20 2d 2d 77 69 74 68 2d 70 63 73 63  gure --with-pcsc
0d10: 2d 68 65 61 64 65 72 73 3d 24 7b 48 45 41 44 45  -headers=${HEADE
0d20: 52 53 7d 20 2d 2d 77 69 74 68 2d 70 63 73 63 2d  RS} --with-pcsc-
0d30: 6c 69 62 73 3d 24 7b 4c 49 42 52 41 52 59 7d 20  libs=${LIBRARY} 
0d40: 2d 2d 68 6f 73 74 3d 24 7b 48 4f 53 54 7d 20 2d  --host=${HOST} -
0d50: 2d 65 6e 61 62 6c 65 2d 64 6f 64 2d 63 65 72 74  -enable-dod-cert
0d60: 73 2d 6f 6e 2d 68 77 2d 73 6c 6f 74 73 0a 09 09  s-on-hw-slots...
0d70: 66 69 0a 09 65 6c 73 65 0a 09 09 43 46 4c 41 47  fi..else...CFLAG
0d80: 53 3d 22 2d 61 72 63 68 20 24 7b 41 52 43 48 7d  S="-arch ${ARCH}
0d90: 22 20 2e 2f 63 6f 6e 66 69 67 75 72 65 20 2d 2d  " ./configure --
0da0: 77 69 74 68 2d 70 63 73 63 2d 68 65 61 64 65 72  with-pcsc-header
0db0: 73 3d 24 7b 48 45 41 44 45 52 53 7d 20 2d 2d 77  s=${HEADERS} --w
0dc0: 69 74 68 2d 70 63 73 63 2d 6c 69 62 73 3d 24 7b  ith-pcsc-libs=${
0dd0: 4c 49 42 52 41 52 59 7d 20 2d 2d 68 6f 73 74 3d  LIBRARY} --host=
0de0: 24 7b 48 4f 53 54 7d 20 2d 2d 65 6e 61 62 6c 65  ${HOST} --enable
0df0: 2d 64 6f 64 2d 63 65 72 74 73 2d 6f 6e 2d 68 77  -dod-certs-on-hw
0e00: 2d 73 6c 6f 74 73 0a 09 66 69 0a 09 6d 61 6b 65  -slots..fi..make
0e10: 0a 09 63 70 20 6c 69 62 63 61 63 6b 65 79 2e 64  ..cp libcackey.d
0e20: 79 6c 69 62 20 6d 61 63 62 75 69 6c 64 2f 24 7b  ylib macbuild/${
0e30: 4f 53 58 7d 2f 6c 69 62 63 61 63 6b 65 79 2e 64  OSX}/libcackey.d
0e40: 79 6c 69 62 2e 60 65 63 68 6f 20 24 7b 41 52 43  ylib.`echo ${ARC
0e50: 48 7d 20 7c 20 63 75 74 20 2d 64 20 27 20 27 20  H} | cut -d ' ' 
0e60: 2d 66 20 31 60 0a 09 63 70 20 6c 69 62 63 61 63  -f 1`..cp libcac
0e70: 6b 65 79 5f 67 2e 64 79 6c 69 62 20 6d 61 63 62  key_g.dylib macb
0e80: 75 69 6c 64 2f 24 7b 4f 53 58 7d 2f 6c 69 62 63  uild/${OSX}/libc
0e90: 61 63 6b 65 79 5f 67 2e 64 79 6c 69 62 2e 60 65  ackey_g.dylib.`e
0ea0: 63 68 6f 20 24 7b 41 52 43 48 7d 20 7c 20 63 75  cho ${ARCH} | cu
0eb0: 74 20 2d 64 20 27 20 27 20 2d 66 20 31 60 20 0a  t -d ' ' -f 1` .
0ec0: 7d 0a 0a 23 20 4c 69 62 72 61 72 79 20 62 75 69  }..# Library bui
0ed0: 6c 64 20 66 75 6e 63 74 69 6f 6e 0a 6c 69 62 62  ld function.libb
0ee0: 75 69 6c 64 28 29 20 7b 0a 09 66 6f 72 20 4c 49  uild() {..for LI
0ef0: 42 20 69 6e 20 6d 61 63 62 75 69 6c 64 2f 24 7b  B in macbuild/${
0f00: 4f 53 58 7d 2f 6c 69 62 63 61 63 6b 65 79 2e 64  OSX}/libcackey.d
0f10: 79 6c 69 62 2e 2a 3b 20 64 6f 0a 09 09 41 52 43  ylib.*; do...ARC
0f20: 48 4c 49 53 54 3d 22 24 7b 41 52 43 48 4c 49 53  HLIST="${ARCHLIS
0f30: 54 7d 20 60 65 63 68 6f 20 27 2d 61 72 63 68 20  T} `echo '-arch 
0f40: 27 60 20 60 65 63 68 6f 20 24 7b 4c 49 42 7d 20  '` `echo ${LIB} 
0f50: 7c 20 63 75 74 20 2d 64 20 2e 20 2d 66 20 33 60  | cut -d . -f 3`
0f60: 20 60 65 63 68 6f 20 27 20 27 60 20 60 65 63 68   `echo ' '` `ech
0f70: 6f 20 24 7b 4c 49 42 7d 60 22 0a 09 64 6f 6e 65  o ${LIB}`"..done
0f80: 0a 09 6c 69 70 6f 20 2d 63 72 65 61 74 65 20 24  ..lipo -create $
0f90: 7b 41 52 43 48 4c 49 53 54 7d 20 2d 6f 75 74 70  {ARCHLIST} -outp
0fa0: 75 74 20 6d 61 63 62 75 69 6c 64 2f 24 7b 4f 53  ut macbuild/${OS
0fb0: 58 7d 2f 6c 69 62 63 61 63 6b 65 79 2e 64 79 6c  X}/libcackey.dyl
0fc0: 69 62 0a 09 66 6f 72 20 44 4c 49 42 20 69 6e 20  ib..for DLIB in 
0fd0: 6d 61 63 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 2f  macbuild/${OSX}/
0fe0: 6c 69 62 63 61 63 6b 65 79 5f 67 2e 64 79 6c 69  libcackey_g.dyli
0ff0: 62 2e 2a 3b 20 64 6f 0a 09 09 44 41 52 43 48 4c  b.*; do...DARCHL
1000: 49 53 54 3d 22 24 7b 44 41 52 43 48 4c 49 53 54  IST="${DARCHLIST
1010: 7d 20 60 65 63 68 6f 20 27 2d 61 72 63 68 20 27  } `echo '-arch '
1020: 60 20 60 65 63 68 6f 20 24 7b 44 4c 49 42 7d 20  ` `echo ${DLIB} 
1030: 7c 20 63 75 74 20 2d 64 20 2e 20 2d 66 20 33 60  | cut -d . -f 3`
1040: 20 60 65 63 68 6f 20 27 20 27 60 20 60 65 63 68   `echo ' '` `ech
1050: 6f 20 24 7b 44 4c 49 42 7d 60 22 0a 09 64 6f 6e  o ${DLIB}`"..don
1060: 65 0a 09 6c 69 70 6f 20 2d 63 72 65 61 74 65 20  e..lipo -create 
1070: 24 7b 44 41 52 43 48 4c 49 53 54 7d 20 2d 6f 75  ${DARCHLIST} -ou
1080: 74 70 75 74 20 6d 61 63 62 75 69 6c 64 2f 24 7b  tput macbuild/${
1090: 4f 53 58 7d 2f 6c 69 62 63 61 63 6b 65 79 5f 67  OSX}/libcackey_g
10a0: 2e 64 79 6c 69 62 0a 09 72 6d 20 6d 61 63 62 75  .dylib..rm macbu
10b0: 69 6c 64 2f 24 7b 4f 53 58 7d 2f 6c 69 62 63 61  ild/${OSX}/libca
10c0: 63 6b 65 79 2a 2e 64 79 6c 69 62 2e 2a 0a 7d 0a  ckey*.dylib.*.}.
10d0: 0a 23 20 46 75 6e 63 74 69 6f 6e 20 74 6f 20 62  .# Function to b
10e0: 75 69 6c 64 20 4d 61 63 20 4f 53 20 58 20 50 61  uild Mac OS X Pa
10f0: 63 6b 61 67 65 73 0a 70 6b 67 62 75 69 6c 64 28  ckages.pkgbuild(
1100: 29 20 7b 0a 09 69 66 20 5b 20 22 60 75 6e 61 6d  ) {..if [ "`unam
1110: 65 20 2d 72 20 7c 20 63 75 74 20 2d 64 20 2e 20  e -r | cut -d . 
1120: 2d 66 20 31 60 22 20 2d 6c 74 20 22 31 30 22 20  -f 1`" -lt "10" 
1130: 5d 3b 20 74 68 65 6e 0a 09 09 4c 49 42 43 41 43  ]; then...LIBCAC
1140: 4b 45 59 47 3d 6c 69 62 63 61 63 6b 65 79 67 2e  KEYG=libcackeyg.
1150: 70 6b 67 0a 09 65 6c 73 65 0a 09 09 4c 49 42 43  pkg..else...LIBC
1160: 41 43 4b 45 59 47 3d 6c 69 62 63 61 63 6b 65 79  ACKEYG=libcackey
1170: 5f 67 2e 70 6b 67 0a 09 66 69 0a 09 72 6d 20 2d  _g.pkg..fi..rm -
1180: 66 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f  f build/cackey_o
1190: 73 78 5f 62 75 69 6c 64 2f 63 61 63 6b 65 79 2e  sx_build/cackey.
11a0: 64 79 6c 69 62 0a 09 6c 6e 20 6d 61 63 62 75 69  dylib..ln macbui
11b0: 6c 64 2f 24 7b 4f 53 58 7d 2f 6c 69 62 63 61 63  ld/${OSX}/libcac
11c0: 6b 65 79 2e 64 79 6c 69 62 20 62 75 69 6c 64 2f  key.dylib build/
11d0: 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64  cackey_osx_build
11e0: 2f 63 61 63 6b 65 79 2e 64 79 6c 69 62 0a 09 72  /cackey.dylib..r
11f0: 6d 20 2d 72 66 20 62 75 69 6c 64 2f 63 61 63 6b  m -rf build/cack
1200: 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 50 4b 43  ey_osx_build/PKC
1210: 53 31 31 2e 74 6f 6b 65 6e 64 0a 09 69 66 20 5b  S11.tokend..if [
1220: 20 22 24 7b 4c 49 4f 4e 42 55 49 4c 44 7d 22 20   "${LIONBUILD}" 
1230: 3d 20 31 20 5d 3b 20 74 68 65 6e 0a 09 09 54 41  = 1 ]; then...TA
1240: 52 3d 67 6e 75 74 61 72 0a 09 65 6c 73 65 0a 09  R=gnutar..else..
1250: 09 54 41 52 3d 74 61 72 0a 09 66 69 0a 09 69 66  .TAR=tar..fi..if
1260: 20 5b 20 22 24 7b 4f 53 58 7d 22 20 3d 20 22 4c   [ "${OSX}" = "L
1270: 65 6f 70 61 72 64 22 20 5d 3b 20 74 68 65 6e 0a  eopard" ]; then.
1280: 09 09 63 75 72 6c 20 68 74 74 70 3a 2f 2f 64 65  ..curl http://de
1290: 76 65 6c 2e 6b 76 61 6e 61 6c 73 2e 6f 72 67 2f  vel.kvanals.org/
12a0: 50 4b 43 53 31 31 5f 54 6f 6b 65 6e 64 2f 50 4b  PKCS11_Tokend/PK
12b0: 43 53 31 31 5f 74 6f 6b 65 6e 64 2d 6c 61 74 65  CS11_tokend-late
12c0: 73 74 2e 74 61 72 2e 67 7a 20 7c 20 67 7a 69 70  st.tar.gz | gzip
12d0: 20 2d 64 20 2d 63 20 7c 20 24 7b 54 41 52 7d 20   -d -c | ${TAR} 
12e0: 2d 2d 73 74 72 69 70 2d 63 6f 6d 70 6f 6e 65 6e  --strip-componen
12f0: 74 73 20 33 20 2d 2d 77 69 6c 64 63 61 72 64 73  ts 3 --wildcards
1300: 20 2d 78 20 2d 66 20 2d 20 22 50 4b 43 53 31 31   -x -f - "PKCS11
1310: 5f 74 6f 6b 65 6e 64 2d 2a 2f 70 72 65 62 75 69  _tokend-*/prebui
1320: 6c 74 2f 6c 65 6f 70 61 72 64 2f 50 4b 43 53 31  lt/leopard/PKCS1
1330: 31 2e 74 6f 6b 65 6e 64 22 0a 09 09 6d 76 20 50  1.tokend"...mv P
1340: 4b 43 53 31 31 2e 74 6f 6b 65 6e 64 20 62 75 69  KCS11.tokend bui
1350: 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75  ld/cackey_osx_bu
1360: 69 6c 64 2f 50 4b 43 53 31 31 2e 74 6f 6b 65 6e  ild/PKCS11.token
1370: 64 0a 09 65 6c 73 65 0a 09 09 63 75 72 6c 20 68  d..else...curl h
1380: 74 74 70 3a 2f 2f 64 65 76 65 6c 2e 6b 76 61 6e  ttp://devel.kvan
1390: 61 6c 73 2e 6f 72 67 2f 50 4b 43 53 31 31 5f 54  als.org/PKCS11_T
13a0: 6f 6b 65 6e 64 2f 50 4b 43 53 31 31 5f 74 6f 6b  okend/PKCS11_tok
13b0: 65 6e 64 2d 6c 61 74 65 73 74 2e 74 61 72 2e 67  end-latest.tar.g
13c0: 7a 20 7c 20 67 7a 69 70 20 2d 64 20 2d 63 20 7c  z | gzip -d -c |
13d0: 20 24 7b 54 41 52 7d 20 2d 2d 73 74 72 69 70 2d   ${TAR} --strip-
13e0: 63 6f 6d 70 6f 6e 65 6e 74 73 20 33 20 2d 2d 77  components 3 --w
13f0: 69 6c 64 63 61 72 64 73 20 2d 78 20 2d 66 20 2d  ildcards -x -f -
1400: 20 22 50 4b 43 53 31 31 5f 74 6f 6b 65 6e 64 2d   "PKCS11_tokend-
1410: 2a 2f 70 72 65 62 75 69 6c 74 2f 73 6e 6f 77 6c  */prebuilt/snowl
1420: 65 6f 70 61 72 64 2f 50 4b 43 53 31 31 2e 74 6f  eopard/PKCS11.to
1430: 6b 65 6e 64 22 0a 09 09 6d 76 20 50 4b 43 53 31  kend"...mv PKCS1
1440: 31 2e 74 6f 6b 65 6e 64 20 62 75 69 6c 64 2f 63  1.tokend build/c
1450: 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f  ackey_osx_build/
1460: 50 4b 43 53 31 31 2e 74 6f 6b 65 6e 64 0a 09 66  PKCS11.tokend..f
1470: 69 0a 09 66 6f 72 20 50 4d 44 4f 43 20 69 6e 20  i..for PMDOC in 
1480: 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78  build/cackey_osx
1490: 5f 62 75 69 6c 64 2f 54 65 6d 70 6c 61 74 65 5f  _build/Template_
14a0: 70 6d 62 75 69 6c 64 2f 2a 2e 69 6e 3b 20 64 6f  pmbuild/*.in; do
14b0: 0a 09 09 50 4d 44 4f 43 3d 22 60 65 63 68 6f 20  ...PMDOC="`echo 
14c0: 22 24 7b 50 4d 44 4f 43 7d 22 20 7c 20 73 65 64  "${PMDOC}" | sed
14d0: 20 27 73 7c 6c 2e 69 6e 7c 6c 7c 67 27 20 7c 20   's|l.in|l|g' | 
14e0: 73 65 64 20 27 73 7c 62 75 69 6c 64 2f 63 61 63  sed 's|build/cac
14f0: 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 54 65  key_osx_build/Te
1500: 6d 70 6c 61 74 65 5f 70 6d 62 75 69 6c 64 2f 7c  mplate_pmbuild/|
1510: 7c 67 27 60 22 0a 09 09 55 55 49 44 3d 22 60 70  |g'`"...UUID="`p
1520: 79 74 68 6f 6e 20 2d 63 20 27 69 6d 70 6f 72 74  ython -c 'import
1530: 20 75 75 69 64 3b 20 70 72 69 6e 74 20 75 75 69   uuid; print uui
1540: 64 2e 75 75 69 64 31 28 29 27 20 7c 20 64 64 20  d.uuid1()' | dd 
1550: 63 6f 6e 76 3d 75 63 61 73 65 20 32 3e 2f 64 65  conv=ucase 2>/de
1560: 76 2f 6e 75 6c 6c 60 22 0a 09 09 6d 6b 64 69 72  v/null`"...mkdir
1570: 20 2d 70 20 62 75 69 6c 64 2f 63 61 63 6b 65 79   -p build/cackey
1580: 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58  _osx_build/${OSX
1590: 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 0a  }_pmbuild.pmdoc.
15a0: 09 09 73 65 64 20 22 73 7c 40 40 42 55 49 4c 44  ..sed "s|@@BUILD
15b0: 52 4f 4f 54 44 49 52 40 40 7c 24 28 70 77 64 29  ROOTDIR@@|$(pwd)
15c0: 7c 67 22 20 62 75 69 6c 64 2f 63 61 63 6b 65 79  |g" build/cackey
15d0: 5f 6f 73 78 5f 62 75 69 6c 64 2f 54 65 6d 70 6c  _osx_build/Templ
15e0: 61 74 65 5f 70 6d 62 75 69 6c 64 2f 24 7b 50 4d  ate_pmbuild/${PM
15f0: 44 4f 43 7d 2e 69 6e 20 3e 20 62 75 69 6c 64 2f  DOC}.in > build/
1600: 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64  cackey_osx_build
1610: 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e  /${OSX}_pmbuild.
1620: 70 6d 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d 0a 09  pmdoc/${PMDOC}..
1630: 09 73 65 64 20 22 73 7c 40 40 4f 53 58 56 45 52  .sed "s|@@OSXVER
1640: 53 49 4f 4e 40 40 7c 24 7b 4f 53 58 7d 7c 67 22  SION@@|${OSX}|g"
1650: 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73   build/cackey_os
1660: 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70  x_build/${OSX}_p
1670: 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f 24 7b 50  mbuild.pmdoc/${P
1680: 4d 44 4f 43 7d 20 3e 20 62 75 69 6c 64 2f 63 61  MDOC} > build/ca
1690: 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24  ckey_osx_build/$
16a0: 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d  {OSX}_pmbuild.pm
16b0: 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d 2e 31 0a 09  doc/${PMDOC}.1..
16c0: 09 73 65 64 20 22 73 7c 40 40 55 55 49 44 40 40  .sed "s|@@UUID@@
16d0: 7c 24 7b 55 55 49 44 7d 7c 67 22 20 62 75 69 6c  |${UUID}|g" buil
16e0: 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69  d/cackey_osx_bui
16f0: 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c  ld/${OSX}_pmbuil
1700: 64 2e 70 6d 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d  d.pmdoc/${PMDOC}
1710: 2e 31 20 3e 20 62 75 69 6c 64 2f 63 61 63 6b 65  .1 > build/cacke
1720: 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53  y_osx_build/${OS
1730: 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63  X}_pmbuild.pmdoc
1740: 2f 24 7b 50 4d 44 4f 43 7d 0a 09 09 73 65 64 20  /${PMDOC}...sed 
1750: 22 73 7c 40 40 54 41 52 47 45 54 4f 53 40 40 7c  "s|@@TARGETOS@@|
1760: 24 7b 50 4b 54 41 52 47 45 54 4f 53 7d 7c 67 22  ${PKTARGETOS}|g"
1770: 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73   build/cackey_os
1780: 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70  x_build/${OSX}_p
1790: 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f 24 7b 50  mbuild.pmdoc/${P
17a0: 4d 44 4f 43 7d 20 3e 20 62 75 69 6c 64 2f 63 61  MDOC} > build/ca
17b0: 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24  ckey_osx_build/$
17c0: 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d  {OSX}_pmbuild.pm
17d0: 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d 2e 31 0a 09  doc/${PMDOC}.1..
17e0: 09 73 65 64 20 22 73 7c 40 40 43 55 52 4f 53 58  .sed "s|@@CUROSX
17f0: 56 45 52 40 40 7c 24 7b 43 55 52 4f 53 58 56 45  VER@@|${CUROSXVE
1800: 52 7d 7c 67 22 20 62 75 69 6c 64 2f 63 61 63 6b  R}|g" build/cack
1810: 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f  ey_osx_build/${O
1820: 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f  SX}_pmbuild.pmdo
1830: 63 2f 24 7b 50 4d 44 4f 43 7d 20 3e 20 62 75 69  c/${PMDOC} > bui
1840: 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75  ld/cackey_osx_bu
1850: 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69  ild/${OSX}_pmbui
1860: 6c 64 2e 70 6d 64 6f 63 2f 24 7b 50 4d 44 4f 43  ld.pmdoc/${PMDOC
1870: 7d 2e 31 0a 09 09 73 65 64 20 22 73 7c 40 40 4c  }.1...sed "s|@@L
1880: 49 42 43 41 43 4b 45 59 47 40 40 7c 24 7b 4c 49  IBCACKEYG@@|${LI
1890: 42 43 41 43 4b 45 59 47 7d 7c 67 22 20 62 75 69  BCACKEYG}|g" bui
18a0: 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75  ld/cackey_osx_bu
18b0: 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69  ild/${OSX}_pmbui
18c0: 6c 64 2e 70 6d 64 6f 63 2f 24 7b 50 4d 44 4f 43  ld.pmdoc/${PMDOC
18d0: 7d 2e 31 20 3e 20 62 75 69 6c 64 2f 63 61 63 6b  }.1 > build/cack
18e0: 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f  ey_osx_build/${O
18f0: 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f  SX}_pmbuild.pmdo
1900: 63 2f 24 7b 50 4d 44 4f 43 7d 0a 09 09 63 70 20  c/${PMDOC}...cp 
1910: 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78  build/cackey_osx
1920: 5f 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70 6d  _build/${OSX}_pm
1930: 62 75 69 6c 64 2e 70 6d 64 6f 63 2f 24 7b 50 4d  build.pmdoc/${PM
1940: 44 4f 43 7d 20 62 75 69 6c 64 2f 63 61 63 6b 65  DOC} build/cacke
1950: 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53  y_osx_build/${OS
1960: 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63  X}_pmbuild.pmdoc
1970: 2f 24 7b 50 4d 44 4f 43 7d 2e 31 0a 09 09 6d 76  /${PMDOC}.1...mv
1980: 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73   build/cackey_os
1990: 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70  x_build/${OSX}_p
19a0: 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f 24 7b 50  mbuild.pmdoc/${P
19b0: 4d 44 4f 43 7d 2e 31 20 62 75 69 6c 64 2f 63 61  MDOC}.1 build/ca
19c0: 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24  ckey_osx_build/$
19d0: 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d  {OSX}_pmbuild.pm
19e0: 64 6f 63 2f 24 7b 50 4d 44 4f 43 7d 0a 09 64 6f  doc/${PMDOC}..do
19f0: 6e 65 0a 09 45 58 54 3d 70 6b 67 0a 09 69 66 20  ne..EXT=pkg..if 
1a00: 5b 20 24 7b 4f 53 58 7d 20 3d 3d 20 22 53 6c 74  [ ${OSX} == "Slt
1a10: 6f 79 6f 73 22 20 5d 3b 20 74 68 65 6e 0a 09 09  oyos" ]; then...
1a20: 63 61 74 20 62 75 69 6c 64 2f 63 61 63 6b 65 79  cat build/cackey
1a30: 5f 6f 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58  _osx_build/${OSX
1a40: 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f  }_pmbuild.pmdoc/
1a50: 69 6e 64 65 78 2e 78 6d 6c 20 7c 20 73 65 64 20  index.xml | sed 
1a60: 27 73 7c 66 6f 72 20 4d 61 63 20 4f 53 20 58 20  's|for Mac OS X 
1a70: 53 6c 74 6f 79 6f 73 7c 66 6f 72 20 4d 61 63 20  Sltoyos|for Mac 
1a80: 4f 53 20 58 20 53 4c 74 6f 59 6f 73 7c 67 27 20  OS X SLtoYos|g' 
1a90: 3e 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f  > build/cackey_o
1aa0: 73 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f  sx_build/${OSX}_
1ab0: 70 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f 69 6e  pmbuild.pmdoc/in
1ac0: 64 65 78 2e 78 6d 6c 2e 6e 65 77 0a 09 09 6d 76  dex.xml.new...mv
1ad0: 20 62 75 69 6c 64 2f 63 61 63 6b 65 79 5f 6f 73   build/cackey_os
1ae0: 78 5f 62 75 69 6c 64 2f 24 7b 4f 53 58 7d 5f 70  x_build/${OSX}_p
1af0: 6d 62 75 69 6c 64 2e 70 6d 64 6f 63 2f 69 6e 64  mbuild.pmdoc/ind
1b00: 65 78 2e 78 6d 6c 2e 6e 65 77 20 62 75 69 6c 64  ex.xml.new build
1b10: 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c  /cackey_osx_buil
1b20: 64 2f 24 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64  d/${OSX}_pmbuild
1b30: 2e 70 6d 64 6f 63 2f 69 6e 64 65 78 2e 78 6d 6c  .pmdoc/index.xml
1b40: 0a 09 66 69 0a 09 2f 44 65 76 65 6c 6f 70 65 72  ..fi../Developer
1b50: 2f 41 70 70 6c 69 63 61 74 69 6f 6e 73 2f 55 74  /Applications/Ut
1b60: 69 6c 69 74 69 65 73 2f 50 61 63 6b 61 67 65 4d  ilities/PackageM
1b70: 61 6b 65 72 2e 61 70 70 2f 43 6f 6e 74 65 6e 74  aker.app/Content
1b80: 73 2f 4d 61 63 4f 53 2f 50 61 63 6b 61 67 65 4d  s/MacOS/PackageM
1b90: 61 6b 65 72 20 2d 64 20 62 75 69 6c 64 2f 63 61  aker -d build/ca
1ba0: 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f 24  ckey_osx_build/$
1bb0: 7b 4f 53 58 7d 5f 70 6d 62 75 69 6c 64 2e 70 6d  {OSX}_pmbuild.pm
1bc0: 64 6f 63 20 2d 6f 20 6d 61 63 62 75 69 6c 64 2f  doc -o macbuild/
1bd0: 70 6b 67 2f 43 41 43 4b 65 79 5f 24 7b 43 41 43  pkg/CACKey_${CAC
1be0: 4b 45 59 5f 56 45 52 53 49 4f 4e 7d 5f 24 7b 4f  KEY_VERSION}_${O
1bf0: 53 58 7d 2e 24 7b 45 58 54 7d 0a 09 74 61 72 20  SX}.${EXT}..tar 
1c00: 2d 2d 63 72 65 61 74 65 20 2d 2d 64 69 72 65 63  --create --direc
1c10: 74 6f 72 79 20 6d 61 63 62 75 69 6c 64 2f 70 6b  tory macbuild/pk
1c20: 67 2f 20 2d 2d 66 69 6c 65 20 6d 61 63 62 75 69  g/ --file macbui
1c30: 6c 64 2f 70 6b 67 2f 43 41 43 4b 65 79 5f 24 7b  ld/pkg/CACKey_${
1c40: 43 41 43 4b 45 59 5f 56 45 52 53 49 4f 4e 7d 5f  CACKEY_VERSION}_
1c50: 24 7b 4f 53 58 7d 2e 24 7b 45 58 54 7d 2e 74 61  ${OSX}.${EXT}.ta
1c60: 72 20 43 41 43 4b 65 79 5f 24 7b 43 41 43 4b 45  r CACKey_${CACKE
1c70: 59 5f 56 45 52 53 49 4f 4e 7d 5f 24 7b 4f 53 58  Y_VERSION}_${OSX
1c80: 7d 2e 24 7b 45 58 54 7d 0a 09 67 7a 69 70 20 2d  }.${EXT}..gzip -
1c90: 39 20 6d 61 63 62 75 69 6c 64 2f 70 6b 67 2f 43  9 macbuild/pkg/C
1ca0: 41 43 4b 65 79 5f 24 7b 43 41 43 4b 45 59 5f 56  ACKey_${CACKEY_V
1cb0: 45 52 53 49 4f 4e 7d 5f 24 7b 4f 53 58 7d 2e 24  ERSION}_${OSX}.$
1cc0: 7b 45 58 54 7d 2e 74 61 72 0a 09 72 6d 20 2d 72  {EXT}.tar..rm -r
1cd0: 66 20 6d 61 63 62 75 69 6c 64 2f 70 6b 67 2f 43  f macbuild/pkg/C
1ce0: 41 43 4b 65 79 5f 24 7b 43 41 43 4b 45 59 5f 56  ACKey_${CACKEY_V
1cf0: 45 52 53 49 4f 4e 7d 5f 24 7b 4f 53 58 7d 2e 24  ERSION}_${OSX}.$
1d00: 7b 45 58 54 7d 0a 09 72 6d 20 2d 66 20 62 75 69  {EXT}..rm -f bui
1d10: 6c 64 2f 63 61 63 6b 65 79 5f 6f 73 78 5f 62 75  ld/cackey_osx_bu
1d20: 69 6c 64 2f 63 61 63 6b 65 79 2e 64 79 6c 69 62  ild/cackey.dylib
1d30: 0a 09 72 6d 20 2d 72 66 20 62 75 69 6c 64 2f 63  ..rm -rf build/c
1d40: 61 63 6b 65 79 5f 6f 73 78 5f 62 75 69 6c 64 2f  ackey_osx_build/
1d50: 50 4b 43 53 31 31 2e 74 6f 6b 65 6e 64 0a 09 65  PKCS11.tokend..e
1d60: 63 68 6f 20 22 24 7b 4f 53 58 7d 20 62 75 69 6c  cho "${OSX} buil
1d70: 64 20 63 6f 6d 70 6c 65 74 65 22 0a 7d 0a 0a 23  d complete".}..#
1d80: 20 54 61 6b 65 20 63 6f 6d 6d 61 6e 64 20 6c 69   Take command li
1d90: 6e 65 20 61 72 67 75 6d 65 6e 74 73 20 61 6e 64  ne arguments and
1da0: 20 65 78 65 63 75 74 65 0a 63 61 73 65 20 22 24   execute.case "$
1db0: 31 22 20 69 6e 0a 09 22 22 29 0a 09 09 75 73 61  1" in.."")...usa
1dc0: 67 65 0a 09 09 65 78 69 74 20 24 3f 0a 09 3b 3b  ge...exit $?..;;
1dd0: 0a 0a 09 22 6c 65 6f 70 61 72 64 22 29 0a 09 09  ..."leopard")...
1de0: 2e 2f 61 75 74 6f 67 65 6e 2e 73 68 0a 09 09 6c  ./autogen.sh...l
1df0: 65 6f 70 61 72 64 0a 09 09 65 78 69 74 20 24 3f  eopard...exit $?
1e00: 0a 09 3b 3b 0a 0a 09 22 73 6c 74 6f 79 6f 73 22  ..;;..."sltoyos"
1e10: 29 0a 09 09 2e 2f 61 75 74 6f 67 65 6e 2e 73 68  )..../autogen.sh
1e20: 0a 09 09 73 6c 74 6f 79 6f 73 0a 09 09 65 78 69  ...sltoyos...exi
1e30: 74 20 24 3f 0a 09 3b 3b 0a 0a 09 22 61 6c 6c 22  t $?..;;..."all"
1e40: 29 0a 09 09 2e 2f 61 75 74 6f 67 65 6e 2e 73 68  )..../autogen.sh
1e50: 0a 09 09 6c 65 6f 70 61 72 64 0a 09 09 73 6c 74  ...leopard...slt
1e60: 6f 79 6f 73 0a 09 09 65 63 68 6f 20 22 22 0a 09  oyos...echo ""..
1e70: 09 65 63 68 6f 20 22 41 6c 6c 20 62 75 69 6c 64  .echo "All build
1e80: 73 20 63 6f 6d 70 6c 65 74 65 2e 22 0a 09 09 65  s complete."...e
1e90: 78 69 74 20 24 3f 0a 09 3b 3b 0a 0a 09 22 63 6c  xit $?..;;..."cl
1ea0: 65 61 6e 22 29 0a 09 09 63 6c 65 61 6e 0a 09 09  ean")...clean...
1eb0: 65 78 69 74 20 24 3f 0a 09 3b 3b 0a 0a 09 2a 29  exit $?..;;...*)
1ec0: 0a 09 09 75 73 61 67 65 0a 09 09 65 78 69 74 20  ...usage...exit 
1ed0: 24 3f 0a 09 3b 3b 0a 65 73 61 63 20 0a           $?..;;.esac .