ncbi-blast-plus.SlackBuild 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. #!/bin/sh
  2. # Slackware build script for ncbi-blast-plus
  3. # Copyright 2013-2015 Petar Petrov, petar.petrov@student.oulu.fi
  4. # All rights reserved.
  5. #
  6. # Redistribution and use of this script, with or without modification, is
  7. # permitted provided that the following conditions are met:
  8. #
  9. # 1. Redistributions of this script must retain the above copyright
  10. # notice, this list of conditions and the following disclaimer.
  11. #
  12. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  13. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  15. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  17. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  18. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  19. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  20. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  21. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  22. PRGNAM=ncbi-blast-plus
  23. VERSION=${VERSION:-2.2.31}
  24. BUILD=${BUILD:-1}
  25. TAG=${TAG:-_SBo}
  26. SRCNAM=ncbi-blast
  27. SRCVER=2.2.31+
  28. if [ -z "$ARCH" ]; then
  29. case "$( uname -m )" in
  30. i?86) ARCH=i386 ;;
  31. arm*) ARCH=arm ;;
  32. *) ARCH=$( uname -m ) ;;
  33. esac
  34. fi
  35. CWD=$(pwd)
  36. TMP=${TMP:-/tmp/SBo}
  37. PKG=$TMP/package-$PRGNAM
  38. OUTPUT=${OUTPUT:-/tmp}
  39. set -e
  40. # Check for host architecture. Distribution of 32bit binaries has been
  41. # dropped from NCBI. For more information, please read:
  42. # http://www.ncbi.nlm.nih.gov/mailman/pipermail/blast-announce/2015q2/000112.html
  43. if [ "$ARCH" != "x86_64" ]; then
  44. printf "\n\n$ARCH is not supported... \n"
  45. exit 1
  46. fi
  47. # Determine the source arch
  48. if [ "$ARCH" = "x86_64" ]; then
  49. SRCARCH="x64"
  50. else
  51. SRCARCH="ia32"
  52. fi
  53. # Construct the tarball name
  54. TARNAME=$SRCNAM-$SRCVER-$SRCARCH-linux
  55. rm -rf $PKG
  56. mkdir -p $TMP $PKG $OUTPUT
  57. cd $TMP
  58. rm -rf $SRCNAM-$SRCVER
  59. tar xvf $CWD/$TARNAME.tar.gz
  60. cd $SRCNAM-$SRCVER
  61. chown -R root:root .
  62. find -L . \
  63. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  64. -o -perm 511 \) -exec chmod 755 {} \; -o \
  65. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  66. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  67. # Install the precompiled binaries.
  68. cd bin
  69. install -D -m755 blast_formatter $PKG/usr/bin/blast_formatter
  70. install -D -m755 blastdb_aliastool $PKG/usr/bin/blastdb_aliastool
  71. install -D -m755 blastdbcheck $PKG/usr/bin/blastdbcheck
  72. install -D -m755 blastdbcmd $PKG/usr/bin/blastdbcmd
  73. install -D -m755 blastn $PKG/usr/bin/blastn
  74. install -D -m755 blastp $PKG/usr/bin/blastp
  75. install -D -m755 blastx $PKG/usr/bin/blastx
  76. install -D -m755 convert2blastmask $PKG/usr/bin/convert2blastmask
  77. install -D -m755 deltablast $PKG/usr/bin/deltablast
  78. install -D -m755 dustmasker $PKG/usr/bin/dustmasker
  79. install -D -m755 legacy_blast.pl $PKG/usr/bin/legacy_blast.pl
  80. install -D -m755 makeblastdb $PKG/usr/bin/makeblastdb
  81. install -D -m755 makembindex $PKG/usr/bin/makembindex
  82. install -D -m755 makeprofiledb $PKG/usr/bin/makeprofiledb
  83. install -D -m755 psiblast $PKG/usr/bin/psiblast
  84. install -D -m755 rpsblast $PKG/usr/bin/rpsblast
  85. install -D -m755 rpstblastn $PKG/usr/bin/rpstblastn
  86. install -D -m755 segmasker $PKG/usr/bin/segmasker
  87. install -D -m755 tblastn $PKG/usr/bin/tblastn
  88. install -D -m755 tblastx $PKG/usr/bin/tblastx
  89. install -D -m755 update_blastdb.pl $PKG/usr/bin/update_blastdb.pl
  90. install -D -m755 windowmasker $PKG/usr/bin/windowmasker
  91. cd ..
  92. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  93. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  94. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  95. cp -a \
  96. ChangeLog LICENSE README doc/README.txt \
  97. $PKG/usr/doc/$PRGNAM-$VERSION
  98. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  99. mkdir -p $PKG/install
  100. cat $CWD/slack-desc > $PKG/install/slack-desc
  101. cd $PKG
  102. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}