tangogps.SlackBuild 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #!/bin/bash
  2. # Slackware build script for tangogps
  3. # Written by <pedro@gepasi.org>
  4. # This script is hereby put in the public domain
  5. cd $(dirname $0) ; CWD=$(pwd)
  6. PRGNAM=tangogps
  7. VERSION=${VERSION:-0.99.4}
  8. BUILD=${BUILD:-3}
  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 the variable PRINT_PACKAGE_NAME is set, then this script will report what
  19. # the name of the created package would be, and then exit. This information
  20. # could be useful to other scripts.
  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 . \
  50. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  51. -o -perm 511 \) -exec chmod 755 {} \; -o \
  52. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  53. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  54. # Fix for glib>=2.31
  55. sed -i "s|^#include\ <glib/.*||" src/map_management.c
  56. # This other is for curl>=7.24
  57. sed -i "s|^#include\ <curl/types\.h>||" \
  58. src/tile_management.c src/util.h src/friends.c
  59. LDFLAGS="-Wl,--allow-multiple-definition,-lm" \
  60. CFLAGS="$SLKCFLAGS" \
  61. CXXFLAGS="$SLKCFLAGS" \
  62. ./configure \
  63. --prefix=/usr \
  64. --libdir=/usr/lib${LIBDIRSUFFIX} \
  65. --sysconfdir=/etc \
  66. --localstatedir=/var \
  67. --mandir=/usr/man \
  68. --build=$ARCH-slackware-linux
  69. make tangogpsdocdir=/usr/doc/$PRGNAM-$VERSION
  70. make tangogpsdocdir=/usr/doc/$PRGNAM-$VERSION install-strip DESTDIR=$PKG
  71. mkdir -p $PKG/install
  72. cat $CWD/slack-desc > $PKG/install/slack-desc
  73. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  74. cd $PKG
  75. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE