81 lines
2.2 KiB
Text
81 lines
2.2 KiB
Text
|
#!/bin/sh
|
||
|
|
||
|
CWD=$(pwd)
|
||
|
|
||
|
PRGNAM=$(basename $CWD)
|
||
|
BRANCH=trunk
|
||
|
VERSION=$BRANCH$(date +%Y.%m.%d_%H.%M)
|
||
|
BUILD=1
|
||
|
|
||
|
ARCH=$(uname -m)
|
||
|
|
||
|
REPOSITORIES=/home/installs/SlackBuilds/repositories
|
||
|
|
||
|
TAG=cyco
|
||
|
TMP=/tmp/$TAG
|
||
|
PKG=$TMP/pkg-$PRGNAM
|
||
|
OUTPUT=/tmp
|
||
|
|
||
|
PREFIX=/usr
|
||
|
|
||
|
# cleaning
|
||
|
rm -fr $PKG
|
||
|
|
||
|
# get sources
|
||
|
[ ! -e $REPOSITORIES ] && mkdir -p $REPOSITORIES
|
||
|
( cd $REPOSITORIES
|
||
|
if [ -e $REPOSITORIES/$PRGNAM ] ; then
|
||
|
( cd $REPOSITORIES/$PRGNAM
|
||
|
git pull
|
||
|
)
|
||
|
else
|
||
|
git clone http://github.com/perl6/nqp.git nqp
|
||
|
fi
|
||
|
)
|
||
|
|
||
|
mkdir -p $TMP
|
||
|
( cd $TMP
|
||
|
rm -fr $PRGNAM-$VERSION && cp -R $REPOSITORIES/$PRGNAM $PRGNAM-$VERSION
|
||
|
( cd $PRGNAM-$VERSION
|
||
|
perl Configure.pl \
|
||
|
--prefix=$PREFIX \
|
||
|
--libdir=$PREFIX/lib$(echo $ARCH | grep -o 64) \
|
||
|
--mandir=$PREFIX/man \
|
||
|
--infodir=$PREFIX/info
|
||
|
make
|
||
|
make DESTDIR=$PKG install
|
||
|
mkdir -p $PKG/$PREFIX/doc/
|
||
|
( cd $PKG/$PREFIX/doc
|
||
|
ln -s ../share/doc/parrot $PRGNAM-$VERSION
|
||
|
)
|
||
|
)
|
||
|
)
|
||
|
|
||
|
( cd $PKG
|
||
|
mkdir -p install
|
||
|
cat <<EOF > install/slack-desc
|
||
|
$PRGNAM: $PRGNAM (Not Quite Perl)
|
||
|
$PRGNAM:
|
||
|
$PRGNAM: a lightweight Perl 6-like environment for virtual machines. The key feature
|
||
|
$PRGNAM: of NQP is that it's designed to be a very small environment (as compared with,
|
||
|
$PRGNAM: say, perl6 or Rakudo) and is focused on being a high-level way to create
|
||
|
$PRGNAM: compilers and libraries for virtual machines (such as the Parrot Virtual
|
||
|
$PRGNAM: Machine [1]). Unlike a full-fledged implementation of Perl 6, NQP strives to
|
||
|
$PRGNAM: have as small a runtime footprint as it can, while still providing a Perl 6
|
||
|
$PRGNAM: object model and regular expression engine for the virtual machine.
|
||
|
$PRGNAM:
|
||
|
$PRGNAM: https://github.com/perl6/nqp
|
||
|
EOF
|
||
|
|
||
|
chown -R root:root *
|
||
|
|
||
|
[ -d $PKG/usr/man ] && find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \;
|
||
|
|
||
|
( 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
|
||
|
)
|
||
|
|
||
|
makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz
|
||
|
)
|