fbcat.SlackBuild 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #!/bin/bash
  2. # Slackware build script for fbcat
  3. # Written by B. Watson (yalhcru@gmail.com)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. # 20210910 bkw: update for v0.5.2.
  6. cd $(dirname $0) ; CWD=$(pwd)
  7. PRGNAM=fbcat
  8. VERSION=${VERSION:-0.5.2}
  9. BUILD=${BUILD:-1}
  10. TAG=${TAG:-_SBo}
  11. PKGTYPE=${PKGTYPE:-tgz}
  12. if [ -z "$ARCH" ]; then
  13. case "$( uname -m )" in
  14. i?86) ARCH=i586 ;;
  15. arm*) ARCH=arm ;;
  16. *) ARCH=$( uname -m ) ;;
  17. esac
  18. fi
  19. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  20. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  21. exit 0
  22. fi
  23. TMP=${TMP:-/tmp/SBo}
  24. PKG=$TMP/package-$PRGNAM
  25. OUTPUT=${OUTPUT:-/tmp}
  26. if [ "$ARCH" = "i586" ]; then
  27. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  28. LIBDIRSUFFIX=""
  29. elif [ "$ARCH" = "i686" ]; then
  30. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  31. LIBDIRSUFFIX=""
  32. elif [ "$ARCH" = "x86_64" ]; then
  33. SLKCFLAGS="-O2 -fPIC"
  34. LIBDIRSUFFIX="64"
  35. else
  36. SLKCFLAGS="-O2"
  37. LIBDIRSUFFIX=""
  38. fi
  39. set -e
  40. rm -rf $PKG
  41. mkdir -p $TMP $PKG $OUTPUT
  42. cd $TMP
  43. rm -rf $PRGNAM-$VERSION
  44. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  45. cd $PRGNAM-$VERSION
  46. chown -R root:root .
  47. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  48. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  49. sed -i "s,-g -O2,$SLKCFLAGS," Makefile
  50. make
  51. make -C doc
  52. # fbgrab is a shell script, don't try to strip it
  53. mkdir -p $PKG/usr/bin $PKG/usr/man/man1
  54. install -s -m0755 $PRGNAM $PKG/usr/bin
  55. install -m0755 fbgrab $PKG/usr/bin
  56. gzip -9c < doc/$PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz
  57. gzip -9c < doc/fbgrab.1 > $PKG/usr/man/man1/fbgrab.1.gz
  58. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  59. [ -e COPYING ] && C="COPYING" || C="doc/COPYING"
  60. cp -a $C doc/changelog doc/tested.txt $PKG/usr/doc/$PRGNAM-$VERSION
  61. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  62. mkdir -p $PKG/install
  63. cat $CWD/slack-desc > $PKG/install/slack-desc
  64. cd $PKG
  65. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE