ding.SlackBuild 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #!/bin/bash
  2. ## Written by Martin Ivanov (tramni@abv.bg)
  3. ## Package Homepage: http://www-user.tu-chemnitz.de/~fri/ding/
  4. ## Feel free to use, modify, redistribute this script.
  5. ## If you make changes please add a "Modified by" line so that I don't
  6. ## receive kudos or flames for things I didn't write... Thanks.
  7. # Heavily Modified by Michiel van Wessem <michiel@slackbuilds.org> 20081020
  8. cd $(dirname $0) ; CWD=$(pwd)
  9. PRGNAM=ding
  10. VERSION=${VERSION:-1.7}
  11. ARCH=noarch
  12. BUILD=${BUILD:-1}
  13. TAG=${TAG:-_SBo}
  14. PKGTYPE=${PKGTYPE:-tgz}
  15. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  16. # the name of the created package would be, and then exit. This information
  17. # could be useful to other scripts.
  18. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  19. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  20. exit 0
  21. fi
  22. TMP=${TMP:-/tmp/SBo}
  23. PKG=$TMP/package-$PRGNAM
  24. OUTPUT=${OUTPUT:-/tmp}
  25. set -e
  26. rm -rf $PKG
  27. mkdir -p $PKG $OUTPUT $TMP
  28. cd $TMP || exit 1
  29. rm -rf $PRGNAM-$VERSION
  30. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz || exit 1
  31. cd $PRGNAM-$VERSION || exit 1
  32. chown -R root:root .
  33. find -L . \
  34. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  35. -exec chmod 755 {} \; -o \
  36. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  37. -exec chmod 644 {} \;
  38. mkdir -p $PKG/usr/{bin,man/man1}
  39. cp ding $PKG/usr/bin || exit 1
  40. cp ding.1 $PKG/usr/man/man1 || exit 1
  41. mkdir -p $PKG/usr/share/{dict,applications,pixmaps}
  42. cp de-en.txt $PKG/usr/share/dict|| exit 1
  43. cp ding.desktop $PKG/usr/share/applications || exit 1
  44. cp ding.png $PKG/usr/share/pixmaps
  45. find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  46. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  47. find $PKG/usr/man -type f -exec gzip -9 {} \;
  48. for i in $( find $PKG/usr/man -type l ) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done
  49. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  50. cp -R $CWD/{$PRGNAM.SlackBuild,slack-desc,doinst.sh} CHANGES COPYING README $PKG/usr/doc/$PRGNAM-$VERSION
  51. find $PKG/usr/doc/$PRGNAM-$VERSION -type f -exec chown root:root {} \; -exec chmod 644 {} \;
  52. mkdir -p $PKG/install
  53. cat $CWD/slack-desc > $PKG/install/slack-desc
  54. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  55. cd $PKG
  56. /sbin/makepkg -l y -c n -p $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE