wok view get-wakoopa/stuff/get-wakoopa @ rev 14949

Up: emotion (1.7.8)
author Dominique Corbex <domcox@slitaz.org>
date Thu Aug 08 19:15:54 2013 +0200 (2013-08-08)
parents 60e17092a7b7
children
line source
1 #!/bin/sh
2 # Wakoopa is the perfect place to discover software and games online.
4 PACKAGE="wakoopa"
5 VERSION="2.0-2"
6 RPMPKG="$PACKAGE-$VERSION.i386.rpm"
7 URL="http://apt.wakoopa.com/$RPMPKG"
8 CUR_DIR=$(pwd)
9 TEMP_DIR=/tmp/$PACKAGE-$VERSION-$$
10 ROOT="$1"
12 # Check if we are root
13 if test $(id -u) != 0 ; then
14 echo -e "\nYou must be root to run `basename $0`."
15 echo -e "Please type 'su' and root password to become super-user.\n"
16 exit 1
17 fi
19 # Avoid reinstall
20 if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ]; then
21 echo -e "\n$PACKAGE package is already installed.\n"
22 exit 1
23 fi
25 # Create a TEMP_DIR
26 mkdir $TEMP_DIR
27 cd $TEMP_DIR
29 # Download the file
30 wget $URL
31 if [ ! -f $RPMPKG ]; then
32 cd $CUR_DIR
33 rm -rf $TEMP_DIR
34 echo "Could not download $RPMPKG. Exiting."
35 exit 1
36 fi
38 rpm2cpio $RPMPKG | cpio -dium
39 # updated desktop menu
40 sed -i 's/Categories=.*/Categories=Network;/g' $TEMP_DIR/usr/share/applications/wakoopa.desktop 2>/dev/null
42 # extracted pkg can be removed: Save RAM
43 rm -rf $RPMPKG
45 mkdir -p $PACKAGE-$VERSION/fs
46 mv $TEMP_DIR/usr $PACKAGE-$VERSION/fs
48 cd $TEMP_DIR
50 cat > $PACKAGE-$VERSION/receipt << EOT
51 PACKAGE="$PACKAGE"
52 VERSION="$VERSION"
53 CATEGORY="non-free"
54 SHORT_DESC="Wakoopa Desktop Tracker."
55 DEPENDS="gtk+"
56 WEB_SITE="http://wakoopa.com"
57 EOT
59 # Pack
60 tazpkg pack $PACKAGE-$VERSION
62 # Clean to save RAM memory
63 rm -rf $PACKAGE-$VERSION
65 # Install pseudo package
66 yes y | tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
68 # Clean
69 cd $CUR_DIR
70 rm -rf $TEMP_DIR