summaryrefslogtreecommitdiff
path: root/development/rust/rust.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'development/rust/rust.SlackBuild')
-rw-r--r--development/rust/rust.SlackBuild45
1 files changed, 29 insertions, 16 deletions
diff --git a/development/rust/rust.SlackBuild b/development/rust/rust.SlackBuild
index 95f911510b..7bac3096b8 100644
--- a/development/rust/rust.SlackBuild
+++ b/development/rust/rust.SlackBuild
@@ -2,7 +2,7 @@
# Slackware build script for rust
-# Copyright 2014 Dmitrii Sosedov, United States
+# Copyright 2014-2015 Dmitrii Sosedov, United States
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -23,15 +23,15 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=rust
-VERSION=${VERSION:-0.12.0}
+PRGNAM2=cargo
+VERSION=${VERSION:-1.0.0}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
- i?86) ARCH=i486 ;;
- arm*) ARCH=arm ;;
- *) ARCH=$( uname -m ) ;;
+ x86_64) ARCH=x86_64 ;;
+ *) ARCH=i686 ;;
esac
fi
@@ -43,7 +43,6 @@ OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
LIBDIRSUFFIX=""
- ARCH=i686
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
@@ -61,18 +60,28 @@ rm -rf $PKG
mkdir -p $TMP $PKG $PKG/usr $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
-tar xvf $CWD/$PRGNAM\-$VERSION\-$ARCH\-unknown-linux-gnu.tar.gz
+tar xvf $CWD/$PRGNAM-$VERSION-$ARCH-unknown-linux-gnu.tar.gz
cd $PRGNAM-$VERSION-$ARCH-unknown-linux-gnu
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
- -o -perm 511 \) -exec chmod 755 {} \; -o \
+ -o -perm 511 \) -exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
- -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
-cp -r bin $PKG/usr/bin
-cp -r lib $PKG/usr/lib${LIBDIRSUFFIX}
-cp -r share $PKG/usr/share
+chmod 755 ${PRGNAM}c/{bin,lib,share}
+chmod 755 ${PRGNAM2}/{bin,etc,lib,share}
+
+mv ${PRGNAM}c/bin $PKG/usr/
+mv ${PRGNAM}c/lib $PKG/usr/lib${LIBDIRSUFFIX}
+mv ${PRGNAM}c/share $PKG/usr/
+mv ${PRGNAM2}/bin/* $PKG/usr/bin/
+mv ${PRGNAM2}/etc $PKG/usr/
+mv ${PRGNAM2}/lib/* $PKG/usr/lib${LIBDIRSUFFIX}
+cp -rf ${PRGNAM2}/share/* $PKG/usr/share
+
+find -L $PKG -type d -exec chmod 755 {} \;
+chmod 755 $PKG/usr/bin/*
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
@@ -81,10 +90,14 @@ mv $PKG/usr/share/man $PKG/usr/
find $PKG/usr/man -type f -exec gzip -9 {} \;
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
-mkdir -p $PKG/usr/share/doc/$PRGNAM-$VERSION
-cp -a COPYRIGHT LICENSE-APACHE LICENSE-MIT README.md $PKG/usr/share/doc/$PRGNAM-$VERSION
-cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/share/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
-cat $CWD/$PRGNAM.info > $PKG/usr/share/doc/$PRGNAM-$VERSION/$PRGNAM.info
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+mv $PRGNAM-docs/share/* $PKG/usr/doc/$PRGNAM-$VERSION/
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+mv $PKG/usr/doc/$PRGNAM-$VERSION/doc/$PRGNAM/html $PKG/usr/doc/$PRGNAM-$VERSION
+cp -rf $PKG/usr/share/doc $PKG/usr/
+rm -rf $PKG/usr/share/doc $PKG/usr/doc/$PRGNAM-$VERSION/doc
+chmod 755 $PKG/usr/doc/$PRGNAM-$VERSION/html
+find -L $PKG/usr/doc/$PRGNAM-$VERSION/html -type d -exec chmod 755 {} \;
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc