postScript.sh 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/bin/bash
  2. export PATH=/usr/bin/opt/local/bin:/opt/local/sbin:/usr/local/git:$PATH
  3. export SRCROOT="$SRCROOT"
  4. echo "should SCP: -$SHOULD_SCP-"
  5. echo "## check $SRCROOT/postScript.sh for a helpful post script"
  6. # only used if we SCP the deb over, and this only happens if dpkg-deb and fauxsu are installed
  7. ATV_DEVICE_IP=guest-room.local
  8. #say "$SDKROOT"
  9. echo $SDKROOT
  10. BASE_SDK=`basename $SDKROOT`
  11. if [[ $BASE_SDK == *"Simulator"* ]]
  12. then
  13. exit 0
  14. fi
  15. # xcodes path to the the full framework
  16. TARGET_BUILD_FW="$TARGET_BUILD_DIR"/"$PRODUCT_NAME".$WRAPPER_EXTENSION
  17. echo $TARGET_BUILD_FW
  18. DPKG_BUILD_PATH="$SRCROOT"/layout
  19. FW_FOLDER="$DPKG_BUILD_PATH"/Library/Frameworks
  20. echo $FW_FOLDER
  21. FINAL_FW_PATH=$FW_FOLDER/"$PRODUCT_NAME".$WRAPPER_EXTENSION
  22. rm -rf "$FINAL_FW_PATH"
  23. mkdir -p "$FW_FOLDER"
  24. mkdir -p "$FINAL_FW_PATH"
  25. cp -r "$TARGET_BUILD_FW" "$FW_FOLDER"
  26. pushd "$SRCROOT"
  27. find . -name ".DS_Store" | xargs rm -f
  28. EXE_PATH=$FINAL_FW_PATH/$EXECUTABLE_NAME
  29. #exit 0
  30. if [ "$SHOULD_SCP" == "1" ]; then
  31. ldid -S $EXE_PATH
  32. rm -rf $FINAL_FW_PATH/_CodeSignature
  33. /usr/local/bin/fakeroot dpkg-deb -b layout
  34. scp layout.deb root@$ATV_DEVICE_IP:~
  35. ssh root@$ATV_DEVICE_IP "dpkg -i layout.deb ; killall -9 nitoTV ; lsdtrip launch com.nito.nitoTV4"
  36. fi
  37. exit 0