podget.SlackBuild 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #!/bin/bash
  2. # Slackware build script for podget
  3. # Copyright (c) 2008-2010, Antonio Hernández Blas <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. # 20211126 bkw: update for v0.8.10
  22. # 20210223 bkw: update for v0.8.8
  23. # 20201103 bkw:
  24. # - update for v0.8.7
  25. # - fix CRLF removal
  26. # - redo README and slack-desc
  27. # 20200619 bkw: BUILD=2, apparently nobody (including me) ever noticed
  28. # that v0.8.6 didn't actually work on Slackware 14.2.
  29. # 20191130 bkw: update for v0.8.6
  30. # 20170712 bkw:
  31. # - Take over as maintainer
  32. # - Update for v0.8.5
  33. # - Get rid of CRLF line endings in a couple of the scripts
  34. # - Minor cleanups
  35. cd $(dirname $0) ; CWD=$(pwd)
  36. PRGNAM=podget
  37. VERSION=${VERSION:-0.8.10}
  38. BUILD=${BUILD:-1}
  39. TAG=${TAG:-_SBo}
  40. PKGTYPE=${PKGTYPE:-tgz}
  41. ARCH=noarch
  42. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  43. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  44. exit 0
  45. fi
  46. TMP=${TMP:-/tmp/SBo}
  47. PKG=$TMP/package-$PRGNAM
  48. OUTPUT=${OUTPUT:-/tmp}
  49. set -e
  50. rm -rf $PKG
  51. mkdir -p $TMP $PKG $OUTPUT
  52. cd $TMP
  53. rm -rf $PRGNAM-$VERSION
  54. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  55. cd $PRGNAM-$VERSION
  56. chown -R root:root .
  57. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  58. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  59. # 20170712 bkw: get rid of DOS/Win line endings.
  60. # 20201103 bkw: turns out there's an embedded \r in podget that's
  61. # supposed to be there, so the regex becomes \r$ instead of \r.
  62. find . -type f | \
  63. xargs file | \
  64. grep 'ASCII.*CR' | \
  65. cut -d: -f1 | \
  66. xargs sed -i 's,\r$,,' \
  67. || true
  68. # 20201103 bkw: change hardcoded paths
  69. sed -i \
  70. -e "s,share/man,man,g" \
  71. -e "s,share/doc/$PRGNAM,doc/$PRGNAM-$VERSION," \
  72. Makefile
  73. make -j1 prefix=/usr DESTDIR=$PKG install
  74. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/scripts
  75. cp -a COPYING README $PKG/usr/doc/$PRGNAM-$VERSION
  76. cp -r SCRIPTS/* $PKG/usr/doc/$PRGNAM-$VERSION/scripts
  77. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  78. mkdir -p $PKG/install
  79. cat $CWD/slack-desc > $PKG/install/slack-desc
  80. cd $PKG
  81. /sbin/makepkg -l y -c n -p $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE