Xcode/SDL/pkg-support/codesign-frameworks.sh
changeset 8995 d095e572e0d5
parent 7550 ff3e041c27f3
child 8996 b8147002c991
equal deleted inserted replaced
8994:b80b0595975c 8995:d095e572e0d5
     1 #!/bin/sh
     1 #!/bin/sh
     2 
     2 
     3 # WARNING: You may have to run Clean in Xcode after changing CODE_SIGN_IDENTITY! 
     3 # WARNING: You may have to run Clean in Xcode after changing CODE_SIGN_IDENTITY!
     4 
     4 
     5 # Verify that $CODE_SIGN_IDENTITY is set
     5 # Verify that $CODE_SIGN_IDENTITY is set
     6 if [ -z "$CODE_SIGN_IDENTITY" ] ; then
     6 if [ -z "$CODE_SIGN_IDENTITY" ] ; then
     7     echo "CODE_SIGN_IDENTITY needs to be non-empty for codesigning frameworks!"
     7     echo "CODE_SIGN_IDENTITY needs to be non-empty for codesigning frameworks!"
     8 
     8 
    12         # Codesigning is optional for non-release builds.
    12         # Codesigning is optional for non-release builds.
    13         exit 0
    13         exit 0
    14     fi
    14     fi
    15 fi
    15 fi
    16 
    16 
    17 SAVEIFS=$IFS
       
    18 IFS=$(echo -en "\n\b")
       
    19 
       
    20 FRAMEWORK_DIR="${TARGET_BUILD_DIR}"
    17 FRAMEWORK_DIR="${TARGET_BUILD_DIR}"
    21 
    18 
    22 # Loop through all frameworks
    19 # Loop through all frameworks
    23 FRAMEWORKS=`find "${FRAMEWORK_DIR}" -type d -name "*.framework" | sed -e "s/\(.*\)/\1\/Versions\/A\//"`
    20 FRAMEWORKS=`find "${FRAMEWORK_DIR}" -type d -name "*.framework"`
    24 RESULT=$?
    21 RESULT=$?
    25 if [[ $RESULT != 0 ]] ; then
    22 if [[ $RESULT != 0 ]] ; then
    26     exit 1
    23     exit 1
    27 fi
    24 fi
    28 
    25 
    29 echo "Found:"
    26 echo "Found: ${FRAMEWORKS}"
    30 echo "${FRAMEWORKS}"
       
    31 
    27 
    32 for FRAMEWORK in $FRAMEWORKS;
    28 for FRAMEWORK in $FRAMEWORKS;
    33 do
    29 do
    34     echo "Signing '${FRAMEWORK}'"
    30     echo "Signing '${FRAMEWORK}'"
    35     `codesign -f -v -s "${CODE_SIGN_IDENTITY}" "${FRAMEWORK}"`
    31     `codesign -f -v -s "${CODE_SIGN_IDENTITY}" "${FRAMEWORK}"`
    36     RESULT=$?
    32     RESULT=$?
    37     if [[ $RESULT != 0 ]] ; then
    33     if [[ $RESULT != 0 ]] ; then
    38         exit 1
    34         exit 1
    39     fi
    35     fi
    40 done
    36 done
    41 
       
    42 # restore $IFS
       
    43 IFS=$SAVEIFS