pinfo.SlackBuild 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. #!/bin/bash
  2. # Slackware build script for pinfo
  3. # Copyright 2009 Arun Prasannan - <URL removed>
  4. # All rights reserved.
  5. #
  6. # Now maintained by B. Watson <urchlay@slackware.uk>.
  7. #
  8. # Redistribution and use of this script, with or without modification, is
  9. # permitted provided that the following conditions are met:
  10. #
  11. # 1. Redistributions of this script must retain the above copyright
  12. # notice, this list of conditions and the following disclaimer.
  13. #
  14. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
  15. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  16. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  17. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  18. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  19. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  20. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  21. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  22. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  23. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24. # 20200708 bkw: BUILD=2
  25. # - restore old 'pman' link (nothing conflicts)
  26. # - fix homepage in slack-desc
  27. # 20191221 bkw:
  28. # - take over maintenance.
  29. # - upgrade for v0.6.13... though if you really need to, you can still
  30. # build 0.6.9 or 0.6.10 by setting VERSION in the environment.
  31. # - pinfo development moved to github, change homepage.
  32. # - add info dir entry in doinst.sh.
  33. cd $(dirname $0) ; CWD=$(pwd)
  34. PRGNAM=pinfo
  35. VERSION=${VERSION:-0.6.13}
  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.[bg]z* # allow old .bz2 and new .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. patch -p1 < $CWD/gcc10-stringop.diff
  77. patch -p1 < $CWD/ncurses-6.3.diff
  78. [ -e configure ] || sh autogen.sh
  79. CFLAGS="$SLKCFLAGS -fcommon" \
  80. CXXFLAGS="$SLKCFLAGS" \
  81. ./configure \
  82. --prefix=/usr \
  83. --libdir=/usr/lib${LIBDIRSUFFIX} \
  84. --sysconfdir=/etc \
  85. --localstatedir=/var \
  86. --disable-static \
  87. --mandir=/usr/man \
  88. --infodir=/usr/info \
  89. --build=$ARCH-slackware-linux
  90. make
  91. make install-strip DESTDIR=$PKG
  92. gzip -9 $PKG/usr/info/$PRGNAM.info $PKG/usr/man/man1/$PRGNAM.1
  93. rm -f $PKG/usr/info/dir
  94. # Let's not clobber the config file
  95. mv $PKG/etc/pinforc $PKG/etc/pinforc.new
  96. # Upstream removed this as it conflicted with something on his system.
  97. # It doesn't conflict with ours.
  98. ln -s $PRGNAM $PKG/usr/bin/pman
  99. ln -s $PRGNAM.1.gz $PKG/usr/man/man1/pman.1.gz
  100. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  101. cp -a AUTHORS Change[lL]og* COPYING NEWS README* TECHSTUFF \
  102. $PKG/usr/doc/$PRGNAM-$VERSION
  103. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  104. mkdir -p $PKG/install
  105. cat $CWD/slack-desc > $PKG/install/slack-desc
  106. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  107. cd $PKG
  108. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE