briss.SlackBuild 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. #!/bin/bash
  2. # Slackware build script for briss
  3. # Copyright (c) 2013 Alan Alberghini <414N@slacky.it>
  4. # All rights reserved.
  5. #
  6. # Permission to use, copy, modify, and distribute this software for
  7. # any purpose with or without fee is hereby granted, provided that
  8. # the above copyright notice and this permission notice appear in all
  9. # copies.
  10. #
  11. # THIS SOFTWARE IS PROVIDED AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. # IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. # USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. # SUCH DAMAGE.
  23. # -----------------------------------------------------------------------------
  24. #
  25. # Build history:
  26. #
  27. # 1 - Initial release.
  28. cd $(dirname $0) ; CWD=$(pwd)
  29. PRGNAM=briss
  30. VERSION=${VERSION:-0.9}
  31. BUILD=${BUILD:-1}
  32. TAG=${TAG:-_SBo}
  33. PKGTYPE=${PKGTYPE:-tgz}
  34. ARCH=noarch
  35. DOCS="*.txt"
  36. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  37. # the name of the created package would be, and then exit. This information
  38. # could be useful to other scripts.
  39. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  40. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  41. exit 0
  42. fi
  43. TMP=${TMP:-/tmp/SBo}
  44. PKG=$TMP/package-$PRGNAM
  45. OUTPUT=${OUTPUT:-/tmp}
  46. set -e
  47. rm -rf $PKG
  48. mkdir -p $TMP $PKG $OUTPUT
  49. cd $TMP
  50. rm -rf $PRGNAM-$VERSION
  51. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  52. cd $PRGNAM-$VERSION
  53. chown -R root:root .
  54. find -L . \
  55. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  56. -exec chmod 755 {} \; -o \
  57. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  58. -exec chmod 644 {} \;
  59. mkdir -p $PKG/opt/$PRGNAM \
  60. $PKG/usr/doc/$PRGNAM-$VERSION \
  61. $PKG/usr/bin \
  62. $PKG/usr/share/pixmaps \
  63. $PKG/usr/share/applications
  64. install -m0755 *.jar $PKG/opt/$PRGNAM
  65. install -m0644 $CWD/$PRGNAM.png $PKG/usr/share/pixmaps
  66. install -m0644 $CWD/*.desktop $PKG/usr/share/applications
  67. # Create two executable scripts under /usr/bin:
  68. # - a "normal" one with the name of the program
  69. cat > $PKG/usr/bin/$PRGNAM << END
  70. #!/bin/sh
  71. java -jar /opt/$PRGNAM/$PRGNAM-$VERSION.jar "\$@"
  72. END
  73. chmod 755 $PKG/usr/bin/$PRGNAM
  74. # - an "himem" one with appropriate flags to allocate more memory
  75. cat > $PKG/usr/bin/$PRGNAM-himem << END
  76. #!/bin/sh
  77. java -Xms128m -Xmx1024m -jar /opt/$PRGNAM/$PRGNAM-$VERSION.jar "\$@"
  78. END
  79. chmod 755 $PKG/usr/bin/$PRGNAM-himem
  80. cp -a \
  81. $DOCS \
  82. $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