power-architect.SlackBuild 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #!/bin/bash
  2. # Slackware build script for power-architect
  3. # Copyright (c) 2010-2013, Dhaby Xiloj <slack.dhabyx@gmail.com>
  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. # This script is just a binary repackaging.
  22. cd $(dirname $0) ; CWD=$(pwd)
  23. PRGNAM=power-architect
  24. VERSION=${VERSION:-1.0.6}
  25. ARCH=noarch
  26. BUILD=${BUILD:-1}
  27. TAG=${TAG:-_SBo}
  28. PKGTYPE=${PKGTYPE:-tgz}
  29. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  30. # the name of the created package would be, and then exit. This information
  31. # could be useful to other scripts.
  32. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  33. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  34. exit 0
  35. fi
  36. TMP=${TMP:-/tmp/SBo}
  37. PKG=$TMP/package-$PRGNAM
  38. OUTPUT=${OUTPUT:-/tmp}
  39. PKGNAM='SQL-Power-Architect-generic-jdbc'
  40. DOCS="LICENSE README.generic"
  41. set -e
  42. rm -rf $PKG
  43. mkdir -p $TMP $PKG $OUTPUT
  44. cd $TMP
  45. rm -rf architect-$VERSION
  46. tar xvf $CWD/$PKGNAM-$VERSION.tar.gz
  47. cd architect-$VERSION
  48. chown -R root:root .
  49. find -L . \
  50. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  51. -o -perm 511 \) -exec chmod 755 {} \; -o \
  52. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  53. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  54. mkdir -p $PKG/opt/$PRGNAM
  55. cp -R $TMP/architect-$VERSION/{architect.jar,jdbc,lib} $PKG/opt/$PRGNAM
  56. # Add a script to run power-architect in /usr/bin
  57. mkdir -p $PKG/usr/bin
  58. cat << EOF > $PKG/usr/bin/$PRGNAM
  59. #!/bin/sh
  60. cd /opt/$PRGNAM
  61. java -jar architect.jar
  62. EOF
  63. chmod 0755 $PKG/usr/bin/$PRGNAM
  64. # Putting everything in place
  65. mkdir -p $PKG/usr/share/applications/
  66. cp $CWD/$PRGNAM.desktop $PKG/usr/share/applications/
  67. mkdir -p $PKG/usr/share/pixmaps
  68. cp $CWD/$PRGNAM.png $PKG/usr/share/pixmaps
  69. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  70. cp -ar $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
  71. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  72. mkdir -p $PKG/install
  73. cat $CWD/slack-desc > $PKG/install/slack-desc
  74. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  75. cd $PKG
  76. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE