perl-Mail-DKIM.SlackBuild 3.1 KB

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