geda-gaf.SlackBuild 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #!/bin/bash
  2. # Slackware build script for gEDA / gaf
  3. # Written by Stephen Van Berg stephen_van_berg@earlicker.com
  4. # Updated by Kyle Guinn <elyk03@gmail.com>
  5. cd $(dirname $0) ; CWD=$(pwd)
  6. PRGNAM=geda-gaf
  7. VERSION=${VERSION:-1.10.2}
  8. BUILD=${BUILD:-2}
  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. DOCS="ABOUT-NLS AUTHORS COPYING* ChangeLog HACKING INSTALL NEWS README"
  29. if [ "$ARCH" = "i586" ]; then
  30. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  31. LIBDIRSUFFIX=""
  32. elif [ "$ARCH" = "i686" ]; then
  33. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  34. LIBDIRSUFFIX=""
  35. elif [ "$ARCH" = "x86_64" ]; then
  36. SLKCFLAGS="-O2 -fPIC"
  37. LIBDIRSUFFIX="64"
  38. else
  39. SLKCFLAGS="-O2"
  40. LIBDIRSUFFIX=""
  41. fi
  42. set -e
  43. rm -rf $PKG
  44. mkdir -p $TMP $PKG $OUTPUT
  45. cd $TMP
  46. rm -rf $PRGNAM-$VERSION
  47. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  48. cd $PRGNAM-$VERSION
  49. chown -R root:root .
  50. find -L . \
  51. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  52. -o -perm 511 \) -exec chmod 755 {} \; -o \
  53. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  54. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  55. LDFLAGS="$LDFLAGS -lm" \
  56. CFLAGS="$SLKCFLAGS" \
  57. CXXFLAGS="$SLKCFLAGS" \
  58. ./configure \
  59. --prefix=/usr \
  60. --libdir=/usr/lib${LIBDIRSUFFIX} \
  61. --sysconfdir=/etc \
  62. --localstatedir=/var \
  63. --mandir=/usr/man \
  64. --infodir=/usr/info \
  65. --docdir=/usr/doc/$PRGNAM-$VERSION \
  66. --build=$ARCH-slackware-linux \
  67. --disable-update-xdg-database
  68. make
  69. make install-strip DESTDIR=$PKG
  70. find $PKG/usr/man -type f -exec gzip -9 {} \;
  71. rm -f $PKG/usr/info/dir
  72. gzip -9 $PKG/usr/info/*.info*
  73. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  74. cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
  75. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  76. rm -f $PKG/usr/lib*/*.la
  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