jUploadr.SlackBuild 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #!/bin/bash
  2. # Slackware build script for jUploadr
  3. # Michales - clavisound - Michaloudes korgie@gmail.com <2012>
  4. cd $(dirname $0) ; CWD=$(pwd)
  5. PRGNAM=jUploadr
  6. VERSION=${VERSION:-1.1.2}
  7. BUILD=${BUILD:-1}
  8. TAG=${TAG:-_SBo}
  9. PKGTYPE=${PKGTYPE:-tgz}
  10. if [ -z "$ARCH" ]; then
  11. case "$( uname -m )" in
  12. i?86) ARCH=i586 ;;
  13. arm*) ARCH=arm ;;
  14. *) ARCH=$( uname -m ) ;;
  15. esac
  16. fi
  17. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  18. # the name of the created package would be, and then exit. This information
  19. # could be useful to other scripts.
  20. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  21. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  22. exit 0
  23. fi
  24. TMP=${TMP:-/tmp/SBo}
  25. PKG=$TMP/package-$PRGNAM
  26. OUTPUT=${OUTPUT:-/tmp}
  27. if [ "$ARCH" = "i586" ]; then
  28. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  29. LIBDIRSUFFIX=""
  30. SRCARCH=i386
  31. elif [ "$ARCH" = "i686" ]; then
  32. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  33. LIBDIRSUFFIX=""
  34. SRCARCH=i386
  35. elif [ "$ARCH" = "x86_64" ]; then
  36. SLKCFLAGS="-O2 -fPIC"
  37. LIBDIRSUFFIX="64"
  38. SRCARCH=amd64
  39. else
  40. SLKCFLAGS="-O2"
  41. LIBDIRSUFFIX=""
  42. SRCARCH=i386
  43. fi
  44. set -e
  45. rm -rf $PKG
  46. mkdir -p $TMP $PKG $OUTPUT
  47. cd $TMP
  48. rm -rf $PRGNAM-$VERSION
  49. tar xvf $CWD/$PRGNAM-$VERSION-linuxGTK-$SRCARCH.tar.gz
  50. mv $PRGNAM-$VERSION-linuxGTK-$SRCARCH $PRGNAM-$VERSION
  51. cd $PRGNAM-$VERSION
  52. chown -R root:root .
  53. find -L . \
  54. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  55. -exec chmod 755 {} \; -o \
  56. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  57. -exec chmod 644 {} \;
  58. mkdir -p $PKG/usr/bin
  59. ln -s /opt/$PRGNAM/jUploadr $PKG/usr/bin
  60. mkdir -p $PKG/opt/$PRGNAM
  61. cp -a jUploadr plugins lib $PKG/opt/$PRGNAM
  62. mkdir -p $PKG/usr/share/applications
  63. cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
  64. mkdir -p $PKG/usr/share/pixmaps
  65. cat juploadr_icon.png > $PKG/usr/share/pixmaps/juploadr.png
  66. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  67. cp -a CHANGES README $PKG/usr/doc/$PRGNAM-$VERSION
  68. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  69. mkdir -p $PKG/install
  70. cat $CWD/slack-desc > $PKG/install/slack-desc
  71. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  72. cd $PKG
  73. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE