wok-current rev 3883

Add get-wink
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Aug 11 19:27:05 2009 +0200 (2009-08-11)
parents 151703776792
children 9028b16098a8
files get-wink/receipt get-wink/stuff/get-wink
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/get-wink/receipt	Tue Aug 11 19:27:05 2009 +0200
     1.3 @@ -0,0 +1,16 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="get-wink"
     1.7 +VERSION="1.00"
     1.8 +CATEGORY="non-free"
     1.9 +SHORT_DESC="Get a Tutorial and Presentation creation software."
    1.10 +MAINTAINER="pascal.bellard@slitaz.org"
    1.11 +WEB_SITE="http://www.debugmode.com/wink/"
    1.12 +
    1.13 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.14 +genpkg_rules()
    1.15 +{
    1.16 +	mkdir -p $fs/usr/bin
    1.17 +	cp stuff/get-wink $fs/usr/bin
    1.18 +}
    1.19 +
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/get-wink/stuff/get-wink	Tue Aug 11 19:27:05 2009 +0200
     2.3 @@ -0,0 +1,73 @@
     2.4 +#!/bin/sh -e
     2.5 +
     2.6 +ROOT="$1"
     2.7 +PACKAGE=${0#*get-}
     2.8 +
     2.9 +if test $(id -u) != 0 ; then
    2.10 +	echo -e "\nYou must be root to run `basename $0`."
    2.11 +	echo -e "Please type 'su' and root password to become super-user.\n"
    2.12 +	exit 0
    2.13 +fi
    2.14 +
    2.15 +if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ]; then
    2.16 +  [ -n "$ROOT" ] && exit 1
    2.17 +  tazpkg remove $PACKAGE
    2.18 +  [ -d /var/lib/tazpkg/installed/$PACKAGE ] && exit 1
    2.19 +fi
    2.20 +[ -d $ROOT/usr/share/$PACKAGE ] && rm -rf $ROOT/usr/share/$PACKAGE
    2.21 +
    2.22 +dl_urls()
    2.23 +{
    2.24 +   wget -O - http://www.debugmode.com/wink/download.php 2> /dev/null | \
    2.25 +   	grep gz | sed 's/.*<a href=\(.*\)gz>.*/\1gz/'
    2.26 +}
    2.27 +
    2.28 +WEB_SITE="http://www.debugmode.com/wink/"
    2.29 +
    2.30 +TMP_DIR=/tmp/get-$PACKAGE-$$-$RANDOM
    2.31 +CUR_DIR=$(pwd)
    2.32 +mkdir -p $TMP_DIR && cd $TMP_DIR
    2.33 +
    2.34 +# Download tarball
    2.35 +for i in $(dl_urls); do
    2.36 +	TARBALL=$(basename $i)
    2.37 +	wget $i && break
    2.38 +done
    2.39 +
    2.40 +VERSION=${TARBALL%.*}
    2.41 +VERSION=${VERSION%.tar}
    2.42 +VERSION=${VERSION#wink}
    2.43 +
    2.44 +# Extract
    2.45 +tar xzf $TARBALL
    2.46 +
    2.47 +# Install files
    2.48 +mkdir -p $PACKAGE-$VERSION/fs/usr/share/$PACKAGE $PACKAGE-$VERSION/fs/usr/bin
    2.49 +tar xzf installdata.tar.gz -C $PACKAGE-$VERSION/fs/usr/share/$PACKAGE
    2.50 +cat > $PACKAGE-$VERSION/fs/usr/bin/$PACKAGE <<EOT
    2.51 +#!/bin/sh
    2.52 +exec $PACKAGE-$VERSION/fs/usr/share/$PACKAGE/$PACKAGE "$@"
    2.53 +EOT
    2.54 +chmod +x $PACKAGE-$VERSION/fs/usr/bin/$PACKAGE
    2.55 +
    2.56 +# Create pseudo package
    2.57 +cat > $PACKAGE-$VERSION/receipt <<EOT
    2.58 +# SliTaz package receipt.
    2.59 +
    2.60 +PACKAGE="$PACKAGE"
    2.61 +VERSION="$VERSION"
    2.62 +CATEGORY="non-free"
    2.63 +SHORT_DESC="Tutorial and Presentation creation software."
    2.64 +WEB_SITE="$WEB_SITE"
    2.65 +DEPENDS="gtk+ atk pango glib xorg-libXi xorg-libXext xorg-libX11 libstdc++5"
    2.66 +EOT
    2.67 +
    2.68 +# Pack
    2.69 +tazpkg pack $PACKAGE-$VERSION
    2.70 +
    2.71 +# Install pseudo package
    2.72 +tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
    2.73 +
    2.74 +# Clean
    2.75 +cd $CUR_DIR
    2.76 +rm -rf $TMP_DIR