123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- #!/usr/bin/env bash
- set -e
- SCRIPT_DIR=$(dirname "$0")
- ROOT_DIR="${SCRIPT_DIR}/../../../../"
- BUILD_DIR="${ROOT_DIR}/build/linux"
- LINUX_INSTALLER_DIR="${ROOT_DIR}/linux/installer"
- LINUX_INSTALLER_COMMON_DIR="${LINUX_INSTALLER_DIR}/common"
- INSTALL_PATH=${SCRIPT_DIR}/output
- rm -fr ${INSTALL_PATH}
- get_arch()
- {
- local a=$(readelf -h $BUILD_DIR/sgx_sign | sed -n '2p' | awk '/:/{print $6}')
- test $a = 02 && echo 'x64' || echo 'x86'
- }
- ARCH=$(get_arch)
- source ${SCRIPT_DIR}/installConfig.${ARCH}
- generate_pkgconfig_files() {
- local TEMPLATE_FOLDER=${SCRIPT_DIR}/pkgconfig/template
- local TARGET_FOLDER=${SCRIPT_DIR}/pkgconfig/${ARCH}
- local VERSION="$1"
-
- rm -fr ${TARGET_FOLDER}
- mkdir -p ${TARGET_FOLDER}
-
- for pkgconfig_file in $(ls -1 ${TEMPLATE_FOLDER}); do
- sed -e "s:@LIB_FOLDER_NAME@:$LIB_DIR:" \
- -e "s:@SGX_VERSION@:$VERSION:" \
- ${TEMPLATE_FOLDER}/$pkgconfig_file > ${TARGET_FOLDER}/$pkgconfig_file
- done
- }
- SGX_VERSION=$(awk '/STRFILEVER/ {print $3}' ${ROOT_DIR}/common/inc/internal/se_version.h|sed 's/^\"\(.*\)\"$/\1/')
- generate_pkgconfig_files $SGX_VERSION
- cp ${LINUX_INSTALLER_COMMON_DIR}/gen_source/gen_source.py ${SCRIPT_DIR}
- python ${SCRIPT_DIR}/gen_source.py --bom=BOMs/sdk_base.txt
- python ${SCRIPT_DIR}/gen_source.py --bom=BOMs/sdk_${ARCH}.txt --cleanup=false
- python ${SCRIPT_DIR}/gen_source.py --bom=../licenses/BOM_license.txt --cleanup=false
- pushd ${INSTALL_PATH} &> /dev/null
- tar -zcvf ${TARBALL_NAME} *
- popd &> /dev/null
|