screenfetch.SlackBuild 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #!/bin/bash
  2. #
  3. # Slackware build script for Screenfetch.
  4. #
  5. # Copyright 2012-2017 Bojan Popovic, Belgrade, Serbia, <bocke@slackware-srbija.org>.
  6. # Copyright 2017-2020 Edinaldo P. Silva, Rio de Janeiro, Brazil.
  7. # Copyright Jefferson Rocha, Curitiba, Brazil.
  8. #
  9. # All rights reserved.
  10. #
  11. # Redistribution and use of this script, with or without modification, is
  12. # permitted provided that the following conditions are met:
  13. #
  14. # 1. Redistributions of this script must retain the above copyright
  15. # notice, this list of conditions and the following disclaimer.
  16. #
  17. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
  18. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  19. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  20. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  21. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  22. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  23. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  24. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  25. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  26. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27. #########################################################################
  28. # ChangeLog
  29. #
  30. # IMPORTANT: update this if you change this script!)
  31. #########################################################################
  32. #
  33. # 1.0 15-DEC-2012 Added (ver. 2.7.5)
  34. # 1.1 08-JUL-2013 Updated to a new upstream ver. 3.0.5. Fixes Slack64
  35. # detection.
  36. # 1.2 06-DEC-2013 Updated to a new upstream ver. 3.2.2.
  37. # 1.3 23-JUN-2014 Changed source URL (willysr).
  38. # 1.4 25-JUN-2014 Updated slack-desc (willysr).
  39. # 1.5 23-JUL-2014 Updated to a new upstream ver. 3.5.0.
  40. # 1.6 07-DEC-2014 Updated to a new upstream ver. 3.6.5
  41. # 1.7 30-JAN-2015 Added a source alternative (willysr).
  42. # 1.8 31-JAN-2015 Updated changelog. Synced changelog to git history.
  43. # Updated changelog formating. Updated tar extraction line
  44. # to eliminate (harmless but annoying) extraction errors.
  45. # 1.9 27-MAR-2017 Updated for version 3.8.0. Added a manpage.
  46. # 2.0 20-JUNE-2020 Updated to a new upstream ver. 3.9.1.
  47. # Added Double quotes in variables.
  48. cd $(dirname $0) ; CWD=$(pwd)
  49. PRGNAM="screenfetch"
  50. SRCNAM="screenFetch"
  51. VERSION="${VERSION:-3.9.1}"
  52. BUILD="${BUILD:-1}"
  53. TAG="${TAG:-_SBo}"
  54. PKGTYPE=${PKGTYPE:-tgz}
  55. ARCH="noarch"
  56. DOCS="CHANGELOG COPYING README.mkdn TODO"
  57. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  58. # the name of the created package would be, and then exit. This information
  59. # could be useful to other scripts.
  60. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  61. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  62. exit 0
  63. fi
  64. TMP="${TMP:-/tmp/SBo}"
  65. PKG="$TMP/package-$PRGNAM"
  66. OUTPUT="${OUTPUT:-/tmp}"
  67. set -e
  68. rm -rf "$PKG"
  69. mkdir -p "$TMP" "$PKG" "$OUTPUT"
  70. cd "$TMP"
  71. rm -rf "$PRGNAM-$VERSION"
  72. tar xvf "$CWD/$SRCNAM-$VERSION.tar.gz"
  73. mv "$SRCNAM-$VERSION" "$PRGNAM-$VERSION"
  74. cd "$PRGNAM-$VERSION"
  75. install -m 755 -D "$PRGNAM-dev" "$PKG/usr/bin/$PRGNAM"
  76. mkdir -p "$PKG/usr/man/man1"
  77. install -m 644 screenfetch.1 "$PKG/usr/man/man1"
  78. find $PKG/usr/man -type f -exec gzip -9 {} \;
  79. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  80. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  81. chmod 644 $DOCS; cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
  82. cat "$CWD/$PRGNAM.SlackBuild" > "$PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild"
  83. mkdir -p "$PKG/install"
  84. cat "$CWD/slack-desc" > "$PKG/install/slack-desc"
  85. cd "$PKG"
  86. /sbin/makepkg -l y -c n "$OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"