File: package_macosx.sh

package info (click to toggle)
embree 3.12.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 27,412 kB
  • sloc: cpp: 173,822; xml: 3,737; ansic: 2,955; python: 1,628; sh: 480; makefile: 193; csh: 42
file content (82 lines) | stat: -rwxr-xr-x 1,905 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash

## Copyright 2009-2020 Intel Corporation
## SPDX-License-Identifier: Apache-2.0

# terminate if some error occurs
set -e

CONFIG=$1
PACKAGE=$2
EMBREE_SIGN_FILE=$3

# create package
cmake --build . --config $CONFIG --target package

# sign PKG package
if [ ${PACKAGE: -4} == ".pkg" ]; then
  if [ -n "${EMBREE_SIGN_FILE}" ]; then
    ${EMBREE_SIGN_FILE} -o runtime $PACKAGE
  fi
fi

primary_bundle_id="com.intel.embree3"
user=$notarization_user
password="@env:notarization_password"

xcrun altool --notarize-app --asc-provider 'IntelCorporationApps' --primary-bundle-id "$primary_bundle_id" --username "$user" --password "$password" --file $PACKAGE 2>&1 | tee notarization_request.log

# get UUID of notarization request
uuid=`cat notarization_request.log | sed -n 's/^[ ]*RequestUUID = //p'`

# query status until no longer in progress
status="in progress"

while [ "$status" = "in progress" ]; do
    
  sleep 60

  xcrun altool --notarization-info "$uuid" --username "$user" --password "$password" 2>&1 | tee notarization_status.log

  status=`cat notarization_status.log | sed -n 's/^[ ]*Status: //p'`

done

logfile=`cat notarization_status.log | sed -n 's/^[ ]*LogFileURL: //p'`
wget -O notarization_logfile.log $logfile
cat notarization_logfile.log

if [ "$status" != "success" ]; then
   echo "Notarization failed!"
   exit 1
fi

issues=`cat notarization_logfile.log | sed -n 's/^[ ]*\"issues\": //p'`

if [ "$issues" != "null" ]; then
  echo "Notarization found issues!"
  exit 1
fi

#filename=${PACKAGE%.*}
#extension=${PACKAGE##*.}

#echo filename=$filename
#echo extension=$extension

#if [ "$extension" = "zip" ]; then
    
#  unzip $PACKAGE

#  for f in `find $filename -type f -perm +111`; do
#    echo staple $f
#    xcrun stapler staple -v $f
#  done

#  rm $PACKAGE
#  zip -R $PACKAGE $filename
#fi

#if [ "$extension" = "pkg" ]; then
#  xcrun stapler staple -v $PACKAGE
#fi