bigloo.SlackBuild 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. #!/bin/sh
  2. # Slackware build script for bigloo
  3. # Originally by Jockey S. Kyd (jockey dot kyd at gmail dot com)
  4. # Modified by Ryan P.C. McQuen, WA, ryanpcmcquen@member.fsf.org
  5. # This program is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 2 of the License, or
  8. # (at your option) any later version, with the following exception:
  9. # the text of the GPL license may be omitted..
  10. # This program is distributed in the hope that it will be useful, but
  11. # without any warranty; without even the implied warranty of
  12. # merchantability or fitness for a particular purpose. Compiling,
  13. # interpreting, executing or merely reading the text of the program
  14. # may result in lapses of consciousness and/or very being, up to and
  15. # including the end of all existence and the Universe as we know it.
  16. # See the GNU General Public License for more details.
  17. # You may have received a copy of the GNU General Public License
  18. # along with this program (most likely, a file named COPYING). If
  19. # not, see <http://www.gnu.org/licenses/>.
  20. PRGNAM=bigloo
  21. VERSION=${VERSION:-4.1a_2}
  22. SRCVER=$(echo $VERSION | tr _ -)
  23. BUILD=${BUILD:-1}
  24. TAG=${TAG:-_SBo}
  25. if [ -z "$ARCH" ]; then
  26. case "$(uname -m)" in
  27. i?86) ARCH=i486 ;;
  28. arm*) ARCH=arm ;;
  29. *) ARCH=$(uname -m) ;;
  30. esac
  31. fi
  32. CWD=$(pwd)
  33. TMP=${TMP:-/tmp/SBo}
  34. PKG=$TMP/package-$PRGNAM
  35. OUTPUT=${OUTPUT:-/tmp}
  36. if [ "$ARCH" = "i486" ]; then
  37. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  38. LIBDIRSUFFIX=""
  39. elif [ "$ARCH" = "i686" ]; then
  40. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  41. LIBDIRSUFFIX=""
  42. elif [ "$ARCH" = "x86_64" ]; then
  43. SLKCFLAGS="-O2 -fPIC"
  44. LIBDIRSUFFIX="64"
  45. else
  46. SLKCFLAGS="-O2"
  47. LIBDIRSUFFIX=""
  48. fi
  49. set -e
  50. rm -rf $PKG
  51. mkdir -p $TMP $PKG $OUTPUT
  52. cd $TMP
  53. rm -rf $PRGNAM$SRCVER
  54. tar xvf $CWD/$PRGNAM$SRCVER.tar.gz
  55. cd $PRGNAM$SRCVER
  56. chown -R root:root .
  57. find -L . \
  58. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  59. -o -perm 511 \) -exec chmod 755 {} \; -o \
  60. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  61. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  62. # fix canonical system name detected during configuration
  63. # e.g. x86_64-unknown-linux-gnu -> x86_64-slackware-linux-gnu
  64. sed -ri '/^(build|host)=/ s/`$/ | sed "s:-unknown-:-slackware-:"` /' \
  65. autoconf/gcconfigureopt
  66. CFLAGS="$SLKCFLAGS" \
  67. CXXFLAGS="$SLKCFLAGS" \
  68. ./configure \
  69. --prefix=/usr \
  70. --docdir=/usr/doc/$PRGNAM-$VERSION \
  71. --libdir=/usr/lib$LIBDIRSUFFIX \
  72. --mandir=/usr/man/man1 \
  73. --infodir=/usr/info \
  74. --sharedcompiler=yes \
  75. --sharedbde=yes
  76. make
  77. make install DESTDIR=$PKG
  78. find $PKG -print0 | xargs -0 file \
  79. | grep -e "executable" -e "shared object" | grep ELF \
  80. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null \
  81. || true
  82. rm -f $PKG/usr/info/dir
  83. find $PKG/usr/info -type f -exec gzip -9 {} \;
  84. find $PKG/usr/man -type f -exec gzip -9 {} \;
  85. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  86. cp COPYING ChangeLog INSTALL INSTALL.jvm LICENSE README \
  87. $PKG/usr/doc/$PRGNAM-$VERSION
  88. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  89. mkdir -p $PKG/install
  90. cat $CWD/slack-desc > $PKG/install/slack-desc
  91. cd $PKG
  92. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}