]>
Commit | Line | Data |
---|---|---|
8a74ce61 AG |
1 | #!/bin/sh -e |
2 | # | |
3 | # Helper script for the build process to apply entitlements | |
4 | ||
237377ac AO |
5 | in_place=: |
6 | if [ "$1" = --install ]; then | |
7 | shift | |
8 | in_place=false | |
9 | fi | |
10 | ||
8a74ce61 AG |
11 | SRC="$1" |
12 | DST="$2" | |
13 | ENTITLEMENT="$3" | |
14 | ||
237377ac AO |
15 | if $in_place; then |
16 | trap 'rm "$DST.tmp"' exit | |
17 | cp -af "$SRC" "$DST.tmp" | |
18 | SRC="$DST.tmp" | |
19 | else | |
20 | cd "$MESON_INSTALL_DESTDIR_PREFIX" | |
21 | fi | |
22 | ||
23 | codesign --entitlements "$ENTITLEMENT" --force -s - "$SRC" | |
24 | mv -f "$SRC" "$DST" | |
8a74ce61 | 25 | trap '' exit |