]> git.proxmox.com Git - mirror_qemu.git/blame - scripts/entitlement.sh
Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2021-06-24' into staging
[mirror_qemu.git] / scripts / entitlement.sh
CommitLineData
8a74ce61
AG
1#!/bin/sh -e
2#
3# Helper script for the build process to apply entitlements
4
237377ac
AO
5in_place=:
6if [ "$1" = --install ]; then
7 shift
8 in_place=false
9fi
10
8a74ce61
AG
11SRC="$1"
12DST="$2"
13ENTITLEMENT="$3"
14
237377ac
AO
15if $in_place; then
16 trap 'rm "$DST.tmp"' exit
17 cp -af "$SRC" "$DST.tmp"
18 SRC="$DST.tmp"
19else
20 cd "$MESON_INSTALL_DESTDIR_PREFIX"
21fi
22
23codesign --entitlements "$ENTITLEMENT" --force -s - "$SRC"
24mv -f "$SRC" "$DST"
8a74ce61 25trap '' exit