wok view get-dropbox/stuff/get-dropbox @ rev 11139
Up: wxpython to 2.8.12.1.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Wed Oct 26 21:03:47 2011 +0000 (2011-10-26) |
parents | 86a0f8cb33f7 |
children | ae2c78100dca |
line source
1 #!/bin/sh
3 # Get and install Dropbox for Linux
5 PACKAGE="dropbox"
6 WEB_SITE="http://www.dropbox.com"
7 PLATFORM="lnx.x86" # or lnx.x86_64
8 TARBALL=$PACKAGE-$PLATFORM.tar.gz
9 URL="$WEB_SITE/download/?plat=$PLATFORM"
10 CUR_DIR=$(pwd)
11 TEMP_DIR=/tmp/$PACKAGE-$PLATFORM-$$
12 ROOT="$1"
14 # Check if we are root
15 if test $(id -u) != 0 ; then
16 echo -e "\nYou must be root to run `basename $0`."
17 echo -e "Please type 'su' and root password to become super-user.\n"
18 exit 1
19 fi
21 # Avoid reinstall
22 if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ]; then
23 echo -e "\n$PACKAGE package is already installed.\n"
24 exit 1
25 fi
27 # Create a TEMP_DIR
28 mkdir $TEMP_DIR
29 cd $TEMP_DIR
31 # Download the file
32 wget -O $TARBALL $URL
34 if [ ! -f $TARBALL ]; then
35 echo "Could not download $TARBALL. Exiting."
36 cd $CUR_DIR
37 rm -rf $TEMP_DIR
38 exit 1
39 fi
41 tar xzf $TARBALL
42 # extracted pkg can be removed: Save RAM
43 rm -f $TARBALL
44 VERSION="$(cat $TEMP_DIR/.dropbox-dist/VERSION)"
46 mkdir -p $PACKAGE-$VERSION/fs/usr/lib \
47 $PACKAGE-$VERSION/fs/usr/bin \
48 $PACKAGE-$VERSION/fs/usr/share/applications
50 mv $TEMP_DIR/.dropbox-dist $PACKAGE-$VERSION/fs/usr/lib/dropbox
51 strip $PACKAGE-$VERSION/fs/usr/lib/dropbox 2>/dev/null
53 # Custom Dropboxd
54 cat > $PACKAGE-$VERSION/fs/usr/lib/dropbox/dropboxd << "EOT"
55 #!/bin/sh
56 PAR=/usr/lib/dropbox
57 LD_LIBRARY_PATH=$PAR:$LD_LIBRARY_PATH exec $PAR/dropbox $@
58 EOT
60 # Desktop file
61 cat > $PACKAGE-$VERSION/fs/usr/share/applications/dropbox.desktop << EOT
62 [Desktop Entry]
63 Type=Application
64 Name=Dropbox Storage
65 Exec=dropboxd
66 Icon=dropbox.png
67 Terminal=false
68 Categories=Network
69 EOT
71 # Symling to have Dropbox in PATH and fake nautilus
72 cd $PACKAGE-$VERSION/fs/usr/bin
73 rm -f dropboxd nautilus
74 ln -s ../lib/dropbox/dropboxd .
75 ln -s /usr/bin/pcmanfm nautilus
77 cd $TEMP_DIR
79 cat > $PACKAGE-$VERSION/receipt << EOT
80 PACKAGE="$PACKAGE"
81 VERSION="$VERSION"
82 CATEGORY="non-free"
83 SHORT_DESC="Dropbox daemon and client for online storage."
84 DEPENDS="python"
85 WEB_SITE="$WEB_SITE/"
86 SUGGESTED="ntlmaps"
87 EOT
89 # Pack
90 tazpkg pack $PACKAGE-$VERSION
92 # Clean to save RAM memory
93 rm -rf $PACKAGE-$VERSION
95 # Install pseudo package
96 yes y | tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
98 case " $@ " in
99 *\ --k*) mv $PACKAGE-$VERSION.tazpkg $CUR_DIR ;;
100 esac
102 # Clean
103 cd $CUR_DIR
104 rm -rf $TEMP_DIR