perl-Text-CSV_XS.SlackBuild 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. #!/bin/sh
  2. # Slackware build script for Text::CSV_XS
  3. # Written by Falu <falu0_0@fastmail.fm>
  4. PRGNAM=perl-Text-CSV_XS
  5. VERSION=${VERSION:-0.82}
  6. BUILD=${BUILD:-1}
  7. TAG=${TAG:-_SBo}
  8. SRCNAM="$(printf $PRGNAM | cut -d- -f2-)"
  9. if [ -z "$ARCH" ]; then
  10. case "$( uname -m )" in
  11. i?86) ARCH=i486 ;;
  12. arm*) ARCH=arm ;;
  13. *) ARCH=$( uname -m ) ;;
  14. esac
  15. fi
  16. CWD=$(pwd)
  17. TMP=${TMP:-/tmp/SBo}
  18. PKG=$TMP/package-$PRGNAM
  19. OUTPUT=${OUTPUT:-/tmp}
  20. if [ "$ARCH" = "i486" ]; then
  21. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  22. LIBDIRSUFFIX=""
  23. elif [ "$ARCH" = "i686" ]; then
  24. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  25. LIBDIRSUFFIX=""
  26. elif [ "$ARCH" = "x86_64" ]; then
  27. SLKCFLAGS="-O2 -fPIC"
  28. LIBDIRSUFFIX="64"
  29. else
  30. SLKCFLAGS="-O2"
  31. LIBDIRSUFFIX=""
  32. fi
  33. set -e
  34. rm -rf $PKG
  35. mkdir -p $TMP $PKG $OUTPUT
  36. cd $TMP
  37. rm -rf $SRCNAM-$VERSION
  38. tar xvf $CWD/$SRCNAM-$VERSION.tgz
  39. cd $SRCNAM-$VERSION
  40. chown -R root:root .
  41. find . \
  42. \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  43. -exec chmod 755 {} \; -o \
  44. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  45. -exec chmod 644 {} \;
  46. perl Makefile.PL \
  47. OPTIMIZE="$SLKCFLAGS" \
  48. PREFIX=/usr \
  49. INSTALLDIRS=vendor \
  50. INSTALLVENDORMAN3DIR=/usr/man/man3
  51. make
  52. make test
  53. make install DESTDIR=$PKG
  54. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  55. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  56. find $PKG/usr/man -type f -exec gzip -9 {} \;
  57. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  58. find $PKG -name perllocal.pod -o -name ".packlist" -o -name "*.bs" | xargs rm -f || true
  59. find $PKG -depth -type d -empty -delete || true
  60. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  61. cp -a \
  62. README ChangeLog \
  63. $PKG/usr/doc/$PRGNAM-$VERSION
  64. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  65. mkdir -p $PKG/install
  66. cat $CWD/slack-desc > $PKG/install/slack-desc
  67. cd $PKG
  68. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}