Advertisement
Guest User

Untitled

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