#!/bin/sh -e
[ -z "$DEBUG" ] || set -x
echo "########## bluez5_utils-5.62: staging install ##########"
cd /media/seagate_500G/rk3308_linux5.10/buildroot
PATH="/media/seagate_500G/rk3308_linux5.10/buildroot/output/rockchip_rk3308_b_release/host/bin:/media/seagate_500G/rk3308_linux5.10/buildroot/output/rockchip_rk3308_b_release/host/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"  /usr/bin/make -j5 DESTDIR=/media/seagate_500G/rk3308_linux5.10/buildroot/output/rockchip_rk3308_b_release/host/aarch64-buildroot-linux-gnu/sysroot install -C /media/seagate_500G/rk3308_linux5.10/buildroot/output/rockchip_rk3308_b_release/build/bluez5_utils-5.62/
rm -f -rf  /media/seagate_500G/rk3308_linux5.10/buildroot/output/rockchip_rk3308_b_release/host/aarch64-buildroot-linux-gnu/sysroot/share/info/dir
if test -n "" ; then echo "[7m>>> bluez5_utils 5.62 Fixing package configuration files[27m" ; /usr/bin/sed -i -e  "s,/media/seagate_500G/rk3308_linux5.10/buildroot/output/rockchip_rk3308_b_release/host,@HOST_DIR@,g" -e "s,/media/seagate_500G/rk3308_linux5.10/buildroot/output/rockchip_rk3308_b_release,@BASE_DIR@,g" -e "s,^\(exec_\)\?prefix=.*,\1prefix=@STAGING_DIR@/usr,g" -e "s,-I/usr/,-I@STAGING_DIR@/usr/,g" -e "s,-L/usr/,-L@STAGING_DIR@/usr/,g" -e 's,@STAGING_DIR@,$(dirname $(readlink -e $0))/../..,g' -e 's,@HOST_DIR@,$(dirname $(readlink -e $0))/../../../..,g' -e "s,@BASE_DIR@,/media/seagate_500G/rk3308_linux5.10/buildroot/output/rockchip_rk3308_b_release,g"  ; fi
echo "[7m>>> bluez5_utils 5.62 Fixing libtool files[27m"
for la in $(find /media/seagate_500G/rk3308_linux5.10/buildroot/output/rockchip_rk3308_b_release/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib* -name "*.la"); do cp -a "${la}" "${la}.fixed" && /usr/bin/sed -i -e "s:/media/seagate_500G/rk3308_linux5.10/buildroot/output/rockchip_rk3308_b_release:@BASE_DIR@:g" -e "s:/media/seagate_500G/rk3308_linux5.10/buildroot/output/rockchip_rk3308_b_release/host/aarch64-buildroot-linux-gnu/sysroot:@STAGING_DIR@:g"  -e "s:\(['= ]\)/usr:\\1@STAGING_DIR@/usr:g" -e "s:\(['= ]\)/lib:\\1@STAGING_DIR@/lib:g"  -e "s:@STAGING_DIR@:/media/seagate_500G/rk3308_linux5.10/buildroot/output/rockchip_rk3308_b_release/host/aarch64-buildroot-linux-gnu/sysroot:g" -e "s:@BASE_DIR@:/media/seagate_500G/rk3308_linux5.10/buildroot/output/rockchip_rk3308_b_release:g" "${la}.fixed" && if cmp -s "${la}" "${la}.fixed"; then rm -f "${la}.fixed"; else mv "${la}.fixed" "${la}"; fi || exit 1; done
