wok-6.x view get-geogebra/stuff/get-geogebra @ rev 17561
Up: gnutls 3.3.12
author | Alexander Medvedev <devl547@gmail.com> |
---|---|
date | Fri Feb 06 22:54:07 2015 +0000 (2015-02-06) |
parents | 023a32bce7dd |
children |
line source
1 #!/bin/sh -e
3 PACKAGE="geogebra"
4 WEB_SITE="http://www.geogebra.org/"
5 CATEGORY="non-free"
6 SHORT_DESC="Mathematics software for learning and teaching."
7 MAINTAINER="somebody@geogebra.org"
8 DEPENDS="bash"
9 URL="http://www.geogebra.org/download/?os=linux&portable=true"
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 FILE=$PACKAGE.tgz
32 wget -O $FILE "$URL"
34 if [ ! -f $FILE ]; then
35 cd $CUR_DIR
36 rm -rf $TMP_DIR
37 echo "Could not download $FILE from $URL. Exiting."
38 exit 1
39 fi
41 mkdir -p $PACKAGE/fs/usr/share
42 tar xzf $FILE -C $PACKAGE/fs/usr/share
43 # extracted pkg can be removed: Save RAM
44 rm -f $FILE
46 VERSION="$(ls $PACKAGE/fs/usr/share | sed 's/.*-//;s|/||')"
47 mv $PACKAGE/fs/usr/share/* $PACKAGE/fs/usr/share/$PACKAGE
48 mkdir -p $PACKAGE/fs/usr/bin
49 ln -s /usr/share/$PACKAGE/$PACKAGE-portable $PACKAGE/fs/usr/bin/$PACKAGE
51 mv $PACKAGE $PACKAGE-$VERSION
52 cd $PACKAGE-$VERSION/fs
54 # Create menu
55 mkdir -p usr/share/applications
56 cat > usr/share/applications/$PACKAGE.desktop <<EOT
57 [Desktop Entry]
58 Version=1.0
59 Encoding=UTF-8
60 Name=$PACKAGE
61 Exec=$PACKAGE
62 Terminal=false
63 Categories=Application
64 Icon=/usr/share/geogebra/geogebra.png
65 Comment=$SHORT_DESC
66 Type=Application
67 Categories=Office;
68 EOT
69 cd ../..
71 cat > $PACKAGE-$VERSION/receipt <<EOT
72 PACKAGE="$PACKAGE"
73 VERSION="$VERSION"
74 CATEGORY="$CATEGORY"
75 SHORT_DESC="$SHORT_DESC"
76 MAINTAINER="$MAINTAINER"
77 DEPENDS="$DEPENDS"
78 WEB_SITE="$WEB_SITE"
79 EOT
81 # Pack
82 tazpkg pack $PACKAGE-$VERSION
84 # Clean to save RAM memory
85 rm -rf $PACKAGE-$VERSION
87 # Install pseudo package
88 tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
89 case " $@ " in
90 *\ --k*) mv $PACKAGE-$VERSION.tazpkg $CUR_DIR ;;
91 esac
93 # Clean
94 cd $CUR_DIR
95 rm -rf $TMP_DIR