vuescan.SlackBuild 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. #!/bin/bash
  2. # Slackware build script for vuescan
  3. # Copyright 2013-2017 Heiko Rosemann, Germany
  4. # Copyright 2019-2022 Andrew Clemons, Wellington, New Zealand
  5. # All rights reserved.
  6. #
  7. # Redistribution and use of this script, with or without modification, is
  8. # permitted provided that the following conditions are met:
  9. #
  10. # 1. Redistributions of this script must retain the above copyright
  11. # notice, this list of conditions and the following disclaimer.
  12. #
  13. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  14. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  15. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  16. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  18. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  19. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  20. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  21. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  22. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  23. cd $(dirname $0) ; CWD=$(pwd)
  24. PRGNAM=vuescan
  25. VERSION=${VERSION:-9.7.85}
  26. SRCVER=${SRCVER:-$(echo "$VERSION" | cut -d. -f-2 | sed 's/\.//g')}
  27. BUILD=${BUILD:-1}
  28. TAG=${TAG:-_SBo}
  29. PKGTYPE=${PKGTYPE:-tgz}
  30. ARCH=${ARCH:-$(uname -m)}
  31. case $ARCH in
  32. i?86)
  33. SOURCEFILE=vuex32$SRCVER.tgz
  34. if [ ! -e "$CWD/$SOURCEFILE" ] ; then
  35. SOURCEFILE=vuex32-$VERSION.tgz
  36. fi
  37. ;;
  38. x86_64)
  39. SOURCEFILE=vuex64$SRCVER.tgz
  40. if [ ! -e "$CWD/$SOURCEFILE" ] ; then
  41. SOURCEFILE=vuex64-$VERSION.tgz
  42. fi
  43. ;;
  44. *)
  45. echo "ARCH $ARCH is unsupported."; exit 1 ;;
  46. esac
  47. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  48. # the name of the created package would be, and then exit. This information
  49. # could be useful to other scripts.
  50. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  51. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  52. exit 0
  53. fi
  54. TMP=${TMP:-/tmp/SBo}
  55. PKG=$TMP/package-$PRGNAM
  56. OUTPUT=${OUTPUT:-/tmp}
  57. set -e
  58. rm -rf $PKG
  59. mkdir -p $TMP $PKG $OUTPUT
  60. cd $TMP
  61. rm -rf $PRGNAM-$VERSION
  62. mkdir -p $PRGNAM-$VERSION
  63. cd $PRGNAM-$VERSION
  64. tar xvf $CWD/$SOURCEFILE
  65. chown -R root:root .
  66. find -L . \
  67. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  68. -exec chmod 755 {} \; -o \
  69. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  70. -exec chmod 644 {} \;
  71. # Program does not need compiling, is a binary program
  72. # Program does not provide any means of installing, so install it by hand to /opt
  73. mkdir -p $PKG/opt/$PRGNAM
  74. cp -a VueScan/* $PKG/opt/$PRGNAM
  75. # Create a script in /usr/bin to call the program
  76. mkdir -p $PKG/usr/bin
  77. echo "#!/bin/sh" > $PKG/usr/bin/$PRGNAM
  78. echo "cd /opt/$PRGNAM" >> $PKG/usr/bin/$PRGNAM
  79. echo "./$PRGNAM" >> $PKG/usr/bin/$PRGNAM
  80. chmod +x $PKG/usr/bin/$PRGNAM
  81. # Include the SlackBuild script in the documentation directory
  82. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  83. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  84. # Copy the slack-desc into ./install
  85. mkdir -p $PKG/install
  86. cat $CWD/slack-desc > $PKG/install/slack-desc
  87. cd $PKG
  88. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE