isoelectric-point.SlackBuild 2.2 KB

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