sl-fortune.SlackBuild 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #!/bin/bash
  2. # Slackware build for sl-fortune
  3. # Copyright 2021 David Ferrone RI, USA
  4. # All rights reserved.
  5. # Redistribution and use of this script, with or without modification, is
  6. # permitted provided that the following conditions are met:
  7. #
  8. # 1. Redistributions of this script 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 EXPRESS OR IMPLIED
  12. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  14. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  16. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  17. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  18. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  19. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  20. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  21. PRGNAM=sl-fortune
  22. VERSION=${VERSION:-0.1}
  23. BUILD=${BUILD:-1}
  24. TAG=${TAG:-_SBo}
  25. ARCH=noarch
  26. CWD=$(pwd)
  27. TMP=${TMP:-/tmp/SBo}
  28. PKG=$TMP/package-$PRGNAM
  29. OUTPUT=${OUTPUT:-/tmp}
  30. PKGTYPE=${PKGTYPE:-tgz}
  31. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  32. # the name of the created package would be, and then exit. This information
  33. # could be useful to other scripts.
  34. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  35. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  36. exit 0
  37. fi
  38. set -e
  39. rm -rf $PKG
  40. mkdir -p $TMP $PKG $OUTPUT
  41. cd $TMP
  42. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  43. chown -R root:root $PRGNAM
  44. mv $PRGNAM/* $PKG && rmdir $PRGNAM
  45. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  46. mkdir -p $PKG/install
  47. cat $CWD/slack-desc > $PKG/install/slack-desc
  48. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  49. cd $PKG
  50. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE