slackbuilds/d/clojure/clojure.SlackBuild
Gwenhael Le moine f45d87e3cd updated, download sources if necessary
Signed-off-by: Gwenhael Le moine <gwenhael.le.moine@gmail.com>
2010-01-01 08:51:34 +07:00

75 lines
1.8 KiB
Bash
Executable file

#!/bin/sh
set -x -e
PRGNAM=clojure
VERSION=1.1.0
ARCH=java
BUILD=1
PACKAGER=cyco
CWD=$(pwd)
TMP=/tmp
PKG=$TMP/$PACKAGER/pkg-$PRGNAM
PREFIX=/usr
# cleaning
rm -fr $PKG
# do we have the sources?
if [ ! -e $CWD/$PRGNAM-VERSION.zip ] ; then
( cd $CWD
wget -c http://$PRGNAM.googlecode.com/files/$PRGNAM-$VERSION.zip
)
fi
# unpacking
mkdir -p $PKG$PREFIX/libexec #/$PRGNAM-$VERSION
( cd $PKG$PREFIX/libexec #/$PRGNAM-$VERSION
unzip $CWD/${PRGNAM}-$VERSION.zip
)
# compilation
( cd $PKG$PREFIX/libexec/$PRGNAM-$VERSION
#rm $PRGNAM-$VERSION.jar
ant
)
# installation
mkdir -p $PKG$PREFIX/{bin,doc/$PRGNAM-$VERSION}
cat <<EOF > $PKG$PREFIX/bin/$PRGNAM
#!/bin/sh
java -jar $PREFIX/libexec/$PRGNAM-$VERSION/clojure.jar $@
EOF
chmod +x $PKG$PREFIX/bin/$PRGNAM
( cd $PKG$PREFIX/libexec/$PRGNAM-$VERSION
mv epl-v10.html readme.txt svninfo.txt $PKG$PREFIX/doc/$PRGNAM-$VERSION
rm *.xml
rm -r classes src
rm $PRGNAM.jar
ln -s $PRGNAM-$VERSION.jar $PRGNAM.jar
rm $PRGNAM-sources.jar
ln -s $PRGNAM-sources-$VERSION.jar $PRGNAM-sources.jar
rm $PRGNAM-slim.jar
ln -s $PRGNAM-slim-$VERSION.jar $PRGNAM-slim.jar
)
# packaging
cd $PKG
mkdir install
cat <<EOF > install/slack-desc
$PRGNAM: $PRGNAM (JVM targetting Lisp dialect)
$PRGNAM:
$PRGNAM: Clojure is a dynamic programming language that targets the Java Virtual
$PRGNAM: Machine (and the CLR ). It is designed to be a general-purpose language,
$PRGNAM: combining the approachability and interactive development of a scripting
$PRGNAM: language with an efficient and robust infrastructure for multithreaded
$PRGNAM: programming.
$PRGNAM:
$PRGNAM: see $PREFIX/doc/$PRGNAM-$VERSION
$PRGNAM:
$PRGNAM: http://clojure.org
EOF
makepkg -l y -c n $TMP/$PRGNAM-$(echo $VERSION|tr -d -)-$ARCH-$BUILD$PACKAGER.txz