knime.SlackBuild 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #!/bin/sh -e
  2. # Slackware build script for knime
  3. # Copyright 2014 Stephen Van Berg USA
  4. # All rights reserved.
  5. #
  6. # Redistribution and use of this script, with or without modification, is
  7. # permitted provided that the following conditions are met:
  8. #
  9. # 1. Redistributions of this script must retain the above copyright
  10. # notice, this list of conditions and the following disclaimer.
  11. #
  12. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  13. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  15. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  17. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  18. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  19. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  20. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  21. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  22. # Stephen Van Berg 2014-4-17
  23. # Updated 2015-07-31 for knime version 2.12.0
  24. PRGNAM=knime
  25. VERSION=${VERSION:-2.12.0}
  26. BUILD=${BUILD:-1}
  27. TAG=${TAG:-_SBo}
  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. CWD=$(pwd)
  36. TMP=${TMP:-/tmp/SBo}
  37. PKG=$TMP/package-$PRGNAM
  38. OUTPUT=${OUTPUT:-/tmp}
  39. set -e
  40. rm -rf $PKG
  41. mkdir -p $TMP $PKG/opt $OUTPUT
  42. cd $PKG/opt
  43. if [ "$ARCH" = "x86_64" ]; then
  44. tar -xvf $CWD/$PRGNAM\_$VERSION.linux.gtk.$ARCH.tar.gz
  45. elif [ "$ARCH" = "i586" ]; then
  46. tar -xvf $CWD/$PRGNAM\_$VERSION.linux.gtk.x86.tar.gz
  47. else
  48. printf "$ARCH is not supported...\n" ; exit 1
  49. fi
  50. mv $PRGNAM\_$VERSION $PRGNAM # pull out version from target dir
  51. mkdir -p $PKG/usr/bin
  52. chown -R root:root .
  53. find -L . \
  54. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  55. -o -perm 511 \) -exec chmod 755 {} \; -o \
  56. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  57. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  58. install -m755 $CWD/$PRGNAM.wrapper $PKG/usr/bin/$PRGNAM # Put wrapper exec (starts program in homedir) in /usr/bin
  59. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  60. cd $PKG/opt/$PRGNAM
  61. cp -a LICENSE.TXT README.txt quickstart.pdf $PKG/usr/doc/$PRGNAM-$VERSION
  62. mkdir -p $PKG/usr/share/pixmaps $PKG/usr/share/applications
  63. cp -a $PKG/opt/$PRGNAM/icon.xpm $PKG/usr/share/pixmaps/$PRGNAM.xpm
  64. cp -a $CWD/$PRGNAM.desktop $PKG/usr/share/applications/$PRGNAM.desktop
  65. mkdir -p $PKG/install
  66. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  67. cat $CWD/slack-desc > $PKG/install/slack-desc
  68. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  69. cd $PKG
  70. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}