fbv.SlackBuild 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #!/bin/bash
  2. # Slackware build script for fbv
  3. # Written by B. Watson (yalhcru@gmail.com)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. # The real DOWNLOAD link is http://s-tech.elsat.net.pl/fbv/fbv-1.0b.tar.gz
  6. # but it seems to be intermittently broken, so the .info file has a mirrored
  7. # copy.
  8. cd $(dirname $0) ; CWD=$(pwd)
  9. PRGNAM=fbv
  10. VERSION=${VERSION:-1.0b}
  11. BUILD=${BUILD:-1}
  12. TAG=${TAG:-_SBo}
  13. PKGTYPE=${PKGTYPE:-tgz}
  14. if [ -z "$ARCH" ]; then
  15. case "$( uname -m )" in
  16. i?86) ARCH=i586 ;;
  17. arm*) ARCH=arm ;;
  18. *) ARCH=$( uname -m ) ;;
  19. esac
  20. fi
  21. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  22. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  23. exit 0
  24. fi
  25. TMP=${TMP:-/tmp/SBo}
  26. PKG=$TMP/package-$PRGNAM
  27. OUTPUT=${OUTPUT:-/tmp}
  28. if [ "$ARCH" = "i586" ]; then
  29. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  30. LIBDIRSUFFIX=""
  31. elif [ "$ARCH" = "i686" ]; then
  32. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  33. LIBDIRSUFFIX=""
  34. elif [ "$ARCH" = "x86_64" ]; then
  35. SLKCFLAGS="-O2 -fPIC"
  36. LIBDIRSUFFIX="64"
  37. else
  38. SLKCFLAGS="-O2"
  39. LIBDIRSUFFIX=""
  40. fi
  41. set -e
  42. rm -rf $PKG
  43. mkdir -p $TMP $PKG $OUTPUT
  44. cd $TMP
  45. rm -rf $PRGNAM-$VERSION
  46. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  47. cd $PRGNAM-$VERSION
  48. chown -R root:root .
  49. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  50. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  51. # Check for new giflib API, apply patch only if needed. This changed
  52. # between Slack 14.1 and 14.2.
  53. grep -q DGifOpenFileName.*Error /usr/include/gif_lib.h && \
  54. patch -p1 < $CWD/giflib5_api.diff
  55. # Patch is needed for linpng-1.6, and does no harm on 1.4.
  56. patch -p1 < $CWD/png16_api.diff
  57. # Man page is missing a few options, and --help output is wrong.
  58. # Also next/prev/quit options weren't documented in either place.
  59. patch -p1 < $CWD/manhelp.diff
  60. # Not an autoconf script, doesn't take standard options.
  61. ./configure \
  62. --prefix=/usr \
  63. --mandir=/usr/man
  64. # have to do this instead, to use our CFLAGS:
  65. sed -i "s,-O2,$SLKCFLAGS," Makefile
  66. make
  67. strip $PRGNAM
  68. mkdir -p $PKG/usr/bin $PKG/usr/man/man1
  69. make install DESTDIR=$PKG
  70. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  71. cp -a COPYING ChangeLog README TODO VERSION $PKG/usr/doc/$PRGNAM-$VERSION
  72. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  73. mkdir -p $PKG/install
  74. cat $CWD/slack-desc > $PKG/install/slack-desc
  75. cd $PKG
  76. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE