tta.SlackBuild 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. #!/bin/bash
  2. # Slackware build script for tta.
  3. #
  4. # Copyright 2022 Dave Woodfall <dave@slackbuilds.org>
  5. #
  6. # Copyright 2015 Edinaldo P. Silva, Rio de Janeiro, Brazil.
  7. # All rights reserved.
  8. #
  9. # Redistribution and use of this script, with or without modification, is
  10. # permitted provided that the following conditions are met:
  11. #
  12. # 1. Redistributions of this script must retain the above copyright
  13. # notice, this list of conditions and the following disclaimer.
  14. #
  15. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  16. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  17. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  18. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  19. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  20. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  21. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  22. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  23. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  24. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  25. # 20220317 bkw: Modified by SlackBuilds.org:
  26. # - fix build on 32-bit (hardcoded lib64 in script).
  27. # - actually use SLKCFLAGS.
  28. cd $(dirname $0) ; CWD=$(pwd)
  29. PRGNAM=tta
  30. VERSION=${VERSION:-2.3}
  31. BUILD=${BUILD:-1}
  32. TAG=${TAG:-_SBo}
  33. PKGTYPE=${PKGTYPE:-tgz}
  34. SRCNAM="libtta-c"
  35. if [ -z "$ARCH" ]; then
  36. case "$( uname -m )" in
  37. i?86) ARCH=i586 ;;
  38. arm*) ARCH=arm ;;
  39. *) ARCH=$( uname -m ) ;;
  40. esac
  41. fi
  42. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  43. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  44. exit 0
  45. fi
  46. TMP=${TMP:-/tmp/SBo}
  47. PKG=$TMP/package-$PRGNAM
  48. OUTPUT=${OUTPUT:-/tmp}
  49. if [ "$ARCH" = "i586" ]; then
  50. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  51. LIBDIRSUFFIX=""
  52. elif [ "$ARCH" = "i686" ]; then
  53. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  54. LIBDIRSUFFIX=""
  55. elif [ "$ARCH" = "x86_64" ]; then
  56. SLKCFLAGS="-O2 -fPIC"
  57. LIBDIRSUFFIX="64"
  58. else
  59. SLKCFLAGS="-O2"
  60. LIBDIRSUFFIX=""
  61. fi
  62. set -e
  63. rm -rf $PKG
  64. mkdir -p $TMP $PKG $OUTPUT
  65. rm -rf $TMP/$PRGNAM-$VERSION
  66. cd $TMP
  67. tar xvf $CWD/$SRCNAM-$VERSION.tar.gz
  68. mv $SRCNAM-$VERSION $PRGNAM-$VERSION
  69. cd $PRGNAM-$VERSION
  70. chown -R root:root .
  71. find -L . \
  72. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  73. -o -perm 511 \) -exec chmod 755 {} \+ -o \
  74. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  75. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
  76. # 20220317 bkw: this configure script ignores CFLAGS from the env...
  77. ./configure \
  78. --prefix=/usr \
  79. --libdir=/usr/lib${LIBDIRSUFFIX} \
  80. --sysconfdir=/etc \
  81. --localstatedir=/var \
  82. --mandir=/usr/man \
  83. --docdir=/usr/doc/$PRGNAM-$VERSION \
  84. --build=$ARCH-slackware-linux
  85. # 20220317 bkw: ...do this to use our flags:
  86. sed -i "s,-O2,$SLKCFLAGS," Makefile
  87. make
  88. make install-strip DESTDIR=$PKG
  89. rm -rf $PKG/usr/lib*
  90. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  91. cp -a COPYING README $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
  92. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  93. mkdir -p $PKG/install
  94. cat $CWD/slack-desc > $PKG/install/slack-desc
  95. cd $PKG
  96. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE