artha.SlackBuild 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #!/bin/sh
  2. #
  3. # Slackware build script for artha
  4. #
  5. # Written by Mikhail Zotov <mikhail dot ru at gmail dot com>
  6. PRGNAM=artha
  7. VERSION=${VERSION:-1.0.3}
  8. BUILD=${BUILD:-1}
  9. TAG=${TAG:-_SBo}
  10. if [ -z "$ARCH" ]; then
  11. case "$( uname -m )" in
  12. i?86) ARCH=i486 ;;
  13. arm*) ARCH=arm ;;
  14. *) ARCH=$( uname -m ) ;;
  15. esac
  16. fi
  17. CWD=$(pwd)
  18. TMP=${TMP:-/tmp/SBo}
  19. PKG=$TMP/package-$PRGNAM
  20. OUTPUT=${OUTPUT:-/tmp}
  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.bz2
  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 -o -perm 511 \) \
  44. -exec chmod 755 {} \; -o \
  45. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  46. -exec chmod 644 {} \;
  47. LDFLAGS="-lgio-2.0" \
  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. --docdir=/usr/doc/$PRGNAM-$VERSION \
  57. --build=$ARCH-slackware-linux
  58. make
  59. make install DESTDIR=$PKG
  60. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  61. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  62. find $PKG/usr/man -type f -exec gzip -9 {} \;
  63. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  64. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  65. cp -a \
  66. AUTHORS COPYING ChangeLog INSTALL NEWS README \
  67. $PKG/usr/doc/$PRGNAM-$VERSION
  68. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  69. mkdir -p $PKG/install
  70. cat $CWD/slack-desc > $PKG/install/slack-desc
  71. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  72. cd $PKG
  73. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}