perl-GD.SlackBuild 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. #!/bin/bash
  2. # Slackware build script for perl-GD
  3. # Written by B. Watson (yalhcru@gmail.com)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. # 20211012 bkw: BUILD=2. Fix -current build, by commenting out
  6. # 'make test'. This is because of the (fairly) recent gd-2.3.3
  7. # update in -current. libgd upstream changed the default for the
  8. # (undocumented) --enable-gd-formats option to 'no' in 2.3.3, and
  9. # the perl-GD tests include .gd and .gd2 images. Sent a note to PV,
  10. # hopefully he rebuilds gd with re-added support for .gd/.gd2 images.
  11. # 20200929 bkw: update for v2.73
  12. # 20191201 bkw: update for v2.71
  13. # 20180829 bkw: update for v2.69
  14. # 20180611 bkw: update for v2.68
  15. # 20180228 bkw:
  16. # - fix build on 32-bit. Thanks to idlemoor for the bug report.
  17. # - add FASTCGI option
  18. cd $(dirname $0) ; CWD=$(pwd)
  19. PRGNAM=perl-GD
  20. VERSION=${VERSION:-2.73}
  21. BUILD=${BUILD:-1}
  22. TAG=${TAG:-_SBo}
  23. PKGTYPE=${PKGTYPE:-tgz}
  24. if [ -z "$ARCH" ]; then
  25. case "$( uname -m )" in
  26. i?86) ARCH=i586 ;;
  27. arm*) ARCH=arm ;;
  28. *) ARCH=$( uname -m ) ;;
  29. esac
  30. fi
  31. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  32. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  33. exit 0
  34. fi
  35. TMP=${TMP:-/tmp/SBo}
  36. PKG=$TMP/package-$PRGNAM
  37. OUTPUT=${OUTPUT:-/tmp}
  38. if [ "$ARCH" = "i586" ]; then
  39. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  40. LIBDIRSUFFIX=""
  41. elif [ "$ARCH" = "i686" ]; then
  42. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  43. LIBDIRSUFFIX=""
  44. elif [ "$ARCH" = "x86_64" ]; then
  45. SLKCFLAGS="-O2 -fPIC"
  46. LIBDIRSUFFIX="64"
  47. else
  48. SLKCFLAGS="-O2"
  49. LIBDIRSUFFIX=""
  50. fi
  51. set -e
  52. SRCNAM="GD"
  53. rm -rf $PKG
  54. mkdir -p $TMP $PKG $OUTPUT
  55. cd $TMP
  56. rm -rf $SRCNAM-$VERSION
  57. tar xvf $CWD/$SRCNAM-$VERSION.tar.gz
  58. cd $SRCNAM-$VERSION
  59. chown -R root:root .
  60. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  61. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  62. # You might notice this in the build log:
  63. # ** WARNING: found gd.h header file in /usr/X11R6/include/gd.h
  64. # This isn't a real issue, since on Slackware /usr/X11R6/include
  65. # is just a symlink to /usr/include.
  66. if [ "${FASTCGI:-no}" = "yes" ]; then
  67. FCGIOPT="--fcgi"
  68. WITH="with"
  69. else
  70. FCGIOPT=""
  71. WITH="without"
  72. fi
  73. perl Makefile.PL \
  74. --lib_gd_path /usr \
  75. $FCGIOPT \
  76. PREFIX=/usr \
  77. INSTALLDIRS=vendor \
  78. INSTALLVENDORMAN3DIR=/usr/man/man3 \
  79. INSTALLVENDORMAN1DIR=/usr/man/man1
  80. make
  81. # make test # commented out until further notice!
  82. make install DESTDIR=$PKG
  83. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  84. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  85. find $PKG/usr/man -type f -exec gzip -9 {} \;
  86. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  87. find $PKG -name perllocal.pod \
  88. -o -name ".packlist" \
  89. -o -name "*.bs" \
  90. | xargs rm -f
  91. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  92. cp -a README* ChangeLog LICENSE $PKG/usr/doc/$PRGNAM-$VERSION
  93. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  94. mkdir -p $PKG/install
  95. sed "s,@WITH@,$WITH," $CWD/slack-desc > $PKG/install/slack-desc
  96. cd $PKG
  97. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE