2009-11-14 12:48:50 +01:00
|
|
|
#!/bin/sh
|
|
|
|
set -x -e
|
|
|
|
|
2010-01-29 03:44:37 +01:00
|
|
|
CWD=$(pwd)
|
|
|
|
|
|
|
|
PRGNAM=$(basename $CWD)
|
2009-11-14 12:48:50 +01:00
|
|
|
ARCH=$(uname -m)
|
2010-08-19 09:00:12 +02:00
|
|
|
VERSION=$(ls -u factor*.tar.?z* | head -n1 | sed 's|.tar.gz$||' | sed "s|^factor-linux-$( [ "$ARCH" = "x86_64" ] && echo x86-64 || echo x86-32)-||" )
|
2009-11-14 12:48:50 +01:00
|
|
|
BUILD=1
|
|
|
|
PACKAGER=cyco
|
|
|
|
|
|
|
|
TMP=/tmp
|
|
|
|
PKG=$TMP/$PACKAGER/pkg-$PRGNAM
|
|
|
|
PREFIX=/usr
|
|
|
|
|
|
|
|
# cleaning
|
|
|
|
rm -fr $PKG
|
|
|
|
|
|
|
|
# unpacking
|
|
|
|
mkdir -p $PKG$PREFIX/libexec/
|
|
|
|
( cd $PKG$PREFIX/libexec/
|
|
|
|
tar xf $CWD/$PRGNAM-linux-$( [ "$ARCH" = "x86_64" ] && echo "x86-64" || echo "x86-32")-$VERSION.tar.gz
|
|
|
|
)
|
|
|
|
|
|
|
|
# installation
|
|
|
|
mkdir -p $PKG$PREFIX/{bin,doc/$PRGNAM-$VERSION}
|
|
|
|
cat <<EOF > $PKG$PREFIX/bin/$PRGNAM
|
|
|
|
#!/bin/sh
|
|
|
|
cd $PREFIX/libexec/$PRGNAM-$VERSION
|
|
|
|
./$PRGNAM $@
|
|
|
|
EOF
|
|
|
|
chmod +x $PKG$PREFIX/bin/$PRGNAM
|
|
|
|
( cd $PKG$PREFIX/doc/$PRGNAM-$VERSION
|
2010-05-12 08:55:17 +02:00
|
|
|
ln -s ../libexec/$PRGNAM/readme.html
|
|
|
|
ln -s ../libexec/$PRGNAM/license.txt
|
2009-11-14 12:48:50 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
# packaging
|
|
|
|
cd $PKG
|
|
|
|
mkdir install
|
|
|
|
cat <<EOF > install/slack-desc
|
|
|
|
$PRGNAM: $PRGNAM (A practical stack language)
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM: Factor is expressive, fast, supports interactive development and has a
|
|
|
|
$PRGNAM: full-featured library. Factor runs on all common platforms and Factor
|
|
|
|
$PRGNAM: applications are portable between them. Factor can deploy stand-alone
|
|
|
|
$PRGNAM: applications on all platforms.
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM: see $PREFIX/doc/$PRGNAM-$VERSION
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM: http://factorcode.org/
|
|
|
|
$PRGNAM:
|
|
|
|
EOF
|
|
|
|
|
|
|
|
makepkg -l y -c n $TMP/$PRGNAM-$(echo $VERSION | tr -d '-')-$ARCH-$BUILD$PACKAGER.txz
|