recode.SlackBuild 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #!/bin/sh
  2. # Copyright (c) 2007 Niki Kovacs <contact@kikinovak.net>
  3. #
  4. # By: Niki Kovacs <contact@kikinovak.net>
  5. # For: recode
  6. # URL: ftp://ftp.gnu.org/pub/gnu/recode/
  7. # Modified by Robby Workman <rworkman@slackbuilds.org>
  8. # Further small mods by Richard Hoyle <hoyle.richard@gmail.com>
  9. PRGNAM=recode
  10. VERSION=3.6
  11. ARCH=${ARCH:-i486}
  12. BUILD=${BUILD:-2}
  13. TAG=${TAG:-_SBo}
  14. CWD=$(pwd)
  15. TMP=${TMP:-/tmp/SBo}
  16. PKG=$TMP/package-$PRGNAM
  17. OUTPUT=${OUTPUT:-/tmp}
  18. if [ "$ARCH" = "i486" ]; then
  19. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  20. elif [ "$ARCH" = "i686" ]; then
  21. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  22. fi
  23. set -e
  24. rm -rf $PKG
  25. mkdir -p $TMP $PKG $OUTPUT
  26. cd $TMP
  27. rm -rf $PRGNAM-$VERSION
  28. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  29. cd $PRGNAM-$VERSION
  30. chown -R root:root .
  31. chmod -R a-s,u+w,go+r-w .
  32. # Some important fixes from debian and ubuntu.
  33. # We normally don't like this idea, as it puts us maintaining the upstream
  34. # sources, but in this case, we'll make an exception.
  35. # I *really* don't like the non-bugfix parts of the debian patch, but I
  36. # guess I'll let it slide --rworkman
  37. for patch in $CWD/patches/* ; do
  38. bzcat $patch | patch -p1 --verbose --backup || exit 1
  39. done
  40. CFLAGS="$SLKCFLAGS" \
  41. CXXFLAGS="$SLKCFLAGS" \
  42. ./configure \
  43. --prefix=/usr \
  44. --enable-static=no
  45. make
  46. make install DESTDIR=$PKG
  47. ( cd $PKG
  48. find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  49. find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
  50. )
  51. ( cd $PKG/usr/man
  52. find . -type f -exec gzip -9 {} \;
  53. for i in $(find . -type l) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  54. )
  55. rm -f $PKG/usr/info/dir
  56. gzip -9 $PKG/usr/info/*.info*
  57. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  58. cp -a ABOUT-NLS AUTHORS BACKLOG COPYING* NEWS PATCHES-AC README THANKS TODO \
  59. $PKG/usr/doc/$PRGNAM-$VERSION
  60. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  61. mkdir -p $PKG/install
  62. cat $CWD/slack-desc > $PKG/install/slack-desc
  63. cd $PKG
  64. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz