Advertisement
Guest User

Untitled

a guest
Oct 12th, 2024
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.36 KB | None | 0 0
  1. From e9d18ede6001e8fc1ea2b13ab9bde738a4a5e09f Mon Sep 17 00:00:00 2001
  2. From: Oleg Andreych <kjiec4@gmail.com>
  3. Date: Fri, 11 Oct 2024 21:38:52 +0500
  4. Subject: [PATCH] Fixes due to deb inner dir structure changes.
  5.  
  6. ---
  7. PKGBUILD | 40 ++++++++++++++++++++--------------------
  8. kesl.ini | 2 ++
  9. kesl.install | 27 +++++++++++++++------------
  10. 3 files changed, 37 insertions(+), 32 deletions(-)
  11.  
  12. diff --git a/PKGBUILD b/PKGBUILD
  13. index 97e9a40..7b7e3ad 100644
  14. --- a/PKGBUILD
  15. +++ b/PKGBUILD
  16. @@ -19,15 +19,15 @@ conflicts=( 'eea'
  17. install=${pkgname}.install
  18. changelog=${pkgname}.changelog
  19. # https://www.kaspersky.com/small-to-medium-business-security/downloads/endpoint?ignoreredirects=true
  20. -source=( "https://products.s.kaspersky-labs.com/endpoints/keslinux10/${pkgver}/multilanguage-${pkgver}/3837323739397c44454c7c31/kesl_${_pkgver}-${_pkgverbuild}_amd64.deb"
  21. +source=( "https://products.s.kaspersky-labs.com/endpoints/keslinux10/${pkgver}/multilanguage-${pkgver}/3837323739337c44454c7c31/kesl_${_pkgver}-${_pkgverbuild}_amd64.deb"
  22. "https://products.s.kaspersky-labs.com/endpoints/keslinux10/${pkgver}/multilanguage-${_pkgver_gui}/3837323739397c44454c7c31/kesl-gui_${_pkgver}-${_pkgverbuild}_amd64.deb"
  23. "${pkgname}.install"
  24. "kesl.ini"
  25. "kesl.start.conf")
  26. sha256sums=('ee96a6082803159c03c884f4280e515bfd33152d8252204f0ee56619ebf37326'
  27. 'e37e3a352be83514d17706f4af1b289bb4ceb95f731d520a96e52699e609df4e'
  28. - '926d6136a8c455b5aab649f3be547ca1a82a4920e8467f209c91ae6ee797d08f'
  29. - '86203f1dcd663763bc9c8d51a98e510523189c7e78a7fb293183095b89bfa6cf'
  30. + 'ac71d4d46255fbf6fe753283f0f5b2061563f01296730baebd29ee6c7943148c'
  31. + '0ff72b2d765236817a374fa88d93b7c6fdf4e830c4227bad199063a68fc3edf9'
  32. '29efcd166bb0fc5baa5a85dc0f41c6c2e253f6b8fd3ee723862496364281cb4c')
  33. validpgpkeys=('6AFE173577C4CBD621DF217FD093435AA3ED2C4A')
  34.  
  35. @@ -36,8 +36,6 @@ package_kesl() {
  36. mkdir -p ${pkgdir}/usr/src
  37. mkdir -p ${pkgdir}/etc/init.d
  38.  
  39. - KESLIDIR=${pkgdir}/var/opt/kaspersky/kesl/install
  40. -
  41. # uncompress base packages
  42. bsdtar -xf kesl_${_pkgver}-${_pkgverbuild}_amd64.deb
  43. bsdtar -xf data.tar.xz -C ${pkgdir}/
  44. @@ -47,6 +45,8 @@ package_kesl() {
  45. bsdtar -xf control.tar.gz -C ${pkgdir}/var/opt/kaspersky/kesl/pkgscripts
  46. cp kesl.ini ${pkgdir}/var/opt/kaspersky/kesl/pkgscripts/
  47.  
  48. + KESLIDIR=${pkgdir}/var/opt/kaspersky/kesl/install_${pkgver}
  49. +
  50. # /usr/local/share/man is owned by pkg filesystem
  51. mv ${KESLIDIR}/usr/local/share ${KESLIDIR}/usr/
  52. chmod 755 -R ${KESLIDIR}/usr/
  53. @@ -63,7 +63,7 @@ package_kesl() {
  54. done
  55.  
  56. # install licenses
  57. - for lic in $(find ${pkgdir}/var/opt/kaspersky/kesl/install/opt/kaspersky/kesl/doc/ -maxdepth 1 -mindepth 1 -type f |grep license);do
  58. + for lic in $(find ${KESLIDIR}/opt/kaspersky/kesl/doc/ -maxdepth 1 -mindepth 1 -type f |grep license);do
  59. install -Dm644 ${lic} "$pkgdir/usr/share/licenses/$pkgname/${lic/*\/}"
  60. done
  61.  
  62. @@ -77,28 +77,28 @@ package_kesl-gui(){
  63. depends=('kesl' 'freetype2' 'qt5-svg')
  64. install=${pkgname}.install
  65.  
  66. - KESLIDIR=${pkgdir}/var/opt/kaspersky/kesl/install
  67. -
  68. bsdtar -xf kesl-gui_${_pkgver}-${_pkgverbuild}_amd64.deb
  69. bsdtar -xf data.tar.xz -C ${pkgdir}/
  70.  
  71. [ ! -d "${pkgdir}/var/opt/kaspersky/kesl-gui/pkgscripts" ] && mkdir -p ${pkgdir}/var/opt/kaspersky/kesl-gui/pkgscripts
  72. bsdtar -xf control.tar.gz -C ${pkgdir}/var/opt/kaspersky/kesl-gui/pkgscripts
  73.  
  74. - chmod 711 ${pkgdir}/var/opt/kaspersky/kesl/install/opt/ \
  75. - ${pkgdir}/var/opt/kaspersky/kesl/install/opt/kaspersky \
  76. - ${pkgdir}/var/opt/kaspersky/kesl/install/opt/kaspersky/kesl/ \
  77. - ${pkgdir}/var/opt/kaspersky/kesl/install/opt/kaspersky/kesl/shared/loc/
  78. + KESLIDIR=${pkgdir}/var/opt/kaspersky/kesl/install_${pkgver}
  79. +
  80. + chmod 711 ${KESLIDIR}/opt/ \
  81. + ${KESLIDIR}/opt/kaspersky \
  82. + ${KESLIDIR}/opt/kaspersky/kesl/ \
  83. + ${KESLIDIR}/opt/kaspersky/kesl/shared/loc/
  84.  
  85. chmod 511 ${pkgdir}/var/opt/kaspersky/kesl/ \
  86. - ${pkgdir}/var/opt/kaspersky/kesl/install \
  87. - ${pkgdir}/var/opt/kaspersky/kesl/install/opt/kaspersky/kesl/bin/ \
  88. - ${pkgdir}/var/opt/kaspersky/kesl/install/opt/kaspersky/kesl/lib64/ \
  89. - ${pkgdir}/var/opt/kaspersky/kesl/install/opt/kaspersky/kesl/libexec/ \
  90. - ${pkgdir}/var/opt/kaspersky/kesl/install/opt/kaspersky/kesl/shared/ \
  91. - ${pkgdir}/var/opt/kaspersky/kesl/install/opt/kaspersky/kesl/shared/init/storage/
  92. -
  93. - chmod 500 ${pkgdir}/var/opt/kaspersky/kesl/install/opt/kaspersky/kesl/shared/init/
  94. + ${KESLIDIR} \
  95. + ${KESLIDIR}/opt/kaspersky/kesl/bin/ \
  96. + ${KESLIDIR}/opt/kaspersky/kesl/lib64/ \
  97. + ${KESLIDIR}/opt/kaspersky/kesl/libexec/ \
  98. + ${KESLIDIR}/opt/kaspersky/kesl/shared/ \
  99. + ${KESLIDIR}/opt/kaspersky/kesl/shared/init/storage/
  100. +
  101. + chmod 500 ${KESLIDIR}/opt/kaspersky/kesl/shared/init/
  102. }
  103.  
  104.  
  105. diff --git a/kesl.ini b/kesl.ini
  106. index 7e0bfe0..772abbc 100644
  107. --- a/kesl.ini
  108. +++ b/kesl.ini
  109. @@ -49,3 +49,5 @@ SCHEDULE_AUTOUPDATES=y
  110. # update interval in minutes (when SCHEDULE_AUTOUPDATES=y).
  111. # e.g. set this to "120" to run it once (at a random interval) within 120 minutes:
  112. SCHEDULE_UPDATE_INTERVAL=120
  113. +
  114. +GROUP_CLEAN=no
  115. \ No newline at end of file
  116. diff --git a/kesl.install b/kesl.install
  117. index 52342e6..1f9d9d5 100644
  118. --- a/kesl.install
  119. +++ b/kesl.install
  120. @@ -40,11 +40,12 @@ remove_tmp(){
  121. # this ensures that the kesl install dir isn't tampered and future changes will be added automagically or by
  122. # extending the following func:
  123. man_pre(){
  124. + INSTALL_DIR=/var/opt/kaspersky/kesl/install_${1}
  125. # man pages
  126. - cp /var/opt/kaspersky/kesl/install/opt/kaspersky/kesl/libexec/symlinks/man $KTMP/
  127. - sed -i 's#usr/local/#usr/#g' /var/opt/kaspersky/kesl/install/opt/kaspersky/kesl/libexec/symlinks/man
  128. + cp ${INSTALL_DIR}/opt/kaspersky/kesl/libexec/symlinks/man $KTMP/
  129. + sed -i 's#usr/local/#usr/#g' ${INSTALL_DIR}/opt/kaspersky/kesl/libexec/symlinks/man
  130.  
  131. - for sl in $(cat /var/opt/kaspersky/kesl/install/opt/kaspersky/kesl/libexec/symlinks/man);do
  132. + for sl in $(cat ${INSTALL_DIR}/opt/kaspersky/kesl/libexec/symlinks/man);do
  133. sld=$(dirname $sl)
  134. [ ! -d $sld ] && mkdir -p $sld
  135. done
  136. @@ -52,7 +53,7 @@ man_pre(){
  137.  
  138. man_post(){
  139. # revert man pages symlinks
  140. - cp $KTMP/man /var/opt/kaspersky/kesl/install/opt/kaspersky/kesl/libexec/symlinks/man
  141. + cp $KTMP/man /var/opt/kaspersky/kesl/install_${1}/opt/kaspersky/kesl/libexec/symlinks/man
  142. [ -d "/opt/kaspersky/kesl/libexec/symlinks" ] && cp $KTMP/man /opt/kaspersky/kesl/libexec/symlinks/man
  143. }
  144.  
  145. @@ -121,6 +122,7 @@ kesl_updatedb(){
  146.  
  147. post_install(){
  148. #echo $FUNCNAME
  149. + VER=$(echo "$1" | cut -d '-' -f 1)
  150.  
  151. # load preconfiguration variables and export them
  152. source /var/opt/kaspersky/kesl/pkgscripts/kesl.ini
  153. @@ -130,16 +132,16 @@ post_install(){
  154. done
  155. KTMP=$(create_tmp)
  156. #kesl_symlinks
  157. - man_pre
  158. + man_pre $VER
  159.  
  160. # manually add the link to /opt (really wondering why this is not covered
  161. # anywhere but likely I am blind:
  162. - ln -s /var/opt/kaspersky/kesl/install/opt/kaspersky/kesl /opt/kaspersky/
  163. + ln -s /var/opt/kaspersky/kesl/install_${1}/opt/kaspersky/kesl /opt/kaspersky/
  164.  
  165. # exec the debian package postinst
  166. /var/opt/kaspersky/kesl/pkgscripts/postinst configure
  167.  
  168. - man_post
  169. + man_post $VER
  170.  
  171. # execute the kesl installer with preconfigured settings
  172. 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)."
  173. @@ -176,11 +178,11 @@ pre_upgrade(){
  174. export ${key}=$v ${kkey}=$v
  175. done
  176.  
  177. -
  178. + VER=echo "$1" | cut -d '-' -f 1
  179. # exec the debian package preinst
  180. - man_pre
  181. + man_pre $VER
  182. /var/opt/kaspersky/kesl/pkgscripts/preinst upgrade
  183. - man_post
  184. + man_post $VER
  185.  
  186. remove_tmp "$KTMP"
  187. }
  188. @@ -195,12 +197,13 @@ post_upgrade(){
  189. export ${key}=$v ${kkey}=$v
  190. done
  191. KTMP=$(create_tmp)
  192. + VER=echo "$1" | cut -d '-' -f 1
  193. #kesl_symlinks
  194. - man_pre
  195. + man_pre $VER
  196.  
  197. # exec the debian package postinst
  198. /var/opt/kaspersky/kesl/pkgscripts/preinst configure
  199. - man_post
  200. + man_post $VER
  201.  
  202. kesl_importconf
  203. kesl_updatedb
  204. --
  205. 2.46.1
  206.  
  207.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement