2010-01-29 05:04:01 +01:00
|
|
|
#!/bin/sh
|
|
|
|
set -x
|
|
|
|
|
|
|
|
CWD=$(pwd)
|
|
|
|
|
|
|
|
PRGNAM=$(basename $CWD)
|
2010-02-16 04:07:09 +01:00
|
|
|
#VERSION=master_$(date +"%Y.%m.%d_%H.%M")
|
2010-01-29 05:04:01 +01:00
|
|
|
VERSION=0.7.0
|
|
|
|
|
|
|
|
BUILD=1
|
2011-02-17 05:54:04 +01:00
|
|
|
|
2010-01-29 05:04:01 +01:00
|
|
|
ARCH=$(uname -m)
|
|
|
|
LIBSUFFIX=$(echo $ARCH | grep -o 64)
|
|
|
|
|
2011-02-17 05:54:04 +01:00
|
|
|
TAG=cyco
|
|
|
|
OUTPUT=/tmp
|
2011-02-17 05:58:04 +01:00
|
|
|
TMP=/tmp/$TAG
|
|
|
|
PKG=$TMP/pkg-$PRGNAM
|
2010-01-29 05:04:01 +01:00
|
|
|
|
|
|
|
REPOSITORIES=/home/cycojesus/projets/packages/repositories/
|
|
|
|
|
|
|
|
PREFIX=/usr
|
|
|
|
|
|
|
|
# Cleaning
|
|
|
|
( cd $TMP
|
|
|
|
rm -fr $PRGNAM-$VERSION
|
|
|
|
rm -fr $PKG
|
|
|
|
)
|
|
|
|
|
|
|
|
# Fetching sources
|
|
|
|
( cd $TMP
|
|
|
|
# if [ ! -e $REPOSITORIES/$PRGNAM ] ; then
|
|
|
|
# mkdir -p $REPOSITORIES
|
|
|
|
# cd $REPOSITORIES
|
|
|
|
# git clone git://github.com/earl/gforth-mirror.git $PRGNAM
|
|
|
|
# fi
|
|
|
|
|
|
|
|
# ( cd $REPOSITORIES/$PRGNAM
|
|
|
|
# git pull
|
|
|
|
# )
|
|
|
|
# cp -R $REPOSITORIES/$PRGNAM $TMP/$PRGNAM-$VERSION
|
|
|
|
|
2010-03-19 08:39:27 +01:00
|
|
|
[ ! -e $CWD/$PRGNAM-$VERSION.tar.?z* ] && \
|
|
|
|
wget -c http://www.complang.tuwien.ac.at/forth/gforth/$PRGNAM-$VERSION.tar.gz -O $CWD/$PRGNAM-$VERSION.tar.gz
|
2010-01-29 05:04:01 +01:00
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.?z*
|
|
|
|
)
|
|
|
|
|
|
|
|
# Preparation
|
|
|
|
( cd $TMP/$PRGNAM-$VERSION
|
|
|
|
chown -R root:root .
|
|
|
|
find . \
|
|
|
|
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
|
|
|
|
-exec chmod 755 {} \; -o \
|
|
|
|
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
|
|
|
|
-exec chmod 644 {} \;
|
|
|
|
)
|
|
|
|
|
|
|
|
# Configuration
|
|
|
|
( cd $TMP/$PRGNAM-$VERSION
|
2010-03-19 08:39:27 +01:00
|
|
|
# VERSION=$(grep -o "AC_INIT(\[gforth\],\[[0-9\.]*-[0-9]*\]" configure.in | sed 's|AC_INIT([gforth],[||' | sed 's|]||')
|
|
|
|
|
2010-03-19 06:59:05 +01:00
|
|
|
sed -i "s|lib/|lib$LIBSUFFIX/|g" $(grep -l "lib/" * -r)
|
2010-03-19 07:28:31 +01:00
|
|
|
[ ! -e configure ] && ./autogen.sh #autoreconf
|
2010-03-19 06:59:05 +01:00
|
|
|
./configure \
|
2010-01-29 05:04:01 +01:00
|
|
|
--prefix=$PREFIX \
|
|
|
|
--mandir=$PREFIX/man \
|
|
|
|
--infodir=$PREFIX/info \
|
2010-03-19 07:28:31 +01:00
|
|
|
--libdir=$PREFIX/lib$LIBSUFFIX \
|
|
|
|
--libexecdir=$PREFIX/libexec
|
2010-01-29 05:04:01 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
# Building
|
|
|
|
( cd $TMP/$PRGNAM-$VERSION
|
2010-03-19 07:28:31 +01:00
|
|
|
make libdir=$PREFIX/lib$LIBSUFFIX
|
|
|
|
make libdir=$PREFIX/lib$LIBSUFFIX doc
|
|
|
|
make libdir=$PREFIX/lib$LIBSUFFIX more
|
2010-01-29 05:04:01 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
# Installation
|
|
|
|
( cd $TMP/$PRGNAM-$VERSION
|
|
|
|
make install install.TAGS DESTDIR=$PKG
|
|
|
|
|
|
|
|
mkdir -p $PKG$PREFIX/share/emacs/site-lisp/$PRGNAM
|
|
|
|
cp gforth.el* $PKG$PREFIX/share/emacs/site-lisp/$PRGNAM
|
|
|
|
|
|
|
|
mkdir -p $PKG$PREFIX/doc/$PRGNAM
|
|
|
|
cp -R doc/*.{dvi,ps,pdf,txt} doc/gforth doc/vmgen AUTHORS BUGS COPYING* ChangeLog INSTALL* NEWS* README* TAGS ToDo $PKG$PREFIX/doc/$PRGNAM
|
|
|
|
)
|
|
|
|
|
|
|
|
# Cleaning
|
|
|
|
( cd $PKG
|
|
|
|
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
|
|
|
|
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
|
|
|
|
|
|
|
|
find $PKG$PREFIX/man -type f -name "*.?" -exec gzip -9 {} \;
|
|
|
|
find $PKG$PREFIX/info -name "dir" -exec rm {} \;
|
|
|
|
find $PKG$PREFIX/info -type f -exec gzip -9 {} \;
|
|
|
|
|
|
|
|
chown -R root:root .
|
|
|
|
find . \
|
|
|
|
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
|
|
|
|
-exec chmod 755 {} \; -o \
|
|
|
|
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
|
|
|
|
-exec chmod 644 {} \;
|
|
|
|
)
|
|
|
|
|
|
|
|
# Packaging
|
|
|
|
( cd $PKG
|
|
|
|
mkdir install
|
|
|
|
cat <<EOF > $PKG/install/doinst.sh
|
|
|
|
cd /usr/info
|
2010-09-09 10:14:47 +02:00
|
|
|
for file in \$(ls *.gz | grep -v ".*\-[0-9]\+\.gz")
|
2010-01-29 05:04:01 +01:00
|
|
|
do
|
|
|
|
install-info \$file ./dir
|
|
|
|
done
|
2010-03-19 08:39:27 +01:00
|
|
|
# ( cd /usr/lib64/gforth/$VERSION/libcc-named ; rm -rf socket.so )
|
|
|
|
# ( cd /usr/lib64/gforth/$VERSION/libcc-named ; ln -sf socket.so.0.0.0 socket.so )
|
|
|
|
# ( cd /usr/lib64/gforth/$VERSION/libcc-named ; rm -rf socket.so.0 )
|
|
|
|
# ( cd /usr/lib64/gforth/$VERSION/libcc-named ; ln -sf socket.so.0.0.0 socket.so.0 )
|
|
|
|
# ( cd /usr/lib64/gforth/$VERSION/libcc-named ; rm -rf cstr.so )
|
|
|
|
# ( cd /usr/lib64/gforth/$VERSION/libcc-named ; ln -sf cstr.so.0.0.0 cstr.so )
|
|
|
|
# ( cd /usr/lib64/gforth/$VERSION/libcc-named ; rm -rf cstr.so.0 )
|
|
|
|
# ( cd /usr/lib64/gforth/$VERSION/libcc-named ; ln -sf cstr.so.0.0.0 cstr.so.0 )
|
|
|
|
# ( cd /usr/lib64/gforth/$VERSION/libcc-named ; rm -rf fflib.so )
|
|
|
|
# ( cd /usr/lib64/gforth/$VERSION/libcc-named ; ln -sf fflib.so.0.0.0 fflib.so )
|
|
|
|
# ( cd /usr/lib64/gforth/$VERSION/libcc-named ; rm -rf fflib.so.0 )
|
|
|
|
# ( cd /usr/lib64/gforth/$VERSION/libcc-named ; ln -sf fflib.so.0.0.0 fflib.so.0 )
|
|
|
|
# ( cd /usr/lib64/gforth/$VERSION/libcc-named ; rm -rf libffi.so )
|
|
|
|
# ( cd /usr/lib64/gforth/$VERSION/libcc-named ; ln -sf libffi.so.0.0.0 libffi.so )
|
|
|
|
# ( cd /usr/lib64/gforth/$VERSION/libcc-named ; rm -rf libffi.so.0 )
|
|
|
|
# ( cd /usr/lib64/gforth/$VERSION/libcc-named ; ln -sf libffi.so.0.0.0 libffi.so.0 )
|
|
|
|
# ( cd /usr/bin ; rm -rf vmgen )
|
|
|
|
# ( cd /usr/bin ; ln -sf vmgen-$VERSION vmgen )
|
|
|
|
# ( cd /usr/bin ; rm -rf gforthmi )
|
|
|
|
# ( cd /usr/bin ; ln -sf gforthmi-$VERSION gforthmi )
|
|
|
|
# ( cd /usr/bin ; rm -rf gforth-itc )
|
|
|
|
# ( cd /usr/bin ; ln -sf gforth-itc-$VERSION gforth-itc )
|
|
|
|
# ( cd /usr/bin ; rm -rf gforth-fast )
|
|
|
|
# ( cd /usr/bin ; ln -sf gforth-fast-$VERSION gforth-fast )
|
|
|
|
# ( cd /usr/bin ; rm -rf gforth )
|
|
|
|
# ( cd /usr/bin ; ln -sf gforth-$VERSION gforth )
|
2010-01-29 05:04:01 +01:00
|
|
|
EOF
|
|
|
|
|
|
|
|
cat <<EOF > $PKG/install/slack-desc
|
|
|
|
$PRGNAM: $PRGNAM (programming language)
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM: Gforth is a fast and portable implementation of the ANS Forth language.
|
|
|
|
$PRGNAM: It works nicely with the Emacs editor, offers some nice features such as
|
|
|
|
$PRGNAM: input completion and history and a powerful locals facility, and it even
|
|
|
|
$PRGNAM: has (the beginnings of) a manual. Gforth employs traditional implementation
|
|
|
|
$PRGNAM: techniques: its inner interpreter is indirect or direct threaded.
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM: http://www.gnu.org/software/gforth
|
|
|
|
$PRGNAM:
|
|
|
|
EOF
|
|
|
|
|
2011-02-17 05:54:04 +01:00
|
|
|
makepkg -l n -c n $OUTPUT/$PRGNAM-$(echo $VERSION | tr -d '-')-$ARCH-$BUILD$TAG.txz
|
2010-01-29 05:04:01 +01:00
|
|
|
)
|
|
|
|
|