perl-Text-Tabulate.SlackBuild 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #!/bin/bash
  2. # Slackware build script for <perl-Sort-Versions>
  3. # Written by Jacob Pipkin <j@dawnrazor.net>
  4. # Licensed under the WTFPL <http://sam.zoy.org/wtfpl/COPYING>
  5. cd $(dirname $0) ; CWD=$(pwd)
  6. PRGNAM=perl-Text-Tabulate
  7. VERSION=${VERSION:-1.1.1}
  8. BUILD=${BUILD:-1}
  9. TAG=${TAG:-_SBo}
  10. PKGTYPE=${PKGTYPE:-tgz}
  11. SRCNAM="$(printf $PRGNAM | cut -d- -f2-)"
  12. if [ -z "$ARCH" ]; then
  13. case "$( uname -m )" in
  14. i?86) ARCH=i486 ;;
  15. arm*) ARCH=arm ;;
  16. *) ARCH=$( uname -m ) ;;
  17. esac
  18. fi
  19. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  20. # the name of the created package would be, and then exit. This information
  21. # could be useful to other scripts.
  22. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  23. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  24. exit 0
  25. fi
  26. TMP=${TMP:-/tmp/SBo}
  27. PKG=$TMP/package-$PRGNAM
  28. OUTPUT=${OUTPUT:-/tmp}
  29. if [ "$ARCH" = "i486" ]; then
  30. SLKCFLAGS="-O2 -march=i486 -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. cd $TMP
  46. rm -rf $SRCNAM-$VERSION
  47. tar xvf $CWD/$SRCNAM-$VERSION.tar.gz
  48. cd $SRCNAM-$VERSION
  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. perl Makefile.PL \
  56. PREFIX=/usr \
  57. INSTALLDIRS=vendor \
  58. INSTALLVENDORMAN1DIR=/usr/man/man1 \
  59. INSTALLVENDORMAN3DIR=/usr/man/man3
  60. make
  61. make test
  62. make install DESTDIR=$PKG
  63. find $PKG/usr/man -type f -exec gzip -9 {} \;
  64. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  65. find $PKG -name perllocal.pod -o -name ".packlist" -o -name "*.bs" | xargs rm -f || true
  66. find $PKG -depth -type d -empty -delete || true
  67. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  68. cp -a \
  69. Changes INSTALL README \
  70. $PKG/usr/doc/$PRGNAM-$VERSION
  71. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  72. mkdir -p $PKG/install
  73. cat $CWD/slack-desc > $PKG/install/slack-desc
  74. cd $PKG
  75. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE