mtpfs.SlackBuild 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #!/bin/bash
  2. # Slackware build script for mtpfs
  3. # Written by B. Watson (yalhcru@gmail.com)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. cd $(dirname $0) ; CWD=$(pwd)
  6. PRGNAM=mtpfs
  7. VERSION=${VERSION:-1.1}
  8. BUILD=${BUILD:-1}
  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 [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  19. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  20. exit 0
  21. fi
  22. TMP=${TMP:-/tmp/SBo}
  23. PKG=$TMP/package-$PRGNAM
  24. OUTPUT=${OUTPUT:-/tmp}
  25. if [ "$ARCH" = "i586" ]; then
  26. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  27. elif [ "$ARCH" = "i686" ]; then
  28. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  29. elif [ "$ARCH" = "x86_64" ]; then
  30. SLKCFLAGS="-O2 -fPIC"
  31. else
  32. SLKCFLAGS="-O2"
  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 . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  43. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  44. CFLAGS="$SLKCFLAGS" \
  45. CXXFLAGS="$SLKCFLAGS" \
  46. ./configure \
  47. --prefix=/usr \
  48. --sysconfdir=/etc \
  49. --localstatedir=/var \
  50. --mandir=/usr/man \
  51. --build=$ARCH-slackware-linux
  52. make
  53. make install-strip DESTDIR=$PKG
  54. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  55. cp -a AUTHORS COPYING ChangeLog NEWS README $PKG/usr/doc/$PRGNAM-$VERSION
  56. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  57. mkdir -p $PKG/install
  58. cat $CWD/slack-desc > $PKG/install/slack-desc
  59. cd $PKG
  60. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE