summaryrefslogtreecommitdiff
path: root/scripts/entitlement.sh
blob: c540fa6435fb6a151e7d2400b28d27bd8f08571b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/sh -e
#
# Helper script for the build process to apply entitlements

SRC="$1"
DST="$2"
ENTITLEMENT="$3"

trap 'rm "$DST.tmp"' exit
cp -af "$SRC" "$DST.tmp"
codesign --entitlements "$ENTITLEMENT" --force -s - "$DST.tmp"
mv "$DST.tmp" "$DST"
trap '' exit