Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From e9d18ede6001e8fc1ea2b13ab9bde738a4a5e09f Mon Sep 17 00:00:00 2001
- From: Oleg Andreych <kjiec4@gmail.com>
- Date: Fri, 11 Oct 2024 21:38:52 +0500
- Subject: [PATCH] Fixes due to deb inner dir structure changes.
- ---
- PKGBUILD | 40 ++++++++++++++++++++--------------------
- kesl.ini | 2 ++
- kesl.install | 27 +++++++++++++++------------
- 3 files changed, 37 insertions(+), 32 deletions(-)
- diff --git a/PKGBUILD b/PKGBUILD
- index 97e9a40..7b7e3ad 100644
- --- a/PKGBUILD
- +++ b/PKGBUILD
- @@ -19,15 +19,15 @@ conflicts=( 'eea'
- install=${pkgname}.install
- changelog=${pkgname}.changelog
- # https://www.kaspersky.com/small-to-medium-business-security/downloads/endpoint?ignoreredirects=true
- -source=( "https://products.s.kaspersky-labs.com/endpoints/keslinux10/${pkgver}/multilanguage-${pkgver}/3837323739397c44454c7c31/kesl_${_pkgver}-${_pkgverbuild}_amd64.deb"
- +source=( "https://products.s.kaspersky-labs.com/endpoints/keslinux10/${pkgver}/multilanguage-${pkgver}/3837323739337c44454c7c31/kesl_${_pkgver}-${_pkgverbuild}_amd64.deb"
- "https://products.s.kaspersky-labs.com/endpoints/keslinux10/${pkgver}/multilanguage-${_pkgver_gui}/3837323739397c44454c7c31/kesl-gui_${_pkgver}-${_pkgverbuild}_amd64.deb"
- "${pkgname}.install"
- "kesl.ini"
- "kesl.start.conf")
- sha256sums=('ee96a6082803159c03c884f4280e515bfd33152d8252204f0ee56619ebf37326'
- 'e37e3a352be83514d17706f4af1b289bb4ceb95f731d520a96e52699e609df4e'
- - '926d6136a8c455b5aab649f3be547ca1a82a4920e8467f209c91ae6ee797d08f'
- - '86203f1dcd663763bc9c8d51a98e510523189c7e78a7fb293183095b89bfa6cf'
- + 'ac71d4d46255fbf6fe753283f0f5b2061563f01296730baebd29ee6c7943148c'
- + '0ff72b2d765236817a374fa88d93b7c6fdf4e830c4227bad199063a68fc3edf9'
- '29efcd166bb0fc5baa5a85dc0f41c6c2e253f6b8fd3ee723862496364281cb4c')
- validpgpkeys=('6AFE173577C4CBD621DF217FD093435AA3ED2C4A')
- @@ -36,8 +36,6 @@ package_kesl() {
- mkdir -p ${pkgdir}/usr/src
- mkdir -p ${pkgdir}/etc/init.d
- - KESLIDIR=${pkgdir}/var/opt/kaspersky/kesl/install
- -
- # uncompress base packages
- bsdtar -xf kesl_${_pkgver}-${_pkgverbuild}_amd64.deb
- bsdtar -xf data.tar.xz -C ${pkgdir}/
- @@ -47,6 +45,8 @@ package_kesl() {
- bsdtar -xf control.tar.gz -C ${pkgdir}/var/opt/kaspersky/kesl/pkgscripts
- cp kesl.ini ${pkgdir}/var/opt/kaspersky/kesl/pkgscripts/
- + KESLIDIR=${pkgdir}/var/opt/kaspersky/kesl/install_${pkgver}
- +
- # /usr/local/share/man is owned by pkg filesystem
- mv ${KESLIDIR}/usr/local/share ${KESLIDIR}/usr/
- chmod 755 -R ${KESLIDIR}/usr/
- @@ -63,7 +63,7 @@ package_kesl() {
- done
- # install licenses
- - for lic in $(find ${pkgdir}/var/opt/kaspersky/kesl/install/opt/kaspersky/kesl/doc/ -maxdepth 1 -mindepth 1 -type f |grep license);do
- + for lic in $(find ${KESLIDIR}/opt/kaspersky/kesl/doc/ -maxdepth 1 -mindepth 1 -type f |grep license);do
- install -Dm644 ${lic} "$pkgdir/usr/share/licenses/$pkgname/${lic/*\/}"
- done
- @@ -77,28 +77,28 @@ package_kesl-gui(){
- depends=('kesl' 'freetype2' 'qt5-svg')
- install=${pkgname}.install
- - KESLIDIR=${pkgdir}/var/opt/kaspersky/kesl/install
- -
- bsdtar -xf kesl-gui_${_pkgver}-${_pkgverbuild}_amd64.deb
- bsdtar -xf data.tar.xz -C ${pkgdir}/
- [ ! -d "${pkgdir}/var/opt/kaspersky/kesl-gui/pkgscripts" ] && mkdir -p ${pkgdir}/var/opt/kaspersky/kesl-gui/pkgscripts
- bsdtar -xf control.tar.gz -C ${pkgdir}/var/opt/kaspersky/kesl-gui/pkgscripts
- - chmod 711 ${pkgdir}/var/opt/kaspersky/kesl/install/opt/ \
- - ${pkgdir}/var/opt/kaspersky/kesl/install/opt/kaspersky \
- - ${pkgdir}/var/opt/kaspersky/kesl/install/opt/kaspersky/kesl/ \
- - ${pkgdir}/var/opt/kaspersky/kesl/install/opt/kaspersky/kesl/shared/loc/
- + KESLIDIR=${pkgdir}/var/opt/kaspersky/kesl/install_${pkgver}
- +
- + chmod 711 ${KESLIDIR}/opt/ \
- + ${KESLIDIR}/opt/kaspersky \
- + ${KESLIDIR}/opt/kaspersky/kesl/ \
- + ${KESLIDIR}/opt/kaspersky/kesl/shared/loc/
- chmod 511 ${pkgdir}/var/opt/kaspersky/kesl/ \
- - ${pkgdir}/var/opt/kaspersky/kesl/install \
- - ${pkgdir}/var/opt/kaspersky/kesl/install/opt/kaspersky/kesl/bin/ \
- - ${pkgdir}/var/opt/kaspersky/kesl/install/opt/kaspersky/kesl/lib64/ \
- - ${pkgdir}/var/opt/kaspersky/kesl/install/opt/kaspersky/kesl/libexec/ \
- - ${pkgdir}/var/opt/kaspersky/kesl/install/opt/kaspersky/kesl/shared/ \
- - ${pkgdir}/var/opt/kaspersky/kesl/install/opt/kaspersky/kesl/shared/init/storage/
- -
- - chmod 500 ${pkgdir}/var/opt/kaspersky/kesl/install/opt/kaspersky/kesl/shared/init/
- + ${KESLIDIR} \
- + ${KESLIDIR}/opt/kaspersky/kesl/bin/ \
- + ${KESLIDIR}/opt/kaspersky/kesl/lib64/ \
- + ${KESLIDIR}/opt/kaspersky/kesl/libexec/ \
- + ${KESLIDIR}/opt/kaspersky/kesl/shared/ \
- + ${KESLIDIR}/opt/kaspersky/kesl/shared/init/storage/
- +
- + chmod 500 ${KESLIDIR}/opt/kaspersky/kesl/shared/init/
- }
- diff --git a/kesl.ini b/kesl.ini
- index 7e0bfe0..772abbc 100644
- --- a/kesl.ini
- +++ b/kesl.ini
- @@ -49,3 +49,5 @@ SCHEDULE_AUTOUPDATES=y
- # update interval in minutes (when SCHEDULE_AUTOUPDATES=y).
- # e.g. set this to "120" to run it once (at a random interval) within 120 minutes:
- SCHEDULE_UPDATE_INTERVAL=120
- +
- +GROUP_CLEAN=no
- \ No newline at end of file
- diff --git a/kesl.install b/kesl.install
- index 52342e6..1f9d9d5 100644
- --- a/kesl.install
- +++ b/kesl.install
- @@ -40,11 +40,12 @@ remove_tmp(){
- # this ensures that the kesl install dir isn't tampered and future changes will be added automagically or by
- # extending the following func:
- man_pre(){
- + INSTALL_DIR=/var/opt/kaspersky/kesl/install_${1}
- # man pages
- - cp /var/opt/kaspersky/kesl/install/opt/kaspersky/kesl/libexec/symlinks/man $KTMP/
- - sed -i 's#usr/local/#usr/#g' /var/opt/kaspersky/kesl/install/opt/kaspersky/kesl/libexec/symlinks/man
- + cp ${INSTALL_DIR}/opt/kaspersky/kesl/libexec/symlinks/man $KTMP/
- + sed -i 's#usr/local/#usr/#g' ${INSTALL_DIR}/opt/kaspersky/kesl/libexec/symlinks/man
- - for sl in $(cat /var/opt/kaspersky/kesl/install/opt/kaspersky/kesl/libexec/symlinks/man);do
- + for sl in $(cat ${INSTALL_DIR}/opt/kaspersky/kesl/libexec/symlinks/man);do
- sld=$(dirname $sl)
- [ ! -d $sld ] && mkdir -p $sld
- done
- @@ -52,7 +53,7 @@ man_pre(){
- man_post(){
- # revert man pages symlinks
- - cp $KTMP/man /var/opt/kaspersky/kesl/install/opt/kaspersky/kesl/libexec/symlinks/man
- + cp $KTMP/man /var/opt/kaspersky/kesl/install_${1}/opt/kaspersky/kesl/libexec/symlinks/man
- [ -d "/opt/kaspersky/kesl/libexec/symlinks" ] && cp $KTMP/man /opt/kaspersky/kesl/libexec/symlinks/man
- }
- @@ -121,6 +122,7 @@ kesl_updatedb(){
- post_install(){
- #echo $FUNCNAME
- + VER=$(echo "$1" | cut -d '-' -f 1)
- # load preconfiguration variables and export them
- source /var/opt/kaspersky/kesl/pkgscripts/kesl.ini
- @@ -130,16 +132,16 @@ post_install(){
- done
- KTMP=$(create_tmp)
- #kesl_symlinks
- - man_pre
- + man_pre $VER
- # manually add the link to /opt (really wondering why this is not covered
- # anywhere but likely I am blind:
- - ln -s /var/opt/kaspersky/kesl/install/opt/kaspersky/kesl /opt/kaspersky/
- + ln -s /var/opt/kaspersky/kesl/install_${1}/opt/kaspersky/kesl /opt/kaspersky/
- # exec the debian package postinst
- /var/opt/kaspersky/kesl/pkgscripts/postinst configure
- - man_post
- + man_post $VER
- # execute the kesl installer with preconfigured settings
- echo -e "\e[32m\e[1m ... starting '/opt/kaspersky/kesl/bin/kesl-setup.pl' now\e[0m\n(no need to execute it again after installation has finished)."
- @@ -176,11 +178,11 @@ pre_upgrade(){
- export ${key}=$v ${kkey}=$v
- done
- -
- + VER=echo "$1" | cut -d '-' -f 1
- # exec the debian package preinst
- - man_pre
- + man_pre $VER
- /var/opt/kaspersky/kesl/pkgscripts/preinst upgrade
- - man_post
- + man_post $VER
- remove_tmp "$KTMP"
- }
- @@ -195,12 +197,13 @@ post_upgrade(){
- export ${key}=$v ${kkey}=$v
- done
- KTMP=$(create_tmp)
- + VER=echo "$1" | cut -d '-' -f 1
- #kesl_symlinks
- - man_pre
- + man_pre $VER
- # exec the debian package postinst
- /var/opt/kaspersky/kesl/pkgscripts/preinst configure
- - man_post
- + man_post $VER
- kesl_importconf
- kesl_updatedb
- --
- 2.46.1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement