2010-04-16 04:50:22 +02:00
|
|
|
#!/bin/sh -x
|
|
|
|
|
|
|
|
# variables
|
|
|
|
CWD=$(pwd)
|
|
|
|
|
2011-02-17 05:19:56 +01:00
|
|
|
PRGNAM=$(basename $CWD)
|
2010-04-16 04:50:22 +02:00
|
|
|
VERSION=4.6.0
|
|
|
|
ARCH=$(uname -m)
|
|
|
|
BUILD=1
|
|
|
|
|
2011-02-17 05:54:04 +01:00
|
|
|
|
|
|
|
TAG=cyco
|
|
|
|
TMP=/tmp/$TAG
|
2011-02-17 05:19:56 +01:00
|
|
|
PKG=$TMP/pkg-$PRGNAM
|
2010-04-16 04:50:22 +02:00
|
|
|
OUTPUT=/tmp
|
|
|
|
|
|
|
|
PREFIX=/usr
|
|
|
|
DOCS="ABOUT-NLS AUTHORS ChangeLog COPYING* INSTALL NEWS README THANKS TODO"
|
|
|
|
|
|
|
|
SLCKFLAGS="-O2"
|
|
|
|
case $ARCH in
|
|
|
|
"x86_64")
|
|
|
|
SLCKFLAGS="$SLCKFLAGS -fPIC"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
esac
|
|
|
|
|
|
|
|
# nettoyage préalable
|
2011-02-17 05:19:56 +01:00
|
|
|
rm -fr $PKG $TMP/$PRGNAM-$VERSION
|
2010-04-16 04:50:22 +02:00
|
|
|
|
|
|
|
mkdir -p $PKG
|
|
|
|
|
|
|
|
# mise en place
|
|
|
|
( cd $TMP
|
|
|
|
TMPVER=v$(echo $VERSION | tr . _)
|
|
|
|
[ ! -e $CWD/gambc-$TMPVER-devel.tgz ] && \
|
|
|
|
wget -c http://www.iro.umontreal.ca/~gambit/download/gambit/v4.6/source/gambc-$TMPVER-devel.tgz \
|
|
|
|
-O $CWD/gambc-$TMPVER-devel.tgz
|
|
|
|
tar xf $CWD/gambc-$TMPVER-devel.tgz
|
2011-02-17 05:19:56 +01:00
|
|
|
mv gambc-$TMPVER-devel $PRGNAM-$VERSION
|
2010-04-16 04:50:22 +02:00
|
|
|
)
|
|
|
|
|
2011-02-17 05:19:56 +01:00
|
|
|
( cd $TMP/$PRGNAM-$VERSION
|
2010-04-16 04:50:22 +02:00
|
|
|
# configuration
|
|
|
|
CCPFLAGS=$SLCKFLAGS \
|
|
|
|
CFLAGS=$SLCKFLAGS \
|
|
|
|
./configure \
|
|
|
|
--prefix=$PREFIX \
|
|
|
|
--mandir=$PREFIX/man \
|
|
|
|
--infodir=$PREFIX/info \
|
2011-02-17 05:19:56 +01:00
|
|
|
--docdir=$PREFIX/doc/$PRGNAM-$VERSION \
|
2010-04-16 04:50:22 +02:00
|
|
|
--includedir=$PREFIX/include \
|
|
|
|
--libdir=$PREFIX/lib$(echo $ARCH | grep -o 64) \
|
|
|
|
--enable-single-host \
|
|
|
|
--enable-gcc-opts
|
|
|
|
|
|
|
|
# compilation
|
|
|
|
make -j3 PREFIX=$PREFIX
|
|
|
|
# installation
|
|
|
|
make install DESTDIR=$PKG
|
2010-04-16 05:01:36 +02:00
|
|
|
# WTF .bat
|
|
|
|
for b in $PKG$PREFIX/bin/*.bat ; do
|
|
|
|
mv $b ${b%bat}sh
|
|
|
|
done
|
2010-04-16 04:50:22 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
# correction
|
|
|
|
chown -R root:root $PKG/*
|
|
|
|
|
2011-02-17 05:19:56 +01:00
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
( cd $TMP/$PRGNAM-$VERSION
|
|
|
|
cp -R $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
|
2010-04-16 04:50:22 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
[ -d $PKG/usr/man ] && find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \;
|
|
|
|
[ -d $PKG/usr/info ] && find $PKG/usr/info -type f -name "*.info*" -exec gzip -9f {} \;
|
|
|
|
[ -d $PKG/usr/info ] && rm $PKG/usr/info/dir
|
|
|
|
|
|
|
|
# Strip binaries
|
|
|
|
find $PKG | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
|
|
|
|
find $PKG | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
|
|
|
|
|
|
|
|
# embaumement
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat <<EOF > $PKG/install/slack-desc
|
2011-02-17 05:19:56 +01:00
|
|
|
$PRGNAM: $PRGNAM (Scheme programming system)
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM: Gambit-C includes a Scheme interpreter and a Scheme compiler which can be used
|
|
|
|
$PRGNAM: to build standalone executables. Because the compiler generates portable
|
|
|
|
$PRGNAM: C code it is fairly easy to port to any platform with a decent C compiler.
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM: The Gambit-C system conforms to the R4RS, R5RS and IEEE Scheme standards.
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM: http://dynamo.iro.umontreal.ca/~gambit/wiki/index.php/Main_Page
|
|
|
|
$PRGNAM:
|
2010-04-16 04:50:22 +02:00
|
|
|
EOF
|
|
|
|
|
|
|
|
# empaquetage
|
|
|
|
( cd $PKG
|
2011-02-17 05:54:04 +01:00
|
|
|
makepkg -l y -c n $OUTPUT/$PRGNAM-$(echo $VERSION | tr -d -)-$ARCH-$BUILD$TAG.txz
|
2010-04-16 04:50:22 +02:00
|
|
|
)
|