vttest.SlackBuild 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. #!/bin/bash
  2. # Slackware build script for vttest
  3. # Written by B. Watson (urchlay@slackware.uk)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. # 20230103 bkw: update for 2.7.20221229.
  6. # 20210220 bkw: update for 2.7.20210210.
  7. # 20201025 bkw: update for 2.7.20200920.
  8. # 20200316 bkw: update for 2.7.20200303.
  9. # 20191130 bkw: update for 2.7.20190710.
  10. # 20180920 bkw: update for 2.7.20180911 (whoops!).
  11. # 20180915 bkw: update for 2.7.20180811.
  12. cd $(dirname $0) ; CWD=$(pwd)
  13. PRGNAM=vttest
  14. VERSION=${VERSION:-2.7.20221229}
  15. BUILD=${BUILD:-1}
  16. TAG=${TAG:-_SBo}
  17. PKGTYPE=${PKGTYPE:-tgz}
  18. if [ -z "$ARCH" ]; then
  19. case "$( uname -m )" in
  20. i?86) ARCH=i586 ;;
  21. arm*) ARCH=arm ;;
  22. *) ARCH=$( uname -m ) ;;
  23. esac
  24. fi
  25. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  26. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  27. exit 0
  28. fi
  29. TMP=${TMP:-/tmp/SBo}
  30. PKG=$TMP/package-$PRGNAM
  31. OUTPUT=${OUTPUT:-/tmp}
  32. if [ "$ARCH" = "i586" ]; then
  33. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  34. LIBDIRSUFFIX=""
  35. elif [ "$ARCH" = "i686" ]; then
  36. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  37. LIBDIRSUFFIX=""
  38. elif [ "$ARCH" = "x86_64" ]; then
  39. SLKCFLAGS="-O2 -fPIC"
  40. LIBDIRSUFFIX="64"
  41. else
  42. SLKCFLAGS="-O2"
  43. LIBDIRSUFFIX=""
  44. fi
  45. set -e
  46. # 20180618 bkw:
  47. # The "2.7" part of the version number isn't part of the filename nor the
  48. # extracted directory. I could just use the date/time as VERSION but I
  49. # want it to match the documentation (CHANGES file, and the mention of
  50. # "post version 1.7 tests" on the web site). Using rev here in case
  51. # the version ever has 3 components (2.7.1 rather than 2.7, eg).
  52. TARVER="$( echo $VERSION | rev | cut -d. -f1 | rev )"
  53. rm -rf $PKG
  54. mkdir -p $TMP $PKG $OUTPUT
  55. cd $TMP
  56. rm -rf $PRGNAM-$TARVER
  57. tar xvf $CWD/$PRGNAM-$TARVER.tgz
  58. cd $PRGNAM-$TARVER
  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. # Check CHANGES to make sure the version hasn't updated. Nobody but me
  63. # should ever see this error message (in the grand tradition of error
  64. # messages that say "This never happens").
  65. MAJMIN="$( echo $VERSION | rev | cut -d. -f2- | rev )"
  66. REALVER="$( grep '^VERSION' CHANGES | head -1 | sed 's,.* ,,' )"
  67. if [ "$REALVER" != "$MAJMIN" ]; then
  68. cat 1>&2 <<EOF
  69. *** VERSION=$VERSION, the $MAJMIN part is wrong, doesn't match
  70. *** VERSION $REALVER in CHANGES file.
  71. *** Fix the build! If you are not the maintainer, please copy/paste
  72. *** this message and mail it to the maintainer.
  73. EOF
  74. exit 1
  75. fi
  76. # Old configure script, works, but doesn't accept --docdir and doesn't
  77. # support 'make install-strip'.
  78. CFLAGS="$SLKCFLAGS" \
  79. CXXFLAGS="$SLKCFLAGS" \
  80. ./configure \
  81. --prefix=/usr \
  82. --libdir=/usr/lib${LIBDIRSUFFIX} \
  83. --sysconfdir=/etc \
  84. --localstatedir=/var \
  85. --mandir=/usr/man \
  86. --build=$ARCH-slackware-linux
  87. make
  88. make install DESTDIR=$PKG
  89. strip $PKG/usr/bin/$PRGNAM
  90. gzip -9 $PKG/usr/man/man1/$PRGNAM.1
  91. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  92. cp -a BUGS CHANGES COPYING MANIFEST README $PKG/usr/doc/$PRGNAM-$VERSION
  93. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  94. mkdir -p $PKG/install
  95. cat $CWD/slack-desc > $PKG/install/slack-desc
  96. cd $PKG
  97. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE