mdic.SlackBuild 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #!/bin/bash
  2. # Slackware build script for Mdic dictionary
  3. #written by Mehdi Esmaeelpour ariarat@gmail.com www.slack-world.com
  4. cd $(dirname $0) ; CWD=$(pwd)
  5. PRGNAM=mdic
  6. VERSION=${VERSION:-0.8.1}
  7. BUILD=${BUILD:-2}
  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 [ "$TMP" = "" ]; then
  18. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  19. # the name of the created package would be, and then exit. This information
  20. # could be useful to other scripts.
  21. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  22. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  23. exit 0
  24. fi
  25. TMP=${TMP:-/tmp/SBo}
  26. fi
  27. OUTPUT=${OUTPUT:-/tmp}
  28. PKG=$TMP/package-$PRGNAM
  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. rm -rf $TMP/$PRGNAM
  46. cd $TMP
  47. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  48. cd $PRGNAM
  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. mkdir build
  56. cd build
  57. cmake \
  58. -DCMAKE_INSTALL_PREFIX=/usr ..
  59. make VERBOSE=1
  60. make install VERBOSE=1 DESTDIR=$PKG
  61. cd ..
  62. find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  63. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  64. mv $PKG/usr/share/man $PKG/usr
  65. rm -rf $PKG/usr/share/doc
  66. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  67. cp -a COPYING changelog README AUTHORS TODO $PKG/usr/doc/$PRGNAM-$VERSION
  68. cat $CWD/mdic.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/mdic.SlackBuild
  69. mkdir -p $PKG/install
  70. cat $CWD/slack-desc > $PKG/install/slack-desc
  71. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  72. cd $PKG
  73. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE