wok-4.x view get-wakoopa/stuff/get-wakoopa @ rev 12322
get-wfica: update (thanks Carl)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Aug 22 18:22:54 2012 +0200 (2012-08-22) |
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