wmblob.SlackBuild 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. #!/bin/bash
  2. # Slackware build script for wmblob
  3. #
  4. # Copyright 2015 Gethyn ThomasQuail <email removed>
  5. # All rights reserved.
  6. #
  7. # Based on:
  8. # SBo's cmake-template
  9. #
  10. # Redistribution and use of this script, with or without modification, is
  11. # permitted provided that the following conditions are met:
  12. #
  13. # 1. Redistributions of this script must retain the above copyright
  14. # notice, this list of conditions and the following disclaimer.
  15. #
  16. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
  17. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  18. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  19. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  20. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  21. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  22. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  23. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  24. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  25. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. # Now maintained by B. Watson <yalhcru@gmail.com>
  27. # 20160816 bkw:
  28. # - took over maintenance
  29. # - BUILD=2
  30. # - install binary stripped
  31. # - apply SLKCFLAGS
  32. # - don't install INSTALL in docdir
  33. cd $(dirname $0) ; CWD=$(pwd)
  34. PRGNAM=wmblob
  35. VERSION=${VERSION:-1.0.4}
  36. BUILD=${BUILD:-2}
  37. TAG=${TAG:-_SBo}
  38. PKGTYPE=${PKGTYPE:-tgz}
  39. if [ -z "$ARCH" ]; then
  40. case "$( uname -m )" in
  41. i?86) ARCH=i586 ;;
  42. arm*) ARCH=arm ;;
  43. *) ARCH=$( uname -m ) ;;
  44. esac
  45. fi
  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 xvf $CWD/$PRGNAM-$VERSION.tar.bz2
  72. cd $PRGNAM-$VERSION
  73. chown -R root:root .
  74. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  75. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  76. ./configure \
  77. --prefix=/usr \
  78. --libdir=/usr/lib${LIBDIRSUFFIX} \
  79. --x-includes=/usr/include/X11 \
  80. --x-libraries=/usr/lib/X11 \
  81. --sysconfdir=/etc \
  82. --localstatedir=/var \
  83. --mandir=/usr/man \
  84. --docdir=/usr/doc/$PRGNAM-$VERSION \
  85. --build=$ARCH-slackware-linux
  86. # configure ignores environment CFLAGS, so:
  87. sed -i "s,-O2,$SLKCFLAGS," src/Makefile
  88. make
  89. make install-strip DESTDIR=$PKG
  90. gzip -9 $PKG/usr/man/man1/$PRGNAM.1
  91. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  92. cp -a AUTHORS COPYING doc/how_it_works NEWS README $PKG/usr/doc/$PRGNAM-$VERSION
  93. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  94. mkdir -p $PKG/install
  95. cat $CWD/slack-desc > $PKG/install/slack-desc
  96. cd $PKG
  97. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE