lighttable.SlackBuild 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #!/bin/sh
  2. # Slackware build script for Light Table
  3. # Ryan P.C. McQuen | Everett, WA | ryanpcmcquen@member.fsf.org
  4. # 2017 | Dhaby Xiloj | slack.dhabyx@gmail.com
  5. # This program is free software: you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 2 of the License, or
  8. # (at your option) any later version, with the following exception:
  9. # the text of the GPL license may be omitted.
  10. # This program is distributed in the hope that it will be useful, but
  11. # without any warranty; without even the implied warranty of
  12. # merchantability or fitness for a particular purpose. Compiling,
  13. # interpreting, executing or merely reading the text of the program
  14. # may result in lapses of consciousness and/or very being, up to and
  15. # including the end of all existence and the Universe as we know it.
  16. # See the GNU General Public License for more details.
  17. # You may have received a copy of the GNU General Public License along
  18. # with this program (most likely, a file named COPYING). If not, see
  19. # <https://www.gnu.org/licenses/>.
  20. PRGNAM=lighttable
  21. SRCNAM=LightTable
  22. VERSION=${VERSION:-0.8.1}
  23. BUILD=${BUILD:-2}
  24. TAG=${TAG:-_SBo}
  25. if [ -z "$ARCH" ]; then
  26. case "$( uname -m )" in
  27. i?86) ARCH=i486 ;;
  28. arm*) ARCH=arm ;;
  29. *) ARCH=$( uname -m ) ;;
  30. esac
  31. fi
  32. CWD=$(pwd)
  33. TMP=${TMP:-/tmp/SBo}
  34. PKG=$TMP/package-$PRGNAM
  35. OUTPUT=${OUTPUT:-/tmp}
  36. set -e
  37. rm -rf $PKG
  38. mkdir -pv $TMP $PKG $OUTPUT
  39. cd $TMP
  40. rm -rf ${SRCNAM}-${VERSION}
  41. tar xvf $CWD/${VERSION}.tar.gz || tar xvf $CWD/${SRCNAM}-${VERSION}.tar.gz
  42. cd ${SRCNAM}-${VERSION}
  43. chown -R root:root .
  44. find -L . \
  45. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  46. -o -perm 511 \) -exec chmod 755 {} \; -o \
  47. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  48. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  49. ## as absurd as this is, we have to run the build script twice,
  50. ## because it always fails the first time,
  51. ## also LEIN_ROOT is important to set, or the script just
  52. ## hangs forever
  53. LEIN_ROOT=true \
  54. script/build.sh --release \
  55. || LEIN_ROOT=true \
  56. script/build.sh --release
  57. mkdir -pv $PKG/opt/${PRGNAM}-${VERSION}-linux/
  58. mv builds/${PRGNAM}-${VERSION}-linux/ $PKG/opt/
  59. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  60. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  61. mkdir -p $PKG/usr/bin
  62. ln -sfv /opt/${PRGNAM}-${VERSION}-linux/$SRCNAM $PKG/usr/bin
  63. ## icon files
  64. install -Dm644 deploy/core/img/lticon.png $PKG/usr/share/pixmaps/$SRCNAM.png
  65. mkdir -p $PKG/usr/share/applications
  66. cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
  67. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  68. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  69. mkdir -p $PKG/install
  70. cat $CWD/slack-desc > $PKG/install/slack-desc
  71. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  72. cd $PKG
  73. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}