tilem.SlackBuild 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. #!/bin/bash
  2. # Slackbuild for tilem
  3. # Slackbuild is released under the Dog-on-Fire License:
  4. # If use of this script causes your dog to catch on fire,
  5. # you agree to send me five dollars. Or a picture
  6. # of the dog on fire.
  7. # Otherwise, you're on your own. I've tested the script
  8. # on my own computer, and it hasn't broken anything.
  9. # So if it does it on your computer, that falls in
  10. # the realm of "Not my problem."
  11. #
  12. # Of course, if you'll send a bug report to the above
  13. # email address, I may be able to see what you did
  14. # wrong and prevent it from happening in the future.
  15. # In which case, I may just send YOU five dollars.
  16. # Oh, and feel free to copy it and modify it as you
  17. # see fit. Or as I see fit. Or as I fit. Although
  18. # that is unlikely, as I am rather tall.
  19. cd $(dirname $0) ; CWD=$(pwd)
  20. PRGNAM=tilem
  21. VERSION=${VERSION:-0.973}
  22. BUILD=${BUILD:-2}
  23. TAG=${TAG:-_SBo}
  24. PKGTYPE=${PKGTYPE:-tgz}
  25. if [ -z "$ARCH" ]; then
  26. case "$( uname -m )" in
  27. i?86) ARCH=i586 ;;
  28. arm*) ARCH=arm ;;
  29. *) ARCH=$( uname -m ) ;;
  30. esac
  31. fi
  32. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  33. # the name of the created package would be, and then exit. This information
  34. # could be useful to other scripts.
  35. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  36. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  37. exit 0
  38. fi
  39. TMP=${TMP:-/tmp/SBo}
  40. PKG=$TMP/package-$PRGNAM
  41. OUTPUT=${OUTPUT:-/tmp}
  42. if [ "$ARCH" = "i586" ]; then
  43. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  44. LIBDIRSUFFIX=""
  45. elif [ "$ARCH" = "i686" ]; then
  46. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  47. LIBDIRSUFFIX=""
  48. elif [ "$ARCH" = "x86_64" ]; then
  49. SLKCFLAGS="-O2 -fPIC"
  50. LIBDIRSUFFIX="64"
  51. else
  52. SLKCFLAGS="-O2"
  53. LIBDIRSUFFIX=""
  54. fi
  55. set -e
  56. rm -rf $PKG
  57. mkdir -p $TMP $PKG $OUTPUT
  58. cd $TMP
  59. rm -rf $PRGNAM-$VERSION
  60. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  61. cd $PRGNAM-$VERSION
  62. chown -R root:root .
  63. find -L . \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  64. -exec chmod 755 {} \; -o \
  65. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  66. -exec chmod 644 {} \;
  67. CFLAGS="$SLKCFLAGS -w -Wl,--allow-multiple-definition" \
  68. CXXFLAGS="$SLKCFLAGS" \
  69. ./configure \
  70. --prefix=/usr \
  71. --sysconfdir=/etc \
  72. --libdir=/usr/lib${LIBDIRSUFFIX} \
  73. --build=$ARCH-slackware-linux \
  74. make
  75. mkdir -p $PKG/usr/bin $PKG/usr/share/$PRGNAM
  76. cp -a bin/tilem $PKG/usr/bin/tilem
  77. cp -a data pixmaps $PKG/usr/share/$PRGNAM
  78. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  79. cp -a AUTHORS COPYING NEWS README THANKS TODO doc \
  80. $PKG/usr/doc/$PRGNAM-$VERSION
  81. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  82. find $PKG/usr/doc -name "Makefile" -exec rm {} \;
  83. find $PKG/usr/doc -type f -exec chmod 644 {} \;
  84. mkdir -p $PKG/install
  85. cat $CWD/slack-desc > $PKG/install/slack-desc
  86. cd $PKG
  87. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE