maitreya.SlackBuild 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #!/bin/bash
  2. #
  3. # Didier Charles 2011.05.22
  4. # dcharles@alumni.concordia.ca
  5. # written with the grateful assistance of the tutorial
  6. # "Writing A SlackBuild Script" at :
  7. # http://www.slackwiki.org/Writing_A_SlackBuild_Script
  8. # and with the guidance of the templates at:
  9. # http://slackbuilds.org/templates/
  10. cd $(dirname $0) ; CWD=$(pwd)
  11. PRGNAM=maitreya
  12. VERSION=${VERSION:-7.0.5}
  13. BUILD=${BUILD:-1}
  14. TAG=${TAG:-_SBo}
  15. PKGTYPE=${PKGTYPE:-tgz}
  16. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  17. # the name of the created package would be, and then exit. This information
  18. # could be useful to other scripts.
  19. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  20. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  21. exit 0
  22. fi
  23. TMP=${TMP:-/tmp/SBo}
  24. PKG=$TMP/package-$PRGNAM
  25. OUTPUT=${OUTPUT:-/tmp}
  26. if [ -z "$ARCH" ]; then
  27. case "$( uname -m )" in
  28. i?86) ARCH=i486 ;;
  29. arm*) ARCH=arm ;;
  30. *) ARCH=$( uname -m ) ;;
  31. esac
  32. fi
  33. if [ "$ARCH" = "i486" ]; then
  34. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  35. LIBDIRSUFFIX=""
  36. elif [ "$ARCH" = "i686" ]; then
  37. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  38. LIBDIRSUFFIX=""
  39. elif [ "$ARCH" = "x86_64" ]; then
  40. SLKCFLAGS="-O2 -fPIC"
  41. LIBDIRSUFFIX="64"
  42. fi
  43. set -e
  44. rm -rf $PKG
  45. mkdir -p $TMP $PKG $OUTPUT
  46. cd $TMP
  47. rm -rf $PRGNAM-$VERSION
  48. tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
  49. cd $PRGNAM-$VERSION
  50. chown -R root:root .
  51. find -L . \
  52. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  53. -o -perm 511 \) -exec chmod 755 {} \; -o \
  54. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  55. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  56. ./configure \
  57. --prefix=/usr \
  58. --sysconfdir=/etc \
  59. --localstatedir=/var \
  60. --libdir=/usr/lib${LIBDIRSUFFIX} \
  61. --build=$ARCH-slackware-linux
  62. make \
  63. fontdir=/usr/share/fonts/TTF \
  64. CFLAGS="$SLKCFLAGS" \
  65. CXXFLAGS="$SLKCFLAGS"
  66. make install \
  67. fontdir=/usr/share/fonts/TTF \
  68. DESTDIR=$PKG
  69. ( cd $PKG/usr/share/maitreya7/fonts/
  70. rm -f MaitreyaSymbols6.ttf
  71. ln -s ../../fonts/TTF/MaitreyaSymbols6.ttf
  72. )
  73. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  74. cp -a INSTALL README $PKG/usr/doc/$PRGNAM-$VERSION
  75. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  76. ( cd $PKG/usr/doc/$PRGNAM-$VERSION
  77. ln -s ../../share/maitreya6/COPYING
  78. ln -s ../../share/maitreya6/changelog
  79. )
  80. mkdir -p $PKG/install
  81. cat $CWD/slack-desc > $PKG/install/slack-desc
  82. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  83. cd $PKG
  84. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE