Xdialog.SlackBuild 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #!/bin/bash
  2. # Slackware build script for Xdialog
  3. # Written by slakmagik <slakmagik@gmail.com>
  4. # Released under the WTFPL
  5. cd $(dirname $0) ; CWD=$(pwd)
  6. PRGNAM=Xdialog
  7. VERSION=${VERSION:-2.3.1}
  8. BUILD=${BUILD:-2}
  9. TAG=${TAG:-_SBo}
  10. PKGTYPE=${PKGTYPE:-tgz}
  11. if [ -z "$ARCH" ]; then
  12. case "$( uname -m )" in
  13. i?86) ARCH=i486 ;;
  14. arm*) ARCH=arm ;;
  15. *) ARCH=$( uname -m ) ;;
  16. esac
  17. fi
  18. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  19. # the name of the created package would be, and then exit. This information
  20. # could be useful to other scripts.
  21. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  22. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  23. exit 0
  24. fi
  25. TMP=${TMP:-/tmp/SBo}
  26. PKG=$TMP/package-$PRGNAM
  27. OUTPUT=${OUTPUT:-/tmp}
  28. if [ "$ARCH" = "i486" ]; then
  29. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  30. LIBDIRSUFFIX=""
  31. elif [ "$ARCH" = "i686" ]; then
  32. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  33. LIBDIRSUFFIX=""
  34. elif [ "$ARCH" = "x86_64" ]; then
  35. SLKCFLAGS="-O2 -fPIC"
  36. LIBDIRSUFFIX="64"
  37. else
  38. SLKCFLAGS="-O2"
  39. LIBDIRSUFFIX=""
  40. fi
  41. NLS=${NLS:-disable}
  42. # I do this so the script has a consistent interface, using 'enable' for both
  43. # - and because passing '--without-gtk2' makes it compile for gtk2 as much as
  44. # '--with; does(!) so you have to pass it nothing if you want gtk1.
  45. if [ "$GTK2" = enable ]; then
  46. GTK2=--with-gtk2
  47. else
  48. unset GTK2
  49. fi
  50. set -e
  51. rm -rf $PKG
  52. mkdir -p $TMP $PKG $OUTPUT
  53. cd $TMP
  54. rm -rf $PRGNAM-$VERSION
  55. tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
  56. cd $PRGNAM-$VERSION
  57. chown -R root:root .
  58. # NEWS is a symlink to ChangeLog and the latter gets the wrong perms unless I
  59. # exclude links from the tests
  60. find . ! -type 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 600 -o -perm 444 -o -perm 440 \
  64. -o -perm 400 \) \) -exec chmod 644 {} \;
  65. CFLAGS="$SLKCFLAGS -fgnu89-inline" \
  66. CXXFLAGS="$SLKCFLAGS" \
  67. ./configure \
  68. --prefix=/usr \
  69. --mandir=/usr/man \
  70. --datadir=/usr \
  71. --$NLS-nls \
  72. $GTK2
  73. make
  74. make DESTDIR=$PKG install-strip
  75. find $PKG/usr/man -type f -exec gzip -9 {} \;
  76. cp -a [ABCINR]* $PKG/usr/doc/$PRGNAM-$VERSION
  77. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  78. mkdir -p $PKG/install
  79. cat $CWD/slack-desc > $PKG/install/slack-desc
  80. cd $PKG
  81. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE