bigloo.SlackBuild 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. #!/bin/bash
  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. cd $(dirname $0) ; CWD=$(pwd)
  21. PRGNAM=bigloo
  22. VERSION=${VERSION:-4.3f}
  23. SRCVER=$(echo $VERSION | tr _ -)
  24. BUILD=${BUILD:-1}
  25. TAG=${TAG:-_SBo}
  26. PKGTYPE=${PKGTYPE:-tgz}
  27. if [ -z "$ARCH" ]; then
  28. case "$(uname -m)" in
  29. i?86) ARCH=i586 ;;
  30. arm*) ARCH=arm ;;
  31. *) ARCH=$(uname -m) ;;
  32. esac
  33. fi
  34. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  35. # the name of the created package would be, and then exit. This information
  36. # could be useful to other scripts.
  37. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  38. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  39. exit 0
  40. fi
  41. TMP=${TMP:-/tmp/SBo}
  42. PKG=$TMP/package-$PRGNAM
  43. OUTPUT=${OUTPUT:-/tmp}
  44. if [ "$ARCH" = "i586" ]; then
  45. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  46. LIBDIRSUFFIX=""
  47. elif [ "$ARCH" = "i686" ]; then
  48. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  49. LIBDIRSUFFIX=""
  50. elif [ "$ARCH" = "x86_64" ]; then
  51. SLKCFLAGS="-O2 -fPIC"
  52. LIBDIRSUFFIX="64"
  53. else
  54. SLKCFLAGS="-O2"
  55. LIBDIRSUFFIX=""
  56. fi
  57. set -e
  58. rm -rf $PKG
  59. mkdir -p $TMP $PKG $OUTPUT
  60. cd $TMP
  61. rm -rf $PRGNAM$SRCVER
  62. tar xvf $CWD/$PRGNAM$SRCVER.tar.gz
  63. cd $PRGNAM$SRCVER
  64. chown -R root:root .
  65. find -L . \
  66. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  67. -o -perm 511 \) -exec chmod 755 {} \; -o \
  68. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  69. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  70. # fix canonical system name detected during configuration
  71. # e.g. x86_64-unknown-linux-gnu -> x86_64-slackware-linux-gnu
  72. sed -ri '/^(build|host)=/ s/`$/ | sed "s:-unknown-:-slackware-:"` /' \
  73. autoconf/gcconfigureopt
  74. CFLAGS="$SLKCFLAGS" \
  75. CXXFLAGS="$SLKCFLAGS" \
  76. ./configure \
  77. --prefix=/usr \
  78. --docdir=/usr/doc/$PRGNAM-$VERSION \
  79. --libdir=/usr/lib$LIBDIRSUFFIX \
  80. --mandir=/usr/man/man1 \
  81. --infodir=/usr/info \
  82. --sharedcompiler=yes \
  83. --sharedbde=yes
  84. make
  85. make install DESTDIR=$PKG
  86. find $PKG -print0 | xargs -0 file \
  87. | grep -e "executable" -e "shared object" | grep ELF \
  88. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null \
  89. || true
  90. rm -f $PKG/usr/info/dir
  91. find $PKG/usr/info -type f -exec gzip -9 {} \;
  92. find $PKG/usr/man -type f -exec gzip -9 {} \;
  93. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  94. cp COPYING ChangeLog INSTALL.jvm LICENSE \
  95. $PKG/usr/doc/$PRGNAM-$VERSION
  96. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  97. mkdir -p $PKG/install
  98. cat $CWD/slack-desc > $PKG/install/slack-desc
  99. cd $PKG
  100. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE