nekobee.SlackBuild 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #!/bin/bash
  2. # Slackware build script for nekobee
  3. # Copyright 2015 Klaatu Wellington NZ
  4. #
  5. # GNU All-Permissive License
  6. # Copying and distribution of this file, with or without modification,
  7. # are permitted in any medium without royalty provided the copyright
  8. # notice and this notice are preserved. This file is offered as-is,
  9. # without any warranty.
  10. cd $(dirname $0) ; CWD=$(pwd)
  11. PRGNAM=nekobee
  12. VERSION=${VERSION:-56187f6}
  13. SRCVERSION=${SRCVERSION:-56187f6b0b4a22d1e51fa19221df2d506d2b9b01}
  14. BUILD=${BUILD:-1}
  15. TAG=${TAG:-_SBo}
  16. PKGTYPE=${PKGTYPE:-tgz}
  17. if [ -z "$ARCH" ]; then
  18. case "$( uname -m )" in
  19. i?86) ARCH=i486 ;;
  20. arm*) ARCH=arm ;;
  21. *) ARCH=$( uname -m ) ;;
  22. esac
  23. fi
  24. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  25. # the name of the created package would be, and then exit. This information
  26. # could be useful to other scripts.
  27. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  28. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  29. exit 0
  30. fi
  31. TMP=${TMP:-/tmp/SBo}
  32. PKG=$TMP/package-$PRGNAM
  33. OUTPUT=${OUTPUT:-/tmp}
  34. if [ "$ARCH" = "i486" ]; then
  35. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  36. LIBDIRSUFFIX=""
  37. elif [ "$ARCH" = "i686" ]; then
  38. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  39. LIBDIRSUFFIX=""
  40. elif [ "$ARCH" = "x86_64" ]; then
  41. SLKCFLAGS="-O2 -fPIC"
  42. LIBDIRSUFFIX="64"
  43. else
  44. SLKCFLAGS="-O2"
  45. LIBDIRSUFFIX=""
  46. fi
  47. set -e
  48. rm -rf $PKG
  49. mkdir -p $TMP $PKG $OUTPUT
  50. cd $TMP
  51. rm -rf $PRGNAM-$SRCVERSION
  52. tar xvf $CWD/$PRGNAM-$SRCVERSION.tar.gz
  53. cd $PRGNAM-$SRCVERSION
  54. # https://github.com/gordonjcp/nekobee/pull/9/files
  55. patch -p1 < $CWD/multiple_user_friendly_id.patch
  56. chown -R root:root .
  57. find -L . \
  58. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  59. -o -perm 511 \) -exec chmod 755 {} \; -o \
  60. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  61. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  62. if [ X$LIBDIRSUFFIX == "X64" ]; then
  63. #patch wscript
  64. sed -i "s/'lib'/'lib64'/" wscript
  65. fi
  66. ./waf --prefix=/usr configure
  67. ./waf --prefix=/usr build
  68. ./waf --destdir=$PKG install
  69. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  70. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  71. mkdir -p $PKG/install
  72. cat $CWD/slack-desc > $PKG/install/slack-desc
  73. cd $PKG
  74. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE