gp2fasta.SlackBuild 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #!/bin/sh
  2. # Slackware build script for gp2fasta
  3. # Written by Petar Petrov, <ppetrov@paju.oulu.fi> and
  4. # hereby submitted to the public domain
  5. # The icon used by the gp2fasta.desktop file is taken from
  6. # http://kde-look.org/content/show.php/Fasta+icons?content=54012
  7. # Author is Luis-Miguel Rodriguez. Thank you!
  8. # THIS SLACKBUILD IS DISTRIBUTETD IN THE HOPE OF BEING
  9. # USEFUL BUT WITHOUT ANY WARRANTY. THE AUTHOR IS _NOT_
  10. # RESPONSIBLE FOR ANY DAMAGE OR DATA LOSS CAUSED BY IT.
  11. PRGNAM=gp2fasta
  12. VERSION=${VERSION:-0.2}
  13. BUILD=${BUILD:-1}
  14. TAG=${TAG:-_SBo}
  15. if [ -z "$ARCH" ]; then
  16. case "$( uname -m )" in
  17. i?86) ARCH=i486 ;;
  18. arm*) ARCH=arm ;;
  19. *) ARCH=$( uname -m ) ;;
  20. esac
  21. fi
  22. CWD=$(pwd)
  23. TMP=${TMP:-/tmp/SBo}
  24. PKG=$TMP/package-$PRGNAM
  25. OUTPUT=${OUTPUT:-/tmp}
  26. if [ "$ARCH" = "i486" ]; then
  27. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  28. LIBDIRSUFFIX=""
  29. elif [ "$ARCH" = "i686" ]; then
  30. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  31. LIBDIRSUFFIX=""
  32. elif [ "$ARCH" = "x86_64" ]; then
  33. SLKCFLAGS="-O2 -fPIC"
  34. LIBDIRSUFFIX="64"
  35. else
  36. SLKCFLAGS="-O2"
  37. LIBDIRSUFFIX=""
  38. fi
  39. set -e
  40. rm -rf $PKG
  41. mkdir -p $TMP $PKG $OUTPUT
  42. cd $TMP
  43. rm -rf $PRGNAM
  44. unzip $CWD/$PRGNAM.zip
  45. cd $PRGNAM
  46. # Remove the precompiled binary just in case
  47. rm gp2fasta
  48. chown -R root:root .
  49. find -L . \
  50. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  51. -exec chmod 755 {} \; -o \
  52. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  53. -exec chmod 644 {} \;
  54. qmake -project
  55. qmake
  56. # Use our CFLAGS
  57. sed -i "/^C.*.*FLAGS/s/=/+=/" Makefile
  58. CFLAGS="$SLKCFLAGS" \
  59. CXXFLAGS="$SLKCFLAGS" \
  60. make
  61. install -D -m755 gp2fasta $PKG/usr/bin/gp2fasta
  62. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  63. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  64. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  65. cp -a \
  66. example.gp README \
  67. $PKG/usr/doc/$PRGNAM-$VERSION
  68. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  69. # Menu item and icon
  70. mkdir -p $PKG/usr/share/{applications,pixmaps}
  71. cp $CWD/$PRGNAM.desktop $PKG/usr/share/applications/
  72. cp $CWD/$PRGNAM.png $PKG/usr/share/pixmaps/
  73. mkdir -p $PKG/install
  74. cat $CWD/slack-desc > $PKG/install/slack-desc
  75. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  76. cd $PKG
  77. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}