groovy.SlackBuild 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. #!/bin/bash
  2. # Slackware build script for groovy
  3. # Originally by Jockey S. Kyd (jockey dot kyd at gmail dot com)
  4. #
  5. # Modified by Ryan P.C. McQuen, WA, ryanpcmcquen@member.fsf.org
  6. # 2017 | Dhaby Xiloj | slack.dhabyx@gmail.com
  7. # This program is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 2 of the License, or
  10. # (at your option) any later version, with the following exception:
  11. # the text of the GPL license may be omitted.
  12. # This program is distributed in the hope that it will be useful, but
  13. # without any warranty; without even the implied warranty of
  14. # merchantability or fitness for a particular purpose. Compiling,
  15. # interpreting, executing or merely reading the text of the program
  16. # may result in lapses of consciousness and/or very being, up to and
  17. # including the end of all existence and the Universe as we know it.
  18. # See the GNU General Public License for more details.
  19. # You may have received a copy of the GNU General Public License
  20. # along with this program (most likely, a file named COPYING). If
  21. # not, see <http://www.gnu.org/licenses/>.
  22. cd $(dirname $0) ; CWD=$(pwd)
  23. PRGNAM=groovy
  24. VERSION=${VERSION:-2.4.10}
  25. BUILD=${BUILD:-1}
  26. TAG=${TAG:-_SBo}
  27. PKGTYPE=${PKGTYPE:-tgz}
  28. if [ -z "$ARCH" ]; then
  29. case "$(uname -m)" in
  30. i?86) ARCH=i586 ;;
  31. arm*) ARCH=arm ;;
  32. *) ARCH=$(uname -m) ;;
  33. esac
  34. fi
  35. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  36. # the name of the created package would be, and then exit. This information
  37. # could be useful to other scripts.
  38. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  39. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  40. exit 0
  41. fi
  42. TMP=${TMP:-/tmp/SBo}
  43. PKG=$TMP/package-$PRGNAM
  44. OUTPUT=${OUTPUT:-/tmp}
  45. if [ "$ARCH" = "x86_64" ]; then
  46. LIBDIRSUFFIX="64"
  47. else
  48. LIBDIRSUFFIX=""
  49. fi
  50. set -e
  51. rm -rf $PKG
  52. mkdir -p $TMP $PKG $OUTPUT
  53. cd $TMP
  54. rm -rf $PRGNAM-$VERSION
  55. unzip $CWD/apache-$PRGNAM-binary-$VERSION.zip
  56. cd $PRGNAM-$VERSION
  57. chown -R root:root .
  58. find -L . \
  59. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  60. -o -perm 511 \) -exec chmod 755 {} \; -o \
  61. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  62. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  63. mkdir -p $PKG/usr/lib$LIBDIRSUFFIX/$PRGNAM
  64. mv {bin,conf,embeddable,grooid,indy,lib} \
  65. $PKG/usr/lib$LIBDIRSUFFIX/$PRGNAM
  66. # clean .bat files
  67. rm $PKG/usr/lib$LIBDIRSUFFIX/$PRGNAM/bin/*.bat
  68. mkdir -p $PKG/usr/bin/
  69. pushd $PKG/usr/lib$LIBDIRSUFFIX/$PRGNAM/bin
  70. for file in *; do
  71. ln -sf /usr/lib$LIBDIRSUFFIX/$PRGNAM/bin/$file $PKG/usr/bin/$file
  72. done
  73. popd
  74. # no need to install these with a .new extension
  75. mkdir -p $PKG/etc/profile.d
  76. cp $CWD/profile.d/$PRGNAM.*sh.new $PKG/etc/profile.d
  77. sed -i "s|@LIBDIR@|/usr/lib$LIBDIRSUFFIX|" $PKG/etc/profile.d/$PRGNAM.*sh.new
  78. chmod 0755 $PKG/etc/profile.d/$PRGNAM.*sh.new
  79. chown root:root $PKG/etc/profile.d/$PRGNAM.*sh.new
  80. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM
  81. unzip $CWD/apache-$PRGNAM-docs-$VERSION.zip -d $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM
  82. cp -r LICENSE licenses NOTICE $PKG/usr/doc/$PRGNAM-$VERSION
  83. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  84. mkdir -p $PKG/install
  85. cat $CWD/slack-desc > $PKG/install/slack-desc
  86. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  87. cd $PKG
  88. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE