nant.SlackBuild 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #!/bin/bash
  2. # Slackware build script for nant
  3. # Written by (Asaf) (asaf@lingnu.com)
  4. cd $(dirname $0) ; CWD=$(pwd)
  5. PRGNAM=nant
  6. VERSION=${VERSION:-0.92}
  7. BUILD=${BUILD:-1}
  8. TAG=${TAG:-_SBo}
  9. PKGTYPE=${PKGTYPE:-tgz}
  10. if [ -z "$ARCH" ]; then
  11. case "$( uname -m )" in
  12. i?86) ARCH=i586 ;;
  13. arm*) ARCH=arm ;;
  14. *) ARCH=$( uname -m ) ;;
  15. esac
  16. fi
  17. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  18. # the name of the created package would be, and then exit. This information
  19. # could be useful to other scripts.
  20. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  21. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  22. exit 0
  23. fi
  24. TMP=${TMP:-/tmp/SBo}
  25. PKG=$TMP/package-$PRGNAM
  26. OUTPUT=${OUTPUT:-/tmp}
  27. set -e
  28. rm -rf $PKG
  29. mkdir -p $TMP $PKG $OUTPUT
  30. cd $TMP
  31. rm -rf $PRGNAM-$VERSION
  32. tar xvf $CWD/$PRGNAM-$VERSION-bin.tar.gz
  33. cd $PRGNAM-$VERSION
  34. chown -R root:root .
  35. find -L . \
  36. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  37. -exec chmod 755 {} \; -o \
  38. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  39. -exec chmod 644 {} \;
  40. mkdir -p $PKG/usr/bin
  41. mkdir -p $PKG/usr/share/NAnt
  42. cp -R * $PKG/usr/share/NAnt
  43. echo '/usr/bin/mono /usr/share/NAnt/bin/NAnt.exe "$@"' > $PKG/usr/bin/nant
  44. chmod +x $PKG/usr/bin/nant
  45. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  46. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  47. mv $PKG/usr/share/NAnt/*.txt $PKG/usr/doc/$PRGNAM-$VERSION/
  48. mv $PKG/usr/share/NAnt/doc/* $PKG/usr/doc/$PRGNAM-$VERSION/
  49. mv $PKG/usr/share/NAnt/examples $PKG/usr/doc/$PRGNAM-$VERSION/
  50. mkdir -p $PKG/install
  51. cat $CWD/slack-desc > $PKG/install/slack-desc
  52. cd $PKG
  53. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE