slackbuilds/d/rust/SlackBuild

65 lines
2 KiB
Text
Raw Normal View History

2015-02-26 12:23:48 +01:00
#!/bin/sh
CWD=$(pwd)
PRGNAM=$(basename $CWD)
VERSION=${VERSION:-1.17.0}
2015-02-26 12:23:48 +01:00
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
[ "$VERSION" == "nightly" ] && rm $CWD/rust-${VERSION}-x86_64-unknown-linux-gnu.tar.gz
[ ! -e $CWD/rust-${VERSION}-x86_64-unknown-linux-gnu.tar.gz ] && wget -c https://static.rust-lang.org/dist/rust-${VERSION}-x86_64-unknown-linux-gnu.tar.gz -O $CWD/rust-${VERSION}-x86_64-unknown-linux-gnu.tar.gz
cd $TMP
tar xvf $CWD/rust-${VERSION}-x86_64-unknown-linux-gnu.tar.gz
2015-05-17 10:46:12 +02:00
cd rust-${VERSION}-x86_64-unknown-linux-gnu
2015-02-26 12:23:48 +01:00
./install.sh --prefix=$PKG/usr
2015-05-17 10:46:12 +02:00
echo "${ARCH}" | grep -q -o 64 && mv $PKG/usr/lib $PKG/usr/lib64
2015-02-26 12:23:48 +01:00
mv $PKG/usr/share/man $PKG/usr/
2015-05-17 10:46:12 +02:00
mv $PKG/usr/share/doc $PKG/usr/
2015-02-26 12:23:48 +01:00
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:
2017-04-01 10:05:14 +02:00
$PRGNAM: Rust is a curly-brace, block-structured expression language.
2015-02-26 12:23:48 +01:00
$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
[ "$VERSION" == "nightly" ] && VERSION=${VERSION}_$(date +%F | tr - .)
makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz