clustalx.SlackBuild 2.8 KB

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