goland.SlackBuild 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #!/bin/bash
  2. #
  3. # Slackware build script for GoLand
  4. # Written by Joielechong (juansspy@gmail.com)
  5. # This script is just a binary repackaging.
  6. cd $(dirname $0) ; CWD=$(pwd)
  7. PRGNAM=goland
  8. ARCNAM=goland
  9. VERSION=${VERSION:-2022.3.2}
  10. BUILD=${BUILD:-1}
  11. TAG=${TAG:-_SBo}
  12. PKGTYPE=${PKGTYPE:-tgz}
  13. ARCH=${ARCH:-x86_64}
  14. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  15. # the name of the created package would be, and then exit. This information
  16. # could be useful to other scripts.
  17. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  18. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  19. exit 0
  20. fi
  21. TMP=${TMP:-/tmp/SBo}
  22. PKG=$TMP/package-$PRGNAM
  23. OUTPUT=${OUTPUT:-/tmp}
  24. set -e
  25. rm -rf $PKG
  26. mkdir -p $TMP $PKG/opt/ $OUTPUT
  27. cd $PKG/opt/
  28. tar xvf $CWD/$ARCNAM-$VERSION.tar.*z
  29. chown -R root:root .
  30. find -L . \
  31. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  32. -o -perm 511 \) -exec chmod 755 {} \; -o \
  33. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  34. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  35. mv * $PRGNAM
  36. mkdir -p $PKG/usr/share/applications
  37. cat << EOF > $PKG/usr/share/applications/$PRGNAM.desktop
  38. [Desktop Entry]
  39. Version=1.0
  40. Type=Application
  41. Path=/opt/$PRGNAM
  42. Exec=/opt/$PRGNAM/bin/$PRGNAM.sh %f
  43. Name=GoLand: A Clever IDE to Go by JetBrains
  44. GenericName=GoLand
  45. Comment=
  46. Icon=$PRGNAM
  47. StartupNotify=true
  48. Categories=Development;IDE;
  49. Terminal=false
  50. EOF
  51. install -D -m 0644 $PKG/opt/$PRGNAM/bin/$PRGNAM.png \
  52. $PKG/usr/share/pixmaps/$PRGNAM.png
  53. mkdir -p $PKG/usr/bin
  54. cat << EOF > $PKG/usr/bin/$PRGNAM
  55. #!/bin/sh
  56. cd \$HOME
  57. /opt/$PRGNAM/bin/$PRGNAM.sh \$@
  58. EOF
  59. chmod 0755 $PKG/usr/bin/$PRGNAM
  60. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  61. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  62. mkdir -p $PKG/install
  63. cat $CWD/slack-desc > $PKG/install/slack-desc
  64. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  65. cd $PKG
  66. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE