netbeans.SlackBuild 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. #!/bin/bash
  2. # Slackware build script for netbeans
  3. # Copyright 2018-2019 Sukma Wardana <sukma.wardana@mail.com>
  4. # Redistribution and use of this script, with or without modification, is
  5. # permitted provided that the following conditions are met:
  6. #
  7. # 1. Redistributions of this script must retain the above copyright
  8. # notice, this list of conditions and the following disclaimer.
  9. #
  10. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  11. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  12. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  13. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  14. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  15. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  16. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  17. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  18. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  19. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  20. cd $(dirname $0) ; CWD=$(pwd)
  21. PRGNAM=netbeans
  22. VERSION=${VERSION:-13}
  23. BUILD=${BUILD:-1}
  24. TAG=${TAG:-_SBo}
  25. PKGTYPE=${PKGTYPE:-tgz}
  26. ARCH=noarch
  27. PKGNAM=netbeans-${VERSION}-bin.zip
  28. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  29. # the name of the created package would be, and then exit. This information
  30. # could be useful to other scripts.
  31. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  32. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  33. exit 0
  34. fi
  35. TMP=${TMP:-/tmp/SBo}
  36. PKG=${TMP}/package-${PRGNAM}
  37. OUTPUT=${OUTPUT:-/tmp}
  38. set -e
  39. rm -rf ${PKG}
  40. mkdir -p ${TMP} ${PKG}/opt ${OUTPUT}
  41. cd ${PKG}/opt
  42. unzip -o ${CWD}/${PKGNAM}
  43. cd ${PRGNAM}
  44. chown -R root:root .
  45. find -L . \
  46. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  47. -o -perm 511 \) -exec chmod 755 {} \; -o \
  48. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  49. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  50. install -D -m 644 ${CWD}/${PRGNAM}.desktop \
  51. ${PKG}/usr/share/applications/${PRGNAM}.desktop
  52. install -D -m 644 ${CWD}/${PRGNAM}.png ${PKG}/usr/share/pixmaps/${PRGNAM}.png
  53. install -D -m 755 ${CWD}/${PRGNAM}.sh ${PKG}/usr/bin/${PRGNAM}
  54. find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  55. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  56. mv $PKG/opt/$PRGNAM/etc/netbeans.conf \
  57. $PKG/opt/$PRGNAM/etc/netbeans.conf.new
  58. mv $PKG/opt/$PRGNAM/etc/netbeans.clusters \
  59. $PKG/opt/$PRGNAM/etc/netbeans.clusters.new
  60. mv $PKG/opt/$PRGNAM/etc/netbeans.import \
  61. $PKG/opt/$PRGNAM/etc/netbeans.import.new
  62. mkdir -p ${PKG}/usr/doc/${PRGNAM}-${VERSION}
  63. cp -a \
  64. DEPENDENCIES LICENSE NOTICE README.html \
  65. ${PKG}/usr/doc/${PRGNAM}-${VERSION}
  66. cat ${CWD}/${PRGNAM}.SlackBuild > \
  67. ${PKG}/usr/doc/${PRGNAM}-${VERSION}/${PRGNAM}.SlackBuild
  68. mkdir -p ${PKG}/install
  69. cat ${CWD}/slack-desc > ${PKG}/install/slack-desc
  70. cat ${CWD}/doinst.sh > ${PKG}/install/doinst.sh
  71. cd ${PKG}
  72. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE