gauche.SlackBuild 3.4 KB

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