wok-current rev 5323

Added get-prince
author Liu Peng <rocky@slitaz.org>
date Fri Apr 23 00:46:08 2010 +0000 (2010-04-23)
parents 0070b4206654
children 0e59fefac994
files get-prince/receipt get-prince/stuff/get-prince
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/get-prince/receipt	Fri Apr 23 00:46:08 2010 +0000
     1.3 @@ -0,0 +1,17 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="get-prince"
     1.7 +VERSION="1.00"
     1.8 +CATEGORY="non-free"
     1.9 +SHORT_DESC="formatter for converting XML and HTML into PDF."
    1.10 +MAINTAINER="rocky@slitaz.org"
    1.11 +WEB_SITE="http://www.princexml.com/"
    1.12 +TAGS="utilities"
    1.13 +
    1.14 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.15 +genpkg_rules()
    1.16 +{
    1.17 +    mkdir -p $fs/usr/bin
    1.18 +    cp stuff/get-prince $fs/usr/bin
    1.19 +}
    1.20 +
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/get-prince/stuff/get-prince	Fri Apr 23 00:46:08 2010 +0000
     2.3 @@ -0,0 +1,78 @@
     2.4 +#!/bin/sh 
     2.5 +
     2.6 +PACKAGE="prince"
     2.7 +VERSION="7.0"
     2.8 +DEBPKG="${PACKAGE}_${VERSION}-1_i386.deb"
     2.9 +URL="http://www.princexml.com/download/$DEBPKG"
    2.10 +CUR_DIR=$(pwd)
    2.11 +TEMP_DIR=/tmp/$PACKAGE-$VERSION-$$
    2.12 +ROOT=
    2.13 +
    2.14 +# Check if we are root
    2.15 +if test $(id -u) != 0 ; then
    2.16 +    echo -e "\nYou must be root to run `basename $0`."
    2.17 +    echo -e "Please type 'su' and root password to become super-user.\n"
    2.18 +    exit 1
    2.19 +fi
    2.20 +
    2.21 +# Avoid reinstall
    2.22 +if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ]; then
    2.23 +    echo -e "\n$PACKAGE package is already installed.\n"
    2.24 +    exit 1
    2.25 +fi
    2.26 +
    2.27 +# Create a TEMP_DIR
    2.28 +mkdir $TEMP_DIR
    2.29 +cd $TEMP_DIR
    2.30 +
    2.31 +# Download the file
    2.32 +wget $URL 
    2.33 +if [ ! -f $DEBPKG ]; then
    2.34 +	cd $CUR_DIR
    2.35 +	rm -rf $TEMP_DIR
    2.36 +	echo "Could not download $DEBPKG. Exiting."
    2.37 +	exit 1
    2.38 +fi
    2.39 +
    2.40 +# Install binutils(ar) pkg
    2.41 +if [ ! -d /var/lib/tazpkg/installed/binutils ]; then
    2.42 +    tazpkg get-install binutils
    2.43 +fi
    2.44 +if [ ! -f /usr/bin/ar ]; then
    2.45 +    cd $CUR_DIR
    2.46 +    rm -rf $TEMP_DIR
    2.47 +    echo "Could not extract $DEBPKG. Exiting."
    2.48 +    exit 1
    2.49 +fi
    2.50 +
    2.51 +ar x $DEBPKG data.tar.gz && tar xzf data.tar.gz
    2.52 +
    2.53 +# extracted pkg can be removed: Save RAM
    2.54 +rm -rf $DEBPKG
    2.55 +
    2.56 +mkdir -p $PACKAGE-$VERSION/fs/usr/
    2.57 +mv usr/bin usr/lib $PACKAGE-$VERSION/fs/usr/
    2.58 +
    2.59 +cd $TEMP_DIR
    2.60 +
    2.61 +cat > $PACKAGE-$VERSION/receipt << EOT
    2.62 +PACKAGE="$PACKAGE"
    2.63 +VERSION="$VERSION"
    2.64 +CATEGORY="non-free"
    2.65 +SHORT_DESC="A great way of getting web content onto paper."
    2.66 +DEPENDS=""
    2.67 +WEB_SITE="http://www.princexml.com/"
    2.68 +EOT
    2.69 +
    2.70 +# Pack
    2.71 +tazpkg pack $PACKAGE-$VERSION
    2.72 +
    2.73 +# Clean to save RAM memory
    2.74 +rm -rf $PACKAGE-$VERSION
    2.75 +
    2.76 +# Install pseudo package
    2.77 +yes y | tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT $FORCED
    2.78 +
    2.79 +# Clean
    2.80 +cd $CUR_DIR
    2.81 +rm -rf $TEMP_DIR