wok-stable view get-libstdc++5/stuff/get-libstdc++5 @ rev 8833
Fix: tazdev receipt
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Thu Feb 24 16:18:46 2011 +0100 (2011-02-24) |
parents | 32959e7975fc |
children |
line source
1 #!/bin/sh -e
3 ROOT="$1"
4 PACKAGE=${0#*get-}
6 if test $(id -u) != 0 ; then
7 echo -e "\nYou must be root to run `basename $0`."
8 echo -e "Please type 'su' and root password to become super-user.\n"
9 exit 0
10 fi
12 if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ]; then
13 [ -n "$ROOT" ] && exit 1
14 tazpkg remove $PACKAGE
15 [ -d /var/lib/tazpkg/installed/$PACKAGE ] && exit 1
16 fi
18 dl_urls()
19 {
20 wget -O - http://packages.debian.org/stable/i386/libstdc++5/download \
21 2> /dev/null | grep _i386.deb | grep 'tp://' | \
22 sed 's/.*<a href="\(.*\).deb">.*/\1.deb/'
23 }
25 WEB_SITE="http://gcc.gnu.org/"
27 TMP_DIR=/tmp/get-$PACKAGE-$$-$RANDOM
28 CUR_DIR=$(pwd)
29 mkdir -p $TMP_DIR && cd $TMP_DIR
31 # Download tarball
32 for i in $(dl_urls); do
33 DEB=$(basename $i)
34 wget $i && break
35 done
36 if [ ! -f $DEB ]; then
37 cd $CUR_DIR
38 rm -rf $TMP_DIR
39 echo "Could not download $DEB. Exiting."
40 exit 1
41 fi
43 VERSION=$(echo $DEB | sed 's/.*_\(.*\)_.*/\1/')
45 # Install files
46 mkdir -p $PACKAGE-$VERSION/fs
47 dpkg-deb -x $DEB $PACKAGE-$VERSION/fs
48 rm -rf $PACKAGE-$VERSION/fs/usr/share
50 # extracted pkg can be removed: Save RAM
51 rm -rf $DEB
53 # Create pseudo package
54 cat > $PACKAGE-$VERSION/receipt <<EOT
55 # SliTaz package receipt.
57 PACKAGE="$PACKAGE"
58 VERSION="$VERSION"
59 CATEGORY="development"
60 SHORT_DESC="Obsolate GNU C++ library."
61 WEB_SITE="$WEB_SITE"
62 EOT
64 # Pack
65 tazpkg pack $PACKAGE-$VERSION
67 # Clean to save RAM memory
68 rm -rf $PACKAGE-$VERSION
70 # Install pseudo package
71 tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
73 # Clean
74 cd $CUR_DIR
75 rm -rf $TMP_DIR