Archi.SlackBuild 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #!/bin/bash
  2. #
  3. # Slackware build script for Archi
  4. # Written by Joielechong (juansspy@gmail.com)
  5. # This script is just a binary repackaging.
  6. cd $(dirname $0) ; CWD=$(pwd)
  7. PRGNAM=Archi
  8. ARCNAM=Archi-Linux64
  9. VERSION=${VERSION:-4.10.0}
  10. BUILD=${BUILD:-1}
  11. TAG=${TAG:-_SBo}
  12. PKGTYPE=${PKGTYPE:-tgz}
  13. ARCH=${ARCH:-x86_64}
  14. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  15. # the name of the created package would be, and then exit. This information
  16. # could be useful to other scripts.
  17. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  18. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  19. exit 0
  20. fi
  21. TMP=${TMP:-/tmp/SBo}
  22. PKG=$TMP/package-$PRGNAM
  23. OUTPUT=${OUTPUT:-/tmp}
  24. set -e
  25. rm -rf $PKG
  26. mkdir -p $TMP $PKG/opt/ $OUTPUT
  27. cd $PKG/opt/
  28. tar xvf $CWD/$ARCNAM-$VERSION.tgz
  29. chown -R root:root .
  30. find -L . \
  31. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  32. -o -perm 511 \) -exec chmod 755 {} \; -o \
  33. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  34. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  35. mkdir -p $PKG/usr/share/applications
  36. cat << EOF > $PKG/usr/share/applications/$PRGNAM.desktop
  37. [Desktop Entry]
  38. Version=1.0
  39. Type=Application
  40. Path=/opt/$PRGNAM
  41. Exec=/opt/$PRGNAM/$PRGNAM %f
  42. Name=Archimate Modelling
  43. GenericName=Archi
  44. Comment=
  45. Icon=/opt/$PRGNAM/icon.xpm
  46. StartupNotify=true
  47. Categories=Development;IDE;
  48. Terminal=false
  49. EOF
  50. install -D -m 0644 $PKG/opt/$PRGNAM/icon.xpm \
  51. $PKG/usr/share/pixmaps/$PRGNAM.xpm
  52. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  53. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  54. mkdir -p $PKG/install
  55. cat $CWD/slack-desc > $PKG/install/slack-desc
  56. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  57. cd $PKG
  58. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE