From 70161dd04086a37c015d6da56ca05c30c5999182 Mon Sep 17 00:00:00 2001 From: dobedobedo Date: Fri, 20 Aug 2021 15:20:52 +0300 Subject: [PATCH] Change the licence rehostable directory --- .SRCINFO | 2 +- PKGBUILD | 8 +++++++- agisoft-metashape-pro.install | 16 ++++++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.SRCINFO b/.SRCINFO index d7f1837..1c0db5c 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,7 +1,7 @@ pkgbase = agisoft-metashape-pro pkgdesc = Photogrammetric processing of digital images and 3D spatial data generation software. Professional edition pkgver = 1.7.4 - pkgrel = 2 + pkgrel = 3 url = https://www.agisoft.com/ install = agisoft-metashape-pro.install arch = x86_64 diff --git a/PKGBUILD b/PKGBUILD index 51143d8..e2586b3 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -2,7 +2,7 @@ _pkgname=metashape-pro pkgname=agisoft-${_pkgname} pkgver=1.7.4 -pkgrel=2 +pkgrel=3 pkgdesc="Photogrammetric processing of digital images and 3D spatial data generation software. Professional edition" arch=('x86_64') url="https://www.agisoft.com/" @@ -154,6 +154,12 @@ package() { install -Dm755 "$srcdir/agisoft-network-monitor" "$pkgdir/usr/bin/agisoft-network-monitor" install -Dm755 "$srcdir/agisoft-viewer" "$pkgdir/usr/bin/agisoft-viewer" + # Set the rehostable directory and environment variables in executables for activation + mkdir -p "${pkgdir}/opt/agisoft/${_pkgname}/rehostable" + sed -i '/export LD_LIBRARY_PATH/a\\nAGISOFT_REHOST_PATH=\$dirname/rehostable\nexport AGISOFT_REHOST_PATH' "${pkgdir}/opt/agisoft/${_pkgname}/metashape.sh" + sed -i '/export LD_LIBRARY_PATH/a\\nAGISOFT_REHOST_PATH=\$dirname/rehostable\nexport AGISOFT_REHOST_PATH' "${pkgdir}/opt/agisoft/${_pkgname}/viewer.sh" + sed -i '/export LD_LIBRARY_PATH/a\\nAGISOFT_REHOST_PATH=\$dirname/rehostable\nexport AGISOFT_REHOST_PATH' "${pkgdir}/opt/agisoft/${_pkgname}/monitor.sh" + # Set correct permission chmod -R g=u "$pkgdir/opt/agisoft/${_pkgname}" chmod -R o=u "$pkgdir/opt/agisoft/${_pkgname}" diff --git a/agisoft-metashape-pro.install b/agisoft-metashape-pro.install index 30721a7..93079df 100644 --- a/agisoft-metashape-pro.install +++ b/agisoft-metashape-pro.install @@ -11,6 +11,22 @@ post_install() { echo } +pre_upgrade() { + echo "Deactivating the product..." + agisoft-metashape-pro --deactivate 2>/dev/null +} + +post_upgrade() { + echo + echo "This upgrade change the rehostable directory for activation" + echo + echo "Therefore, we deactivated the licence to avoid it becomes invalid" + echo + echo "Please use sudo agisoft-metashape-pro --activate to reactivate your licence" + echo + echo "This behaviour will be removed in the next release" +} + pre_remove() { echo "Deactivating the product..." agisoft-metashape-pro --deactivate 2>/dev/null