geda-gaf.SlackBuild 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #!/bin/sh
  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. PRGNAM=geda-gaf
  6. VERSION=${VERSION:-1.8.2}
  7. BUILD=${BUILD:-1}
  8. TAG=${TAG:-_SBo}
  9. if [ -z "$ARCH" ]; then
  10. case "$( uname -m )" in
  11. i?86) ARCH=i486 ;;
  12. arm*) ARCH=arm ;;
  13. *) ARCH=$( uname -m ) ;;
  14. esac
  15. fi
  16. CWD=$(pwd)
  17. TMP=${TMP:-/tmp/SBo}
  18. PKG=$TMP/package-$PRGNAM
  19. OUTPUT=${OUTPUT:-/tmp}
  20. DOCS="ABOUT-NLS AUTHORS COPYING* ChangeLog HACKING INSTALL NEWS README"
  21. if [ "$ARCH" = "i486" ]; then
  22. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  23. LIBDIRSUFFIX=""
  24. elif [ "$ARCH" = "i686" ]; then
  25. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  26. LIBDIRSUFFIX=""
  27. elif [ "$ARCH" = "x86_64" ]; then
  28. SLKCFLAGS="-O2 -fPIC"
  29. LIBDIRSUFFIX="64"
  30. else
  31. SLKCFLAGS="-O2"
  32. LIBDIRSUFFIX=""
  33. fi
  34. set -e
  35. rm -rf $PKG
  36. mkdir -p $TMP $PKG $OUTPUT
  37. cd $TMP
  38. rm -rf $PRGNAM-$VERSION
  39. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  40. cd $PRGNAM-$VERSION
  41. chown -R root:root .
  42. find -L . \
  43. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  44. -o -perm 511 \) -exec chmod 755 {} \; -o \
  45. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  46. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  47. LDFLAGS="$LDFLAGS -lm" \
  48. CFLAGS="$SLKCFLAGS" \
  49. CXXFLAGS="$SLKCFLAGS" \
  50. ./configure \
  51. --prefix=/usr \
  52. --libdir=/usr/lib${LIBDIRSUFFIX} \
  53. --sysconfdir=/etc \
  54. --localstatedir=/var \
  55. --mandir=/usr/man \
  56. --infodir=/usr/info \
  57. --docdir=/usr/doc/$PRGNAM-$VERSION \
  58. --build=$ARCH-slackware-linux \
  59. --disable-update-xdg-database
  60. make
  61. make install-strip DESTDIR=$PKG
  62. find $PKG/usr/man -type f -exec gzip -9 {} \;
  63. rm -f $PKG/usr/info/dir
  64. gzip -9 $PKG/usr/info/*.info*
  65. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  66. cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
  67. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  68. mkdir -p $PKG/install
  69. cat $CWD/slack-desc > $PKG/install/slack-desc
  70. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  71. cd $PKG
  72. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}