liquibase.SlackBuild 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #!/bin/bash
  2. # Slackware build script for liquibase
  3. # Copyright (c) 2017 Alan Alberghini <414N@slacky.it>
  4. # All rights reserved.
  5. #
  6. # Permission to use, copy, modify, and distribute this software for
  7. # any purpose with or without fee is hereby granted, provided that
  8. # the above copyright notice and this permission notice appear in all
  9. # copies.
  10. #
  11. # THIS SOFTWARE IS PROVIDED AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. # IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. # USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. # SUCH DAMAGE.
  23. # -----------------------------------------------------------------------------
  24. #
  25. # Build history:
  26. #
  27. # 1 - Initial release.
  28. cd $(dirname $0) ; CWD=$(pwd)
  29. PRGNAM=liquibase
  30. VERSION=${VERSION:-3.5.3}
  31. BUILD=${BUILD:-1}
  32. TAG=${TAG:-_SBo}
  33. PKGTYPE=${PKGTYPE:-tgz}
  34. ARCH=noarch
  35. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  36. # the name of the created package would be, and then exit. This information
  37. # could be useful to other scripts.
  38. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  39. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  40. exit 0
  41. fi
  42. TMP=${TMP:-/tmp/SBo}
  43. PKG=$TMP/package-$PRGNAM
  44. OUTPUT=${OUTPUT:-/tmp}
  45. DOCS="README.txt LICENSE.txt"
  46. set -e
  47. rm -rf $PKG
  48. mkdir -p $TMP $PKG $OUTPUT
  49. DESTDIR=$PKG/opt/$PRGNAM
  50. mkdir -p $DESTDIR
  51. cd $DESTDIR
  52. tar xvf $CWD/${PRGNAM}-${VERSION}-bin.tar.gz
  53. chown -R root:root .
  54. find -L . \
  55. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  56. -o -perm 511 \) -exec chmod 755 {} \; -o \
  57. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  58. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  59. find . -type f -name \*.bat -delete
  60. mkdir -p $PKG/etc/profile.d
  61. install -m0755 $CWD/profile.d/* $PKG/etc/profile.d
  62. mkdir -p $PKG/usr/bin
  63. ln -sf /opt/$PRGNAM/$PRGNAM $PKG/usr/bin/$PRGNAM
  64. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  65. cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
  66. ln -sf /opt/$PRGNAM/sdk $PKG/usr/doc/$PRGNAM-$VERSION/
  67. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  68. mkdir -p $PKG/install
  69. cat $CWD/slack-desc > $PKG/install/slack-desc
  70. cd $PKG
  71. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE