wok view get-prince/stuff/get-prince @ rev 8748

Up: glibc 2.13
author Antoine Bodin <gokhlayeh@slitaz.org>
date Sun Feb 20 03:26:10 2011 +0100 (2011-02-20)
parents 0e59fefac994
children
line source
1 #!/bin/sh
3 PACKAGE="prince"
4 VERSION="7.0"
5 DEBPKG="${PACKAGE}_${VERSION}-1_i386.deb"
6 URL="http://www.princexml.com/download/$DEBPKG"
7 CUR_DIR=$(pwd)
8 TEMP_DIR=/tmp/$PACKAGE-$VERSION-$$
9 ROOT=
11 # Check if we are root
12 if test $(id -u) != 0 ; then
13 echo -e "\nYou must be root to run `basename $0`."
14 echo -e "Please type 'su' and root password to become super-user.\n"
15 exit 1
16 fi
18 # Avoid reinstall
19 if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ]; then
20 echo -e "\n$PACKAGE package is already installed.\n"
21 exit 1
22 fi
24 # Create a TEMP_DIR
25 mkdir $TEMP_DIR
26 cd $TEMP_DIR
28 # Download the file
29 wget $URL
30 if [ ! -f $DEBPKG ]; then
31 cd $CUR_DIR
32 rm -rf $TEMP_DIR
33 echo "Could not download $DEBPKG. Exiting."
34 exit 1
35 fi
37 mkdir $PACKAGE-$VERSION
39 dpkg-deb -x $DEBPKG $PACKAGE-$VERSION/fs
40 rm -rf $PACKAGE-$VERSION/fs/usr/share
42 # extracted pkg can be removed: Save RAM
43 rm -rf $DEBPKG
45 cat > $PACKAGE-$VERSION/receipt << EOT
46 PACKAGE="$PACKAGE"
47 VERSION="$VERSION"
48 CATEGORY="non-free"
49 SHORT_DESC="A great way of getting web content onto paper."
50 DEPENDS=""
51 WEB_SITE="http://www.princexml.com/"
52 EOT
54 # Pack
55 tazpkg pack $PACKAGE-$VERSION
57 # Clean to save RAM memory
58 rm -rf $PACKAGE-$VERSION
60 # Install pseudo package
61 yes y | tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
63 # Clean
64 cd $CUR_DIR
65 rm -rf $TEMP_DIR