xzoom.SlackBuild 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. #!/bin/bash
  2. # Slackware build script for xzoom
  3. # Written by B. Watson (urchlay@slackware.uk)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. # The _26 is the Debian patchlevel. They've done a lot to this, such as
  6. # support for >8bpp displays... since it's the future now, everyone's
  7. # using 24/32bpp, so the Debian maintainers rescued xzoom from the
  8. # scrap heap. Thanks!
  9. cd $(dirname $0) ; CWD=$(pwd)
  10. PRGNAM=xzoom
  11. VERSION=${VERSION:-0.3_26}
  12. BUILD=${BUILD:-1}
  13. TAG=${TAG:-_SBo}
  14. PKGTYPE=${PKGTYPE:-tgz}
  15. ORIGVER="$( echo $VERSION | cut -d_ -f1 )"
  16. DEBVER="$( echo $VERSION | cut -d_ -f2 )"
  17. if [ -z "$ARCH" ]; then
  18. case "$( uname -m )" in
  19. i?86) ARCH=i586 ;;
  20. arm*) ARCH=arm ;;
  21. *) ARCH=$( uname -m ) ;;
  22. esac
  23. fi
  24. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  25. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  26. exit 0
  27. fi
  28. TMP=${TMP:-/tmp/SBo}
  29. PKG=$TMP/package-$PRGNAM
  30. OUTPUT=${OUTPUT:-/tmp}
  31. if [ "$ARCH" = "i586" ]; then
  32. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  33. LIBDIRSUFFIX=""
  34. elif [ "$ARCH" = "i686" ]; then
  35. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  36. LIBDIRSUFFIX=""
  37. elif [ "$ARCH" = "x86_64" ]; then
  38. SLKCFLAGS="-O2 -fPIC"
  39. LIBDIRSUFFIX="64"
  40. else
  41. SLKCFLAGS="-O2"
  42. LIBDIRSUFFIX=""
  43. fi
  44. set -e
  45. rm -rf $PKG
  46. mkdir -p $TMP $PKG $OUTPUT
  47. cd $TMP
  48. rm -rf $PRGNAM-$ORIGVER.orig
  49. tar xvf $CWD/${PRGNAM}_$ORIGVER.orig.tar.gz
  50. cd $PRGNAM-$ORIGVER.orig
  51. tar xvf $CWD/${PRGNAM}_$ORIGVER-$DEBVER.debian.tar.xz
  52. chown -R root:root .
  53. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  54. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  55. # Apply Debian's patches, since they're our real upstream.
  56. for i in $( cat debian/patches/series ); do
  57. patch -p1 < debian/patches/$i
  58. done
  59. # Fix a few typo/grammar issues.
  60. patch -p1 < $CWD/fixmanpage.diff
  61. # Avoid warnings about alarm() and usleep() missing prototypes.
  62. sed -i '1i#include <unistd.h>' $PRGNAM.c
  63. # Allow turning off the frame at compile time.
  64. [ "${FRAME:-yes}" = "no" ] && sed -i '/^DEFINES/s,-DFRAME ,,' Imakefile
  65. xmkmf
  66. make CDEBUGFLAGS="$SLKCFLAGS"
  67. mkdir -p $PKG/usr/bin $PKG/usr/man/man1 $PKG/usr/share/applications
  68. install -s -m0755 $PRGNAM $PKG/usr/bin
  69. gzip -9c < debian/manpage/$PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz
  70. # Not too sure about the icon. It's system-search, which doesn't even
  71. # exist in the default (hicolor) icon theme on Slackware. Not a huge
  72. # deal I suppose.
  73. cat debian/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
  74. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  75. cp -a debian/changelog README $PRGNAM.lsm $PKG/usr/doc/$PRGNAM-$VERSION
  76. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  77. mkdir -p $PKG/install
  78. cat $CWD/slack-desc > $PKG/install/slack-desc
  79. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  80. cd $PKG
  81. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE