subtle.SlackBuild 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. #!/bin/bash
  2. # Slackware build script for subtle
  3. # Copyright 2012 Vincent Batts, Raleigh, NC, USA
  4. # Copyright 2011 Vincent Batts, vbatts@hashbangbash.com, http://hashbangbash.com/
  5. # All rights reserved.
  6. #
  7. # Redistribution and use of this script, with or without modification, is
  8. # permitted provided that the following conditions are met:
  9. #
  10. # 1. Redistributions of this script must retain the above copyright
  11. # notice, this list of conditions and the following disclaimer.
  12. #
  13. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
  14. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  15. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  16. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  18. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  19. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  20. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  21. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  22. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  23. # 20220306 bkw: Modified by SlackBuilds.org: fix build on 15.0.
  24. cd $(dirname $0) ; CWD=$(pwd)
  25. PRGNAM=subtle
  26. VERSION=${VERSION:-0.11.3224_xi}
  27. BUILD=${BUILD:-3}
  28. TAG=${TAG:-_SBo}
  29. PKGTYPE=${PKGTYPE:-tgz}
  30. SRCVERSION=$(echo $VERSION | tr '_' '-')
  31. if [ -z "$ARCH" ]; then
  32. case "$( uname -m )" in
  33. i?86) ARCH=i586 ;;
  34. arm*) ARCH=arm ;;
  35. *) ARCH=$( uname -m ) ;;
  36. esac
  37. fi
  38. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  39. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  40. exit 0
  41. fi
  42. TMP=${TMP:-/tmp/SBo}
  43. PKG=$TMP/package-$PRGNAM
  44. OUTPUT=${OUTPUT:-/tmp}
  45. if [ "$ARCH" = "i586" ]; then
  46. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  47. LIBDIRSUFFIX=""
  48. elif [ "$ARCH" = "i686" ]; then
  49. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  50. LIBDIRSUFFIX=""
  51. elif [ "$ARCH" = "x86_64" ]; then
  52. SLKCFLAGS="-O2 -fPIC"
  53. LIBDIRSUFFIX="64"
  54. else
  55. SLKCFLAGS="-O2"
  56. LIBDIRSUFFIX=""
  57. fi
  58. set -e
  59. rm -rf $PKG
  60. mkdir -p $TMP $PKG $OUTPUT
  61. cd $TMP
  62. rm -rf $PRGNAM-$SRCVERSION
  63. tar xvf $CWD/$PRGNAM-$SRCVERSION.tbz2
  64. cd $PRGNAM-$SRCVERSION
  65. chown -R root:root .
  66. find -L . \
  67. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  68. -exec chmod 755 {} \+ -o \
  69. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  70. -exec chmod 644 {} \+
  71. # Fixes to build against ruby2:
  72. patch -p1 < $CWD/changeset_r3240.diff
  73. patch -p1 < $CWD/changeset_r3242.diff
  74. patch -p1 < $CWD/changeset_r3244.diff
  75. # 20220306 bkw: shipping code with -Werror enabled is pure evil.
  76. sed -i "s,-Werror,$SLKCFLAGS," Rakefile
  77. rake install manprefix=/usr/man destdir=$PKG
  78. strip $PKG/usr/bin/$PRGNAM $PKG/usr/lib*/ruby/site_ruby/*/$PRGNAM/*.so
  79. gzip -9 $PKG/usr/man/man*/*
  80. mv $PKG/etc/xdg/subtle/subtle.rb $PKG/etc/xdg/subtle/subtle.rb.new
  81. # 20220306 bkw: pretty sure the .desktop file is bogus.
  82. install -D -m0755 -oroot $CWD/xinitrc.subtle $PKG/etc/X11/xinit/xinitrc.subtle
  83. install -D -m0644 -oroot $CWD/subtle.desktop $PKG/usr/share/xsessions/subtle.desktop
  84. # 20220306 bkw: ChangeLog is empty, INSTALL is useless.
  85. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  86. cp -a AUTHORS COPYING NEWS $PKG/usr/doc/$PRGNAM-$VERSION
  87. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  88. mkdir -p $PKG/install
  89. cat $CWD/slack-desc > $PKG/install/slack-desc
  90. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  91. cd $PKG
  92. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE