idea.SlackBuild 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. #!/bin/bash
  2. #
  3. # Slackware build script for IntelliJ IDEA
  4. # Written by Mario Antunes (mariolpantunes@gmail.com)
  5. # This script is just a binary repackaging.
  6. cd $(dirname $0) ; CWD=$(pwd)
  7. PRGNAM=idea
  8. ARCNAM=ideaIC
  9. VERSION=${VERSION:-2022.3}
  10. BUILD=${BUILD:-1}
  11. TAG=${TAG:-_SBo}
  12. PKGTYPE=${PKGTYPE:-tgz}
  13. ARCH=x86_64
  14. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  15. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  16. exit 0
  17. fi
  18. TMP=${TMP:-/tmp/SBo}
  19. PKG=$TMP/package-$PRGNAM
  20. OUTPUT=${OUTPUT:-/tmp}
  21. set -e
  22. rm -rf $PKG
  23. mkdir -p $TMP $PKG/opt/ $OUTPUT
  24. cd $PKG/opt/
  25. tar xvf $CWD/$ARCNAM-$VERSION.tar.*z
  26. chown -R root:root .
  27. find -L . \
  28. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  29. -o -perm 511 \) -exec chmod 755 {} \; -o \
  30. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  31. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  32. mv * $PRGNAM
  33. mkdir -p $PKG/etc/profile.d
  34. cat << EOF > $PKG/etc/profile.d/$PRGNAM.sh
  35. #!/bin/sh
  36. export IDEA_HOME=/opt/idea
  37. export IDEA_JDK=$JAVA_HOME
  38. export PATH=\$PATH:\$IDEA_HOME/bin
  39. EOF
  40. cat << EOF > $PKG/etc/profile.d/$PRGNAM.csh
  41. #!/bin/csh
  42. setenv IDEA_HOME /opt/idea
  43. setenv IDEA_JDK $JAVA_HOME
  44. setenv PATH \$PATH:\$IDEA_HOME/bin
  45. EOF
  46. chmod 755 $PKG/etc/profile.d/*
  47. mkdir -p $PKG/usr/share/applications
  48. cat << EOF > $PKG/usr/share/applications/$PRGNAM.desktop
  49. [Desktop Entry]
  50. Version=1.0
  51. Type=Application
  52. Path=/opt/$PRGNAM
  53. Exec=$PRGNAM.sh %f
  54. Name=IntelliJ IDEA Community Edition
  55. GenericName=IntelliJ IDEA
  56. Comment=Develop with pleasure!
  57. Icon=$PRGNAM
  58. StartupNotify=true
  59. Categories=Development;IDE;
  60. Terminal=false
  61. StartupWMClass=jetbrains-idea-ce
  62. EOF
  63. install -D -m 0644 $PKG/opt/$PRGNAM/bin/$PRGNAM.png \
  64. $PKG/usr/share/pixmaps/$PRGNAM.png
  65. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  66. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  67. mkdir -p $PKG/install
  68. cat $CWD/slack-desc > $PKG/install/slack-desc
  69. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  70. cd $PKG
  71. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE