perl-extutils-depends.SlackBuild 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. #!/bin/bash
  2. #
  3. # Slackware build script for perl-extutils-depends.
  4. #
  5. # (C) 2007 Michael Wagner <lapinours@web.de>
  6. # Copyright 2010, 2012 Binh Nguyen <binhvng@gmail.com>
  7. # Copyright 2014-2017 Glenn Becker <burningc@sdf.org>
  8. # Copyright 2017-2022 Edinaldo P. Silva, Rio de Janeiro, Brazil.
  9. #
  10. # All rights reserved.
  11. #
  12. # Redistribution and use of this script, with or without modification, is
  13. # permitted provided that the following conditions are met:
  14. #
  15. # 1. Redistributions of this script must retain the above copyright
  16. # notice, this list of conditions and the following disclaimer.
  17. #
  18. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
  19. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  20. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  21. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  22. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  23. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  24. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  25. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  26. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  27. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  28. cd $(dirname $0) ; CWD=$(pwd)
  29. PRGNAM=perl-extutils-depends
  30. VERSION=${VERSION:-0.8001}
  31. BUILD=${BUILD:-1}
  32. TAG=${TAG:-_SBo}
  33. PKGTYPE=${PKGTYPE:-tgz}
  34. if [ -z "$ARCH" ]; then
  35. case "$( uname -m )" in
  36. i?86) ARCH=i586 ;;
  37. arm*) ARCH=arm ;;
  38. *) ARCH=$( uname -m ) ;;
  39. esac
  40. fi
  41. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  42. # the name of the created package would be, and then exit. This information
  43. # could be useful to other scripts.
  44. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  45. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  46. exit 0
  47. fi
  48. TMP=${TMP:-/tmp/SBo}
  49. PKG=$TMP/package-$PRGNAM
  50. OUTPUT=${OUTPUT:-/tmp}
  51. if [ "$ARCH" = "i586" ]; then
  52. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  53. LIBDIRSUFFIX=""
  54. elif [ "$ARCH" = "i686" ]; then
  55. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  56. LIBDIRSUFFIX=""
  57. elif [ "$ARCH" = "x86_64" ]; then
  58. SLKCFLAGS="-O2 -fPIC"
  59. LIBDIRSUFFIX="64"
  60. else
  61. SLKCFLAGS="-O2"
  62. LIBDIRSUFFIX=""
  63. fi
  64. SRCNAM="ExtUtils-Depends"
  65. set -e
  66. rm -rf $PKG
  67. mkdir -p $TMP $PKG $OUTPUT
  68. cd $TMP
  69. rm -rf $SRCNAM-$VERSION
  70. tar xvf $CWD/$SRCNAM-$VERSION.tar.gz
  71. cd $SRCNAM-$VERSION
  72. chown -R root:root .
  73. find -L . \
  74. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  75. -o -perm 511 \) -exec chmod 755 {} \; -o \
  76. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  77. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  78. perl Makefile.PL
  79. make
  80. make install INSTALLDIRS=vendor DESTDIR=$PKG
  81. mv $PKG/usr/share/man $PKG/usr
  82. gzip -9 $PKG/usr/man/man3/* 2> /dev/null
  83. # Remove perlocal.pod and .packlist from $PKG
  84. find $PKG -name "perllocal.pod" -o -name ".packlist" -o -name "*.bs" | xargs rm -f || true
  85. # Remove empty directories
  86. find $PKG -depth -type d -empty -exec rm -rf {} \;
  87. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  88. cp Changes README $PKG/usr/doc/$PRGNAM-$VERSION
  89. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  90. mkdir -p $PKG/install
  91. cat $CWD/slack-desc > $PKG/install/slack-desc
  92. cd $PKG
  93. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE