cam.SlackBuild 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #!/bin/bash
  2. # Slackware build script for cam
  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=cam
  7. VERSION=${VERSION:-20141220_8b81199}
  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. CWD=$(pwd)
  23. TMP=${TMP:-/tmp/SBo}
  24. PKG=$TMP/package-$PRGNAM
  25. OUTPUT=${OUTPUT:-/tmp}
  26. if [ "$ARCH" = "i586" ]; then
  27. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  28. LIBDIRSUFFIX=""
  29. elif [ "$ARCH" = "i686" ]; then
  30. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  31. LIBDIRSUFFIX=""
  32. elif [ "$ARCH" = "x86_64" ]; then
  33. SLKCFLAGS="-O2 -fPIC"
  34. LIBDIRSUFFIX="64"
  35. else
  36. SLKCFLAGS="-O2"
  37. LIBDIRSUFFIX=""
  38. fi
  39. set -e
  40. rm -rf $PKG
  41. mkdir -p $TMP $PKG $OUTPUT
  42. cd $TMP
  43. rm -rf $PRGNAM-$VERSION
  44. tar xvf $CWD/$PRGNAM-$VERSION.tar.xz
  45. cd $PRGNAM-$VERSION
  46. chown -R root:root .
  47. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  48. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  49. autoreconf -if
  50. CFLAGS="$SLKCFLAGS" \
  51. CXXFLAGS="$SLKCFLAGS" \
  52. ./configure \
  53. --prefix=/usr \
  54. --libdir=/usr/lib${LIBDIRSUFFIX} \
  55. --sysconfdir=/etc \
  56. --localstatedir=/var \
  57. --mandir=/usr/man \
  58. --docdir=/usr/doc/$PRGNAM-$VERSION \
  59. --build=$ARCH-slackware-linux
  60. make
  61. make install-strip DESTDIR=$PKG
  62. gzip -9 $PKG/usr/man/man*/*
  63. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  64. cp -a LICENSE* README* $PKG/usr/doc/$PRGNAM-$VERSION
  65. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  66. mkdir -p $PKG/install
  67. cat $CWD/slack-desc > $PKG/install/slack-desc
  68. cd $PKG
  69. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE