gaupol.SlackBuild 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #!/bin/bash
  2. # Slackware build script for gaupol
  3. # Written by Andre Barboza <bmg.andre@gmail.com>
  4. # Redistribution and use of this script, with or without modification, is
  5. # permitted provided that the following conditions are met:
  6. #
  7. # 1. Redistributions of this script must retain the above copyright
  8. # notice, this list of conditions and the following disclaimer.
  9. #
  10. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
  11. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  12. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  13. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  14. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  15. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  16. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  17. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  18. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  19. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  20. cd $(dirname $0) ; CWD=$(pwd)
  21. PRGNAM=gaupol
  22. VERSION=${VERSION:-0.19.2}
  23. BUILD=${BUILD:-1}
  24. TAG=${TAG:-_SBo}
  25. PKGTYPE=${PKGTYPE:-tgz}
  26. if [ -z "$ARCH" ]; then
  27. case "$( uname -m )" in
  28. i?86) ARCH=i586 ;;
  29. arm*) ARCH=arm ;;
  30. *) ARCH=$( uname -m ) ;;
  31. esac
  32. fi
  33. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  34. # the name of the created package would be, and then exit. This information
  35. # could be useful to other scripts.
  36. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  37. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  38. exit 0
  39. fi
  40. TMP=${TMP:-/tmp/SBo}
  41. PKG=$TMP/package-$PRGNAM
  42. OUTPUT=${OUTPUT:-/tmp}
  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.gz
  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 -o -perm 511 \) \
  53. -exec chmod 755 {} \; -o \
  54. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  55. -exec chmod 644 {} \;
  56. mkdir -p $PKG/usr
  57. python setup.py clean install --prefix=/usr --root=$PKG
  58. mv $PKG/usr/share/man $PKG/usr
  59. find $PKG/usr/man -type f -exec gzip -9 {} \;
  60. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  61. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  62. cp -a AUTHORS COPYING CREDITS INSTALL NEWS README TODO $PKG/usr/doc/$PRGNAM-$VERSION
  63. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  64. mkdir -p $PKG/install
  65. cat $CWD/slack-desc > $PKG/install/slack-desc
  66. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  67. cd $PKG
  68. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE