slackbuilds/UNUSED/d/gforth/SlackBuild

118 lines
3.2 KiB
Text
Raw Normal View History

2010-01-29 05:04:01 +01:00
#!/bin/sh
set -x
CWD=$(pwd)
PRGNAM=$(basename $CWD)
VERSION=$(date +"%Y.%m.%d_%H.%M")
2010-01-29 05:04:01 +01:00
BUILD=1
2010-01-29 05:04:01 +01:00
ARCH=$(uname -m)
LIBSUFFIX=$(echo $ARCH | grep -o 64)
2020-06-25 11:23:11 +02:00
TAG=gwh
OUTPUT=/tmp
TMP=/tmp/$TAG
PKG=$TMP/pkg-$PRGNAM
2010-01-29 05:04:01 +01:00
2011-07-22 08:41:46 +02:00
REPOSITORIES=/home/installs/SlackBuilds/repositories/
2010-01-29 05:04:01 +01:00
PREFIX=/usr
# Cleaning
cd $TMP
rm -fr $PRGNAM-$VERSION
rm -fr $PKG
2010-01-29 05:04:01 +01:00
# Fetching sources
if [ ! -e $REPOSITORIES/$PRGNAM ] ; then
git clone git://git.savannah.gnu.org/gforth.git $REPOSITORIES/$PRGNAM
else
( cd $REPOSITORIES/$PRGNAM
git pull
)
fi
cp -R $REPOSITORIES/$PRGNAM $TMP/$PRGNAM-$VERSION
2010-01-29 05:04:01 +01:00
# 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 {} \;
2010-01-29 05:04:01 +01:00
# Configuration
#sed -i "s|lib/|lib$LIBSUFFIX/|g" $(grep -l "lib/" * -r)
[ ! -e configure ] && ./autogen.sh #autoreconf
./configure \
--prefix=$PREFIX \
--mandir=$PREFIX/man \
--infodir=$PREFIX/info \
--libdir=$PREFIX/lib$LIBSUFFIX \
--libexecdir=$PREFIX/libexec
2010-01-29 05:04:01 +01:00
# Building
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
#make install install.TAGS DESTDIR=$PKG
make install DESTDIR=$PKG
2010-01-29 05:04:01 +01:00
mkdir -p $PKG$PREFIX/share/emacs/site-lisp/$PRGNAM
cp gforth.el* $PKG$PREFIX/share/emacs/site-lisp/$PRGNAM
2010-01-29 05:04:01 +01:00
# 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
2010-01-29 05:04:01 +01:00
# 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 {} \;
2010-01-29 05:04:01 +01:00
# Packaging
mkdir install
cat <<EOF > $PKG/install/doinst.sh
2010-01-29 05:04:01 +01:00
cd /usr/info
2011-04-02 15:45:52 +02:00
[ -e dir ] && rm dir
[ -e dir.gz ] && rm dir.gz
[ -e dir.new ] && rm dir.new
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
EOF
cat <<EOF > $PKG/install/slack-desc
2010-01-29 05:04:01 +01:00
$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
rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la
2020-07-12 09:22:26 +02:00
/sbin/makepkg -l n -c n $OUTPUT/$PRGNAM-$(echo $VERSION | tr -d '-')-$ARCH-$BUILD$TAG.txz
2010-01-29 05:04:01 +01:00