paps.SlackBuild 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. #!/bin/bash
  2. # Slackware build script for paps
  3. # Copyright (c) 2015 Leonard Schmidt <email removed>
  4. # All rights reserved.
  5. #
  6. # Redistribution and use in source and binary forms, with or without
  7. # modification, are permitted provided that the following conditions are met:
  8. # 1.- Redistributions of source code must retain the above copyright
  9. # notice, this list of conditions and the following disclaimer.
  10. #
  11. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY
  12. # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  13. # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  14. # DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
  15. # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  16. # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  17. # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  19. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  20. # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  21. # Now maintained by B. Watson <urchlay@slackware.uk>.
  22. # 20210929 bkw: fix build on -current (--disable-Werror).
  23. # 20191130 bkw: update for v0.7.1. upstream removed README.md and examples.
  24. # 20180629 bkw:
  25. # - Take over maintenance.
  26. # - Include README.md (not README) in doc dir, since README just says
  27. # "see README.md". BUILD=2.
  28. # - Add NEWS and example to docdir.
  29. # - Mention PDF and SVG in the README, since those are supported output
  30. # formats, and very useful ones...
  31. # - Regenerate slack-desc from updated README.
  32. # - Simplify script a bit.
  33. cd $(dirname $0) ; CWD=$(pwd)
  34. PRGNAM=paps
  35. VERSION=${VERSION:-0.7.1}
  36. BUILD=${BUILD:-1}
  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.gz
  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. ./autogen.sh
  77. CFLAGS="$SLKCFLAGS" \
  78. CXXFLAGS="$SLKCFLAGS" \
  79. ./configure \
  80. --disable-Werror \
  81. --prefix=/usr \
  82. --libdir=/usr/lib$LIBDIRSUFFIX \
  83. --sysconfdir=/etc/paps \
  84. --mandir=/usr/man \
  85. --build=$ARCH-slackware-linux
  86. make
  87. make install-strip DESTDIR=$PKG
  88. gzip -9 $PKG/usr/man/man1/$PRGNAM.1
  89. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  90. cp -a AUTHORS COPYING.LIB ChangeLog NEWS $PKG/usr/doc/$PRGNAM-$VERSION/
  91. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  92. mkdir -p $PKG/install
  93. cat $CWD/slack-desc > $PKG/install/slack-desc
  94. cd $PKG
  95. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE