re-typeset.SlackBuild 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #!/bin/bash
  2. # Slackware build script for re-typeset
  3. # Written by B. Watson (urchlay@slackware.uk)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. cd $(dirname $0) ; CWD=$(pwd)
  6. PRGNAM=re-typeset
  7. VERSION=${VERSION:-1.2.0}
  8. BUILD=${BUILD:-1}
  9. TAG=${TAG:-_SBo}
  10. PKGTYPE=${PKGTYPE:-tgz}
  11. if [ -z "$ARCH" ]; then
  12. case "$( uname -m )" in
  13. i?86) ARCH=i586 ;;
  14. arm*) ARCH=arm ;;
  15. *) ARCH=$( uname -m ) ;;
  16. esac
  17. fi
  18. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  19. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  20. exit 0
  21. fi
  22. TMP=${TMP:-/tmp/SBo}
  23. PKG=$TMP/package-$PRGNAM
  24. OUTPUT=${OUTPUT:-/tmp}
  25. # No need for SLKCFLAGS or LIBDIRSUFFIX.
  26. set -e
  27. rm -rf $PKG
  28. mkdir -p $TMP $PKG $OUTPUT
  29. cd $TMP
  30. rm -rf $PRGNAM-$VERSION
  31. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  32. cd $PRGNAM-$VERSION
  33. chown -R root:root .
  34. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  35. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  36. # The Language menu doesn't actually work. For now, it's disabled,
  37. # unless/until someone fixes it (upstream? me? *you*?). If you build
  38. # with LANGMENU=yes, you'll see the menu with 2 entries (English
  39. # and Polish), but it won't actually *do* anything. With LANGMENU=no,
  40. # the UI is English only.
  41. LANGMENU="${LANGMENU:-no}"
  42. if [ "$LANGMENU" = "yes" ]; then
  43. # Look in /usr/share/$PRGNAM for language icons and translations.
  44. patch -p1 < $CWD/paths.diff
  45. else
  46. # Remove the Languages menu entirely.
  47. patch -p1 < $CWD/rm_lang_menu.diff
  48. fi
  49. # The Makefile is a mess... and it's intended for the author's particular
  50. # setup with various cross-compilers installed in his home directory &
  51. # such. Fortunately we can just do this for a native build (and qmake-qt5
  52. # will set CXXFLAGS to the SLKCFLAGS it was compiled with, too):
  53. cd $PRGNAM-src
  54. qmake-qt5
  55. make
  56. # No install target, just put everything where it goes.
  57. mkdir -p $PKG/usr/bin $PKG/usr/share/pixmaps
  58. install -s -m0755 $PRGNAM $PKG/usr/bin
  59. cat img/$PRGNAM.png > $PKG/usr/share/pixmaps/$PRGNAM.png
  60. if [ "$LANGMENU" = "yes" ]; then
  61. # Translations don't get built automatically.
  62. mkdir -p $PKG/usr/share/$PRGNAM
  63. lrelease-qt5 lang/*.ts
  64. for i in img/??.png lang/*.qm; do
  65. cat $i > $PKG/usr/share/$PRGNAM/$( basename $i )
  66. done
  67. fi
  68. # .desktop file written by SlackBuild author. Sorry about the lame little
  69. # 16x16 icon, it's all upstream gave us.
  70. mkdir -p $PKG/usr/share/applications
  71. cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
  72. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  73. cp -a LICENSE.TXT ../README.TXT $PKG/usr/doc/$PRGNAM-$VERSION
  74. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  75. mkdir -p $PKG/install
  76. cat $CWD/slack-desc > $PKG/install/slack-desc
  77. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  78. cd $PKG
  79. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE