wok view get-scilab/stuff/get-scilab @ rev 22131
updated wimlib (1.5.1 -> 1.13.1)
author | Hans-G?nter Theisgen |
---|---|
date | Mon Nov 04 14:25:06 2019 +0100 (2019-11-04) |
parents | |
children | c07aaa614a02 |
line source
1 #!/bin/sh -e
3 PACKAGE="scilab"
4 WEB_SITE="http://www.scilab.org/"
5 CATEGORY="misc"
6 SHORT_DESC="Free Open Source Software for Numerical Computation."
7 MAINTAINER="somebody@scilab.org"
8 DEPENDS="xorg-libXss"
9 URL="http://www.scilab.org/fr/products/scilab/download"
11 ROOT="$1"
12 [ -d "$ROOT" ] || ROOT=""
14 if test $(id -u) != 0 ; then
15 echo -e "\nYou must be root to run `basename $0`."
16 echo -e "Please type 'su' and root password to become super-user.\n"
17 exit 0
18 fi
20 if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ]; then
21 [ -n "$ROOT" ] && exit 1
22 tazpkg remove $PACKAGE
23 [ -d /var/lib/tazpkg/installed/$PACKAGE ] && exit 1
24 fi
26 TMP_DIR=/tmp/get-$PACKAGE-$$-$RANDOM
27 CUR_DIR=$(pwd)
28 mkdir -p $TMP_DIR && cd $TMP_DIR
30 # Download tarball
31 URL="$(wget -O - $URL | sed '/linux-i686/!d;/href/!d;s/.*href=.\([^"]*\).*/\1/')"
32 FILE="$(basename $URL)"
33 wget -O $FILE "$URL"
35 if [ ! -f $FILE ]; then
36 cd $CUR_DIR
37 rm -rf $TMP_DIR
38 echo "Could not download $FILE from $URL. Exiting."
39 exit 1
40 fi
42 mkdir -p $PACKAGE/fs/usr/share
43 tar xzf $FILE -C $PACKAGE/fs/usr/share
44 # extracted pkg can be removed: Save RAM
45 rm -f $FILE
47 VERSION="$(ls $PACKAGE/fs/usr/share | sed 's/.*-//;s|/||')"
48 mv $PACKAGE/fs/usr/share/* $PACKAGE/fs/usr/share/$PACKAGE
49 mkdir -p $PACKAGE/fs/usr/bin
50 ln -s /usr/share/$PACKAGE/bin/$PACKAGE $PACKAGE/fs/usr/bin/$PACKAGE
52 mv $PACKAGE $PACKAGE-$VERSION
53 cd $PACKAGE-$VERSION/fs
55 # Create menu
56 mkdir -p usr/share/applications
57 cat > usr/share/applications/$PACKAGE.desktop <<EOT
58 [Desktop Entry]
59 Version=1.0
60 Encoding=UTF-8
61 Name=$PACKAGE
62 Exec=$PACKAGE
63 Terminal=false
64 Categories=Application
65 Icon=/usr/share/scilab/share/icons/hicolor/24x24/apps/scilab.png
66 Comment=$SHORT_DESC
67 Type=Application
68 Categories=Office;
69 EOT
70 cd ../..
72 cat > $PACKAGE-$VERSION/receipt <<EOT
73 PACKAGE="$PACKAGE"
74 VERSION="$VERSION"
75 CATEGORY="$CATEGORY"
76 SHORT_DESC="$SHORT_DESC"
77 MAINTAINER="$MAINTAINER"
78 DEPENDS="$DEPENDS"
79 WEB_SITE="$WEB_SITE"
80 EOT
82 # Pack
83 tazpkg pack $PACKAGE-$VERSION
85 # Clean to save RAM memory
86 rm -rf $PACKAGE-$VERSION
88 # Install pseudo package
89 tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
90 case " $@ " in
91 *\ --k*) mv $PACKAGE-$VERSION.tazpkg $CUR_DIR ;;
92 esac
94 # Clean
95 cd $CUR_DIR
96 rm -rf $TMP_DIR