wok-4.x view get-dropbox/stuff/get-dropbox @ rev 9630
Up slitaz-configs (4.3.2) - Small fix fro next cooking
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Tue Apr 26 14:58:53 2011 +0200 (2011-04-26) |
parents | 70a435a7d961 |
children | f6008b21317f |
line source
1 #!/bin/sh
3 # Get and install Dropbox for Linux
5 PACKAGE="dropbox"
6 VERSION="0.6.487"
7 TARBALL="$PACKAGE-lnx.x86-$VERSION.tar.gz"
8 URL="http://dl.getdropbox.com/u/17/$TARBALL"
9 CUR_DIR=$(pwd)
10 TEMP_DIR=/tmp/$PACKAGE-$VERSION-$$
11 ROOT="$1"
13 # Check if we are 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 1
18 fi
20 # Avoid reinstall
21 if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ]; then
22 echo -e "\n$PACKAGE package is already installed.\n"
23 exit 1
24 fi
26 # Create a TEMP_DIR
27 mkdir $TEMP_DIR
28 cd $TEMP_DIR
30 # Download the file
31 wget $URL
33 if [ ! -f $TARBALL ]; then
34 echo "Could not download $TARBALL. Exiting."
35 cd $CUR_DIR
36 rm -rf $TEMP_DIR
37 exit 1
38 fi
40 tar xzf $TARBALL
41 # extracted pkg can be removed: Save RAM
42 rm -f $TARBALL
44 mkdir -p $PACKAGE-$VERSION/fs/usr/lib \
45 $PACKAGE-$VERSION/fs/usr/bin \
46 $PACKAGE-$VERSION/fs/usr/share/applications
48 mv $TEMP_DIR/.dropbox-dist $PACKAGE-$VERSION/fs/usr/lib/dropbox
49 strip $PACKAGE-$VERSION/fs/usr/lib/dropbox 2>/dev/null
51 # Custom Dropboxd
52 cat > $PACKAGE-$VERSION/fs/usr/lib/dropbox/dropboxd << "EOT"
53 #!/bin/sh
54 PAR=/usr/lib/dropbox
55 LD_LIBRARY_PATH=$PAR:$LD_LIBRARY_PATH exec $PAR/dropbox $@
56 EOT
58 # Desktop file
59 cat > $PACKAGE-$VERSION/fs/usr/share/applications/dropbox.desktop << EOT
60 [Desktop Entry]
61 Type=Application
62 Name=Dropbox Storage
63 Exec=dropboxd
64 Icon=dropbox.png
65 Terminal=false
66 Categories=Network
67 EOT
69 # Symling to have Dropbox in PATH and fake nautilus
70 cd $PACKAGE-$VERSION/fs/usr/bin
71 rm -f dropboxd nautilus
72 ln -s ../lib/dropbox/dropboxd .
73 ln -s /usr/bin/pcmanfm nautilus
75 cd $TEMP_DIR
77 cat > $PACKAGE-$VERSION/receipt << EOT
78 PACKAGE="$PACKAGE"
79 VERSION="$VERSION"
80 CATEGORY="non-free"
81 SHORT_DESC="Dropbox daemon and client for online storage."
82 DEPENDS="python"
83 WEB_SITE="http://www.getdropbox.com/"
84 SUGGESTED="ntlmaps"
85 EOT
87 # Pack
88 tazpkg pack $PACKAGE-$VERSION
90 # Clean to save RAM memory
91 rm -rf $PACKAGE-$VERSION
93 # Install pseudo package
94 yes y | tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
96 # Clean
97 cd $CUR_DIR
98 rm -rf $TEMP_DIR