slackbuilds/d/UNUSED/rust/rust.SlackBuild
Gwenhael Le Moine 0da671b6e8 big spring cleanup, putting aside currently unused scripts
Signed-off-by: Gwenhael Le Moine <gwenhael.le.moine@gmail.com>
2013-03-25 22:41:45 +01:00

72 lines
1.8 KiB
Bash
Executable file
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/sh
CWD=$(pwd)
PRGNAM=$(basename $CWD)
VERSION=git$(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
mkdir -p $TMP $PKG
# get sources
[ ! -e $REPOSITORIES ] && mkdir -p $REPOSITORIES
if [ -e $REPOSITORIES/$PRGNAM ] ; then
( cd $REPOSITORIES/$PRGNAM
git pull
)
else
git clone http://github.com/mozilla/rust/ $REPOSITORIES/$PRGNAM
( cd $REPOSITORIES/$PRGNAM
git submodule init
git submodule update
)
fi
cd $TMP
rm -fr $PRGNAM-$VERSION && cp -R $REPOSITORIES/$PRGNAM $PRGNAM-$VERSION
cd $PRGNAM-$VERSION
./configure \
--prefix=$PREFIX
make
make DESTDIR=$PKG install
mv $PKG/usr/share/man $PKG/usr/
find $PKG/usr/man/ -type f -name \*.\? -exec gzip -9 {} \;
cd $PKG
mkdir -p install
cat <<EOF > install/slack-desc
$PRGNAM: $PRGNAM (a safe, concurrent, practical language)
$PRGNAM:
$PRGNAM: Rust is a curly-brace, block-structured expression language.
$PRGNAM: It visually resembles the C language family, but differs significantly in
$PRGNAM: syntactic and semantic details. Its design is oriented toward concerns of
$PRGNAM: “programming in the large”, that is, of creating and maintaining boundaries
$PRGNAM: both abstract and operational that preserve large-system integrity,
$PRGNAM: availability and concurrency.
$PRGNAM:
$PRGNAM: http://www.rust-lang.org/
$PRGNAM:
EOF
chown -R root:root *
[ -d $PKG/usr/man ] && find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \;
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