dictd.SlackBuild 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. #!/bin/bash
  2. # Slackware build script for dictd
  3. # Written by sercari <sercari@esdebian.org>
  4. cd $(dirname $0) ; CWD=$(pwd)
  5. PRGNAM=dictd
  6. VERSION=${VERSION:-1.12.1}
  7. BUILD=${BUILD:-1}
  8. TAG=${TAG:-_SBo}
  9. PKGTYPE=${PKGTYPE:-tgz}
  10. if [ -z "$ARCH" ]; then
  11. case "$( uname -m )" in
  12. i?86) ARCH=i486 ;;
  13. arm*) ARCH=arm ;;
  14. *) ARCH=$( uname -m ) ;;
  15. esac
  16. fi
  17. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  18. # the name of the created package would be, and then exit. This information
  19. # could be useful to other scripts.
  20. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  21. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  22. exit 0
  23. fi
  24. TMP=${TMP:-/tmp/SBo}
  25. PKG=$TMP/package-$PRGNAM
  26. OUTPUT=${OUTPUT:-/tmp}
  27. if [ "$ARCH" = "i486" ]; then
  28. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  29. LIBDIRSUFFIX=""
  30. elif [ "$ARCH" = "i686" ]; then
  31. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  32. LIBDIRSUFFIX=""
  33. elif [ "$ARCH" = "x86_64" ]; then
  34. SLKCFLAGS="-O2 -fPIC"
  35. LIBDIRSUFFIX="64"
  36. else
  37. SLKCFLAGS="-O2"
  38. LIBDIRSUFFIX=""
  39. fi
  40. set -e
  41. rm -rf $PKG
  42. mkdir -p $TMP $PKG $OUTPUT
  43. cd $TMP
  44. rm -rf $PRGNAM-$VERSION
  45. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  46. cd $PRGNAM-$VERSION
  47. chown -R root:root .
  48. find -L . \
  49. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  50. -o -perm 511 \) -exec chmod 755 {} \; -o \
  51. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  52. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  53. CFLAGS="$SLKCFLAGS" \
  54. CXXFLAGS="$SLKCFLAGS" \
  55. ./configure \
  56. --prefix=/usr \
  57. --sysconfdir=/etc/dictd \
  58. --libdir=/usr/lib${LIBDIRSUFFIX} \
  59. --mandir=/usr/man \
  60. --localstatedir=/var/lib \
  61. --build=$ARCH-slackware-linux
  62. make
  63. make install DESTDIR=$PKG
  64. mkdir -p $PKG/etc/dictd
  65. cat $CWD/config/dict.conf > $PKG/etc/dictd/dict.conf.new
  66. cat $CWD/config/dictd.conf > $PKG/etc/dictd/dictd.conf.new
  67. cat $CWD/config/dictd.order > $PKG/etc/dictd/dictd.order.new
  68. cat $CWD/config/dictdconfig.alias > $PKG/etc/dictd/dictdconfig.alias.new
  69. cat $CWD/config/db.list > $PKG/etc/dictd/db.list.new
  70. mkdir -p $PKG/etc/rc.d
  71. cat $CWD/config/rc.dictd > $PKG/etc/rc.d/rc.dictd.new
  72. chmod 0755 $PKG/etc/rc.d/rc.dictd.new
  73. mkdir -p $PKG/usr/share/dictd
  74. ( cd $PKG/usr/man
  75. find . -type f -exec gzip -9 {} \;
  76. for i in $( find . -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  77. )
  78. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  79. cp -a \
  80. ANNOUNCE COPYING ChangeLog INITSCRIPT INSTALL NEWS README TODO \
  81. ./doc/rfc2229.txt ./doc/security.doc examples \
  82. $PKG/usr/doc/$PRGNAM-$VERSION
  83. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  84. cat $CWD/README.SLACKWARE > $PKG/usr/doc/$PRGNAM-$VERSION/README.SLACKWARE
  85. mkdir -p $PKG/install
  86. cat $CWD/slack-desc > $PKG/install/slack-desc
  87. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  88. cd $PKG
  89. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE