Ok made some more 'progress'...
If i set the environment variable CODESIGN_ALLOCATE as follows then it take care of the errors
Code:
export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
now I get no errors when signing manually but still a problem when I verifying the signing.
Code:
$ codesign -f -s "iPhone Distribution: My Name" --resource-rules=/Users/trapper/Desktop/MyApp/build/Distribution-iphoneos/MyApp.app/ResourceRules.plist --entitlements /Users/trapper/Desktop/MyApp/build/MyApp.build/Distribution-iphoneos/MyApp.build/MyApp.xcent /Users/trapper/Desktop/MyApp/build/Distribution-iphoneos/MyApp.app
/Users/trapper/Desktop/MyApp/build/Distribution-iphoneos/MyApp.app: replacing existing signature
$ codesign -vvvv /Users/trapper/Desktop/MyApp/build/Distribution-iphoneos/MyApp.app
/Users/trapper/Desktop/MyApp/build/Distribution-iphoneos/MyApp.app: a sealed resource is missing or invalid
/Users/trapper/Desktop/MyApp/build/Distribution-iphoneos/MyApp.app/CodeResources: resource modified