artha.SlackBuild 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #!/bin/bash
  2. #
  3. # Slackware build script for artha
  4. #
  5. # Written by Mikhail Zotov <mikhail dot ru at gmail dot com>
  6. cd $(dirname $0) ; CWD=$(pwd)
  7. PRGNAM=artha
  8. VERSION=${VERSION:-1.0.5}
  9. BUILD=${BUILD:-1}
  10. TAG=${TAG:-_SBo}
  11. PKGTYPE=${PKGTYPE:-tgz}
  12. if [ -z "$ARCH" ]; then
  13. case "$( uname -m )" in
  14. i?86) ARCH=i586 ;;
  15. arm*) ARCH=arm ;;
  16. *) ARCH=$( uname -m ) ;;
  17. esac
  18. fi
  19. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  20. # the name of the created package would be, and then exit. This information
  21. # could be useful to other scripts.
  22. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  23. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  24. exit 0
  25. fi
  26. TMP=${TMP:-/tmp/SBo}
  27. PKG=$TMP/package-$PRGNAM
  28. OUTPUT=${OUTPUT:-/tmp}
  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.bz2
  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 -o -perm 511 \) \
  52. -exec chmod 755 {} \; -o \
  53. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  54. -exec chmod 644 {} \;
  55. LDFLAGS="-lgio-2.0" \
  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. --docdir=/usr/doc/$PRGNAM-$VERSION \
  65. --build=$ARCH-slackware-linux
  66. make
  67. make install DESTDIR=$PKG
  68. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  69. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  70. find $PKG/usr/man -type f -exec gzip -9 {} \;
  71. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  72. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  73. cp -a \
  74. AUTHORS COPYING ChangeLog INSTALL NEWS README \
  75. $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