portecle.SlackBuild 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #!/bin/bash
  2. # Slackware build script for portecle
  3. # Petr Kletecka petr@kle.cz <2018>
  4. cd $(dirname $0) ; CWD=$(pwd)
  5. PRGNAM=portecle
  6. VERSION=${VERSION:-1.11}
  7. BUILD=${BUILD:-1}
  8. TAG=${TAG:-_SBo}
  9. PKGTYPE=${PKGTYPE:-tgz}
  10. ARCH=noarch
  11. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  12. # the name of the created package would be, and then exit. This information
  13. # could be useful to other scripts.
  14. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  15. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  16. exit 0
  17. fi
  18. TMP=${TMP:-/tmp/SBo}
  19. PKG=$TMP/package-$PRGNAM
  20. OUTPUT=${OUTPUT:-/tmp}
  21. set -e
  22. rm -rf $PKG
  23. mkdir -p $TMP $PKG $OUTPUT
  24. cd $TMP
  25. rm -rf $PRGNAM-$VERSION
  26. unzip $CWD/$PRGNAM-$VERSION.zip
  27. cd $PRGNAM-$VERSION
  28. chown -R root:root .
  29. find -L . \
  30. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  31. -o -perm 511 \) -exec chmod 755 {} \; -o \
  32. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  33. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  34. mkdir -p $PKG/usr/share/applications
  35. mv net.sf.portecle.desktop $PKG/usr/share/applications/
  36. mkdir -p $PKG/usr/share/pixmaps
  37. mv icons/64x64/portecle.png $PKG/usr/share/pixmaps/
  38. mkdir -p $PKG/usr/bin
  39. cat $CWD/portecle > $PKG/usr/bin/portecle
  40. chmod oug+x $PKG/usr/bin/portecle
  41. mkdir -p $PKG/usr/share/$PRGNAM
  42. cp -a * $PKG/usr/share/$PRGNAM
  43. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  44. cp -a *.txt $PKG/usr/doc/$PRGNAM-$VERSION
  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