ebe.SlackBuild 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. #!/bin/bash
  2. # Generated by Alien's SlackBuild Toolkit: http://slackware.com/~alien/AST
  3. # Copyright 2009, 2010, 2011, 2012, 2013, 2014 Eric Hameleers, Eindhoven, Netherlands
  4. # Slackware build script for ebe
  5. # Ryan P.C. McQuen | Everett, WA | ryanpcmcquen@member.fsf.org
  6. # 2017 | Dhaby Xiloj | slack.dhabyx@gmail.com
  7. # Copyright 2014 Thorn Inurcide USA
  8. # All rights reserved.
  9. #
  10. # Redistribution and use of this script, with or without modification, is
  11. # permitted provided that the following conditions are met:
  12. #
  13. # 1. Redistributions of this script must retain the above copyright
  14. # notice, this list of conditions and the following disclaimer.
  15. #
  16. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  17. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  18. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  19. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  20. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  21. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  22. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  23. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  24. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  25. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. cd $(dirname $0) ; CWD=$(pwd)
  27. PRGNAM=ebe
  28. VERSION=${VERSION:-3.0.10}
  29. BUILD=${BUILD:-1}
  30. TAG=${TAG:-_SBo}
  31. PKGTYPE=${PKGTYPE:-tgz}
  32. if [ -z "$ARCH" ]; then
  33. case "$( uname -m )" in
  34. i?86) export ARCH=i586 ;;
  35. arm*) export ARCH=arm ;;
  36. *) export ARCH=$( uname -m ) ;;
  37. esac
  38. fi
  39. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  40. # the name of the created package would be, and then exit. This information
  41. # could be useful to other scripts.
  42. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  43. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  44. exit 0
  45. fi
  46. TMP=${TMP:-/tmp/SBo}
  47. PKG=$TMP/package-$PRGNAM
  48. OUTPUT=${OUTPUT:-/tmp}
  49. if [ "$ARCH" = "i586" ]; then
  50. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  51. LIBDIRSUFFIX=""
  52. elif [ "$ARCH" = "i686" ]; then
  53. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  54. LIBDIRSUFFIX=""
  55. elif [ "$ARCH" = "x86_64" ]; then
  56. SLKCFLAGS="-O2 -fPIC"
  57. LIBDIRSUFFIX="64"
  58. else
  59. SLKCFLAGS="-O2"
  60. LIBDIRSUFFIX=""
  61. fi
  62. set -e
  63. rm -rf $PKG
  64. mkdir -p $TMP $PKG $OUTPUT
  65. cd $TMP
  66. rm -rf $PRGNAM
  67. mkdir -p $PRGNAM
  68. cd $PRGNAM
  69. tar xvf $CWD/$PRGNAM\_src.tgz
  70. chown -R root:root .
  71. find -L . \
  72. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  73. -o -perm 511 \) -exec chmod 755 {} \; -o \
  74. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  75. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  76. ./qrc
  77. qmake QMAKE_CFLAGS="$SLKCFLAGS" QMAKE_CXXFLAGS="$SLKCFLAGS"
  78. make
  79. mkdir -p $PKG/opt/$PRGNAM-$VERSION
  80. install -m0755 $PRGNAM $PKG/opt/$PRGNAM-$VERSION
  81. install -m0644 *.qm $PKG/opt/$PRGNAM-$VERSION
  82. mkdir -p $PKG/usr/share/icons/hicolor/64x64/apps
  83. install -m0644 -C images/${PRGNAM}64.png $PKG/usr/share/icons/hicolor/64x64/apps
  84. mkdir -p $PKG/usr/share/applications
  85. cp $CWD/${PRGNAM}.desktop $PKG/usr/share/applications
  86. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" \
  87. | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  88. #Symlink the binary to /usr/bin
  89. mkdir -p $PKG/usr/bin
  90. ln -sf /opt/${PRGNAM}-${VERSION}/${PRGNAM} $PKG/usr/bin/
  91. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  92. cp -a LICENSE README $PKG/usr/doc/$PRGNAM-$VERSION
  93. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  94. mkdir -p $PKG/install
  95. cat $CWD/slack-desc > $PKG/install/slack-desc
  96. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  97. cd $PKG
  98. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE