You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

109 lines
3.3 KiB

  1. #!/bin/sh
  2. # Slackware Package Build Script for perl modules: Convert::TNEF
  3. # Home Page http://search.cpan.org/dist/Convert-TNEF/
  4. # Copyright (c) 2009-2010, Nishant Limbachia, Hoffman Estates, IL, USA (nishant__AT__mnspace__DOT__net)
  5. # All rights reserved.
  6. # Redistribution and use of this script, with or without modification, is
  7. # permitted provided that the following conditions are met:
  8. # 1. Redistributions of script must retain the above copyright notice,
  9. # this list of conditions and the following disclaimer.
  10. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  11. # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  12. # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  13. # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  14. # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  15. # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  16. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  17. # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  18. # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  19. # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  20. # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  21. #
  22. # Modified by the SlackBuilds.org project.
  23. SRCNAM=Convert-TNEF
  24. PRGNAM=perl-Convert-TNEF
  25. VERSION=${VERSION:-0.18}
  26. BUILD=${BUILD:-1}
  27. TAG=${TAG:-_SBo}
  28. if [ -z "$ARCH" ]; then
  29. case "$( uname -m )" in
  30. i?86) ARCH=i486 ;;
  31. arm*) ARCH=arm ;;
  32. *) ARCH=$( uname -m ) ;;
  33. esac
  34. fi
  35. CWD=$(pwd)
  36. TMP=${TMP:-/tmp/SBo}
  37. PKG=$TMP/package-$PRGNAM
  38. OUTPUT=${OUTPUT:-/tmp}
  39. set -e
  40. DOCS="Changes README"
  41. if [ "$ARCH" = "i486" ]; then
  42. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  43. LIBDIRSUFFIX=""
  44. elif [ "$ARCH" = "i686" ]; then
  45. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  46. LIBDIRSUFFIX=""
  47. elif [ "$ARCH" = "x86_64" ]; then
  48. SLKCFLAGS="-O2 -fPIC"
  49. LIBDIRSUFFIX="64"
  50. else
  51. SLKCFLAGS="-O2"
  52. LIBDIRSUFFIX=""
  53. fi
  54. rm -fr $TMP/$SRCNAM-$VERSION $PKG
  55. mkdir -p $TMP $PKG $OUTPUT
  56. cd $TMP
  57. tar xvf $CWD/$SRCNAM-$VERSION.tar.gz
  58. cd $TMP/$SRCNAM-$VERSION
  59. chown -R root.root .
  60. find -L . \
  61. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  62. -exec chmod 755 {} \; -o \
  63. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  64. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  65. CFLAGS="$SLKCFLAGS" \
  66. perl Makefile.PL PREFIX=/usr INSTALLDIRS=vendor INSTALLVENDORMAN3DIR=/usr/man/man3
  67. make
  68. make install DESTDIR=$PKG
  69. ### putting essential docs
  70. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  71. cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
  72. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  73. # Remove perlocal.pod and .packlist from $PKG
  74. ( cd $PKG
  75. find . -name "perllocal.pod" -o -name ".packlist" -o -name "*.bs" | xargs rm -f
  76. )
  77. # Remove empty directories
  78. find $PKG -depth -type d -empty -exec rm -rf {} \;
  79. find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  80. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  81. ( cd $PKG/usr/man
  82. find . -type f -exec gzip -9 {} \;
  83. for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done
  84. )
  85. mkdir -p $PKG/install
  86. cat $CWD/slack-desc > $PKG/install/slack-desc
  87. cd $PKG
  88. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}