bibletime.SlackBuild 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. #!/bin/bash
  2. # A slackbuild script to build the BibleTime Sword frontend
  3. # Copyright (c) 2007, Timothy Pollard
  4. # All rights reserved.
  5. #
  6. # Redistribution and use in source and binary forms, with or without modification,
  7. # are permitted provided that the following conditions are met:
  8. #
  9. # * Redistributions of source code must retain the above copyright notice,
  10. # this list of conditions and the following disclaimer.
  11. # * Redistributions in binary form must reproduce the above copyright
  12. # notice, this list of conditions and the following disclaimer in the
  13. # documentation and/or other materials provided with the distribution.
  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. # Modified by Robert Delahunt [twinreverb[at]puresimplicity.net
  26. # Modified 2018/19/20 by Tim Dickson (dickson.tim@googlemail.com)
  27. # Modified 20200918 by B. Watson <urchlay@slackware.uk>
  28. # Modified 20220412 by Tim Dickson (dickson.tim@googlemail.com)
  29. # updated for v3.0.3 and fix doc location by Tim Dickson (dickson.tim@googlemail.com)
  30. cd $(dirname $0) ; CWD=$(pwd)
  31. PRGNAM=bibletime
  32. VERSION=${VERSION:-3.0.3}
  33. BUILD=${BUILD:-1}
  34. TAG=${TAG:-_SBo}
  35. PKGTYPE=${PKGTYPE:-tgz}
  36. if [ -z "$ARCH" ]; then
  37. case "$( uname -m )" in
  38. i?86) ARCH=i586 ;;
  39. arm*) ARCH=arm ;;
  40. *) ARCH=$( uname -m ) ;;
  41. esac
  42. fi
  43. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  44. # the name of the created package would be, and then exit. This information
  45. # could be useful to other scripts.
  46. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  47. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  48. exit 0
  49. fi
  50. TMP=${TMP:-/tmp/SBo}
  51. PKG=$TMP/package-$PRGNAM
  52. OUTPUT=${OUTPUT:-/tmp}
  53. if [ "$ARCH" = "i586" ]; then
  54. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  55. LIBDIRSUFFIX=""
  56. elif [ "$ARCH" = "i686" ]; then
  57. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  58. LIBDIRSUFFIX=""
  59. elif [ "$ARCH" = "x86_64" ]; then
  60. SLKCFLAGS="-O2 -fPIC"
  61. LIBDIRSUFFIX="64"
  62. else
  63. SLKCFLAGS="-O2"
  64. LIBDIRSUFFIX=""
  65. fi
  66. set -e
  67. rm -rf $PKG
  68. mkdir -p $TMP $PKG $OUTPUT
  69. cd $TMP
  70. rm -rf $PRGNAM-$VERSION
  71. tar -xJvf $CWD/$PRGNAM-$VERSION.tar.xz
  72. cd $PRGNAM-$VERSION
  73. mkdir -p build
  74. cd build
  75. cmake \
  76. -Wno-dev \
  77. -DCMAKE_BUILD_TYPE=Release \
  78. -DCMAKE_INSTALL_PREFIX=/usr \
  79. -DCMAKE_SKIP_RPATH:BOOL=ON \
  80. -DCMAKE_C_FLAGS="$SLKCFLAGS" \
  81. -DCMAKE_CXX_FLAGS="$SLKCFLAGS" \
  82. -DBT_DOCDIR="doc/$PRGNAM-$VERSION" \
  83. -DLIB_SUFFIX=$LIBDIRSUFFIX ..
  84. make
  85. make install DESTDIR=$PKG
  86. cd ..
  87. # /usr/share/icons is for themed icons
  88. mv $PKG/usr/share/icons $PKG/usr/share/pixmaps
  89. find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  90. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  91. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  92. cp -a ChangeLog LICENSE README.md $PKG/usr/doc/$PRGNAM-$VERSION
  93. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  94. find $PKG/usr/doc/$PRGNAM-$VERSION -type f -exec chmod 644 {} \;
  95. mkdir -p $PKG/install
  96. cat $CWD/slack-desc > $PKG/install/slack-desc
  97. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  98. cd $PKG
  99. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE