wmcliphist.SlackBuild 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. #!/bin/bash
  2. # Slackware build script for wmcliphist
  3. # Originally written by Shining <email removed>
  4. # Modified & now maintained by B. Watson <yalhcru@gmail.com>. Original
  5. # version had no license. Modified version released under the WTFPL. See
  6. # http://www.wtfpl.net/txt/copying/ for details.
  7. # 20170223 bkw:
  8. # - Take over maintenance, update for v2.1.
  9. # - Fix homepage and download link.
  10. # - i486 => i586.
  11. # - Add debian patches for 2.1-2 (minor compile issues).
  12. # - Fix grammar in README and slack-desc.
  13. # - Install sample config file in doc dir (as per the man page).
  14. # - Fix path to docdir in man page.
  15. # 20170225 bkw:
  16. # - BUILD=2
  17. # - Get rid of annoying assertion "'GTK_IS_WIDGET (widget)' failed" warnings
  18. # - Document annoying bug I don't know how to fix, in BUG.txt
  19. cd $(dirname $0) ; CWD=$(pwd)
  20. PRGNAM=wmcliphist
  21. VERSION=${VERSION:-2.1}
  22. BUILD=${BUILD:-2}
  23. TAG=${TAG:-_SBo}
  24. PKGTYPE=${PKGTYPE:-tgz}
  25. if [ -z "$ARCH" ]; then
  26. case "$( uname -m )" in
  27. i?86) ARCH=i586 ;;
  28. arm*) ARCH=arm ;;
  29. *) ARCH=$( uname -m ) ;;
  30. esac
  31. fi
  32. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  33. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  34. exit 0
  35. fi
  36. TMP=${TMP:-/tmp/SBo}
  37. PKG=$TMP/package-$PRGNAM
  38. OUTPUT=${OUTPUT:-/tmp}
  39. if [ "$ARCH" = "i586" ]; then
  40. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  41. LIBDIRSUFFIX=""
  42. elif [ "$ARCH" = "i686" ]; then
  43. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  44. LIBDIRSUFFIX=""
  45. elif [ "$ARCH" = "x86_64" ]; then
  46. SLKCFLAGS="-O2 -fPIC"
  47. LIBDIRSUFFIX="64"
  48. else
  49. SLKCFLAGS="-O2"
  50. LIBDIRSUFFIX=""
  51. fi
  52. set -e
  53. rm -rf $PKG
  54. mkdir -p $TMP $PKG $OUTPUT
  55. cd $TMP
  56. rm -rf $PRGNAM-$VERSION
  57. mkdir -p $PRGNAM-$VERSION
  58. cd $PRGNAM-$VERSION
  59. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  60. cd dockapps
  61. chown -R root:root .
  62. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  63. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  64. # Patches are from: https://packages.debian.org/sid/wmcliphist
  65. # Probably not even necessary (they fix compiler warnings), and not
  66. # complete (they don't fix *all* the warnings).
  67. for i in $CWD/*.patch; do
  68. patch -p1 < $i
  69. done
  70. # This patch is my own. It removes these annoying warnings:
  71. # gtk_widget_destroy: assertion 'GTK_IS_WIDGET (widget)' failed
  72. # Reason for the warnings: gtk_container_remove() already destroys
  73. # a widget, if there's no other reference to it. So we don't need
  74. # to then call gtk_widget_destroy() on the same widget. See
  75. # https://developer.gnome.org/gtk3/unstable/GtkContainer.html#gtk-container-remove
  76. # This explanation is longer than the patch, sorry about that.
  77. patch -p1 < $CWD/gtk_assert.diff
  78. sed -i "/^CFLAGS/s,-pedantic,$SLKCFLAGS," Makefile
  79. sed -i "s,/usr/share/doc/$PRGNAM,/usr/doc/$PRGNAM-$VERSION," $PRGNAM.1
  80. make PREFIX=/usr MAN1DIR=/usr/man/man1
  81. strip $PRGNAM
  82. make install PREFIX=/usr MAN1DIR=/usr/man/man1 DESTDIR=$PKG
  83. gzip -9 $PKG/usr/man/man1/$PRGNAM.1
  84. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  85. cp -a AUTHORS COPYING ChangeLog NEWS README ${PRGNAM}rc \
  86. $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. cd $PKG
  91. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE