ctl.SlackBuild 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #!/bin/bash
  2. # Slackware build script for ctl
  3. # Copyright 2016 Klaatu, Wellington NZ
  4. # All rights reserved.
  5. # 20220222 bkw: Modified by SlackBuilds.org, BUILD=2:
  6. # - fix build on 15.0.
  7. # - move .doc and .pdf documentation to our doc dir.
  8. cd $(dirname $0) ; CWD=$(pwd)
  9. PRGNAM=ctl
  10. VERSION=${VERSION:-1.5.2}
  11. BUILD=${BUILD:-2}
  12. TAG=${TAG:-_SBo}
  13. PKGTYPE=${PKGTYPE:-tgz}
  14. if [ -z "$ARCH" ]; then
  15. case "$( uname -m )" in
  16. i?86) ARCH=i586 ;;
  17. arm*) ARCH=arm ;;
  18. *) ARCH=$( uname -m ) ;;
  19. esac
  20. fi
  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" = "i586" ]; then
  29. SLKCFLAGS="-O2 -march=i586 -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. set -e
  42. rm -rf $PKG
  43. mkdir -p $TMP $PKG $OUTPUT
  44. cd $TMP
  45. rm -rf CTL-$PRGNAM-$VERSION
  46. tar xvf $CWD/CTL-$PRGNAM-$VERSION.tar.gz
  47. cd CTL-$PRGNAM-$VERSION
  48. chown -R root:root .
  49. find -L . \
  50. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  51. -o -perm 511 \) -exec chmod 755 {} \+ -o \
  52. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  53. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+ || true
  54. # 20220223 bkw: patches comes from AUR and/or gentoo.
  55. patch -p1 < $CWD/ctl-1.5.2-Use-GNUInstallDirs-and-fix-PkgConfig-files-1.patch
  56. patch -p1 < $CWD/ilmbase-2.3.0-compatibility.patch
  57. # 20220223 bkw: C++, the ever-moving target...
  58. sed -i -e 's,std::istream::streampos,std::streampos,g' lib/dpx/dpx.hh
  59. PKG_CONFIG_PATH="$PKG/usr/lib${LIBDIRSUFFIX}/pkgconfig:$PKG_CONFIG_PATH" \
  60. CFLAGS="$SLKCFLAGS" \
  61. CXXFLAGS="$SLKCFLAGS" \
  62. mkdir -p build
  63. cd build
  64. cmake \
  65. -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
  66. -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
  67. -DCMAKE_EXE_LINKER_FLAGS="-lAcesContainer" \
  68. -DCMAKE_INSTALL_PREFIX=/usr \
  69. -DINSTALL_CMAKE_DIR=/usr/lib${LIBDIRSUFFIX} \
  70. -DINSTALL_LIB_DIR=/usr/lib${LIBDIRSUFFIX} \
  71. -DCMAKE_BUILD_TYPE=Release ..
  72. make
  73. make install/strip DESTDIR=$PKG
  74. cd ..
  75. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  76. cp -a AUTHORS LICENSE CHANGELOG README.md $PKG/usr/doc/$PRGNAM-$VERSION
  77. mv $PKG/usr/share/doc/CTL/* $PKG/usr/doc/$PRGNAM-$VERSION
  78. rm -rf $PKG/usr/share
  79. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  80. mkdir -p $PKG/install
  81. cat $CWD/slack-desc > $PKG/install/slack-desc
  82. cd $PKG
  83. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE