wok-next rev 3882
Add get-libstdc++5
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Aug 11 19:26:46 2009 +0200 (2009-08-11) |
parents | e0ab48bc2f28 |
children | a6c803aa430e |
files | get-libstdc++5/receipt get-libstdc++5/stuff/get-libstdc++5 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/get-libstdc++5/receipt Tue Aug 11 19:26:46 2009 +0200 1.3 @@ -0,0 +1,16 @@ 1.4 +# SliTaz package receipt. 1.5 + 1.6 +PACKAGE="get-libstdc++5" 1.7 +VERSION="1.00" 1.8 +CATEGORY="development" 1.9 +SHORT_DESC="Get Obsolate GNU C++ library." 1.10 +MAINTAINER="pascal.bellard@slitaz.org" 1.11 +WEB_SITE="http://gcc.gnu.org/" 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-libstdc++5 $fs/usr/bin 1.18 +} 1.19 +
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/get-libstdc++5/stuff/get-libstdc++5 Tue Aug 11 19:26:46 2009 +0200 2.3 @@ -0,0 +1,63 @@ 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 + 2.21 +dl_urls() 2.22 +{ 2.23 + wget -O - http://packages.debian.org/stable/i386/libstdc++5/download \ 2.24 + 2> /dev/null | grep _i386.deb | grep 'tp://' | \ 2.25 + sed 's/.*<a href="\(.*\).deb">.*/\1.deb/' 2.26 +} 2.27 + 2.28 +WEB_SITE="http://gcc.gnu.org/" 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 + DEB=$(basename $i) 2.37 + wget $i && break 2.38 +done 2.39 + 2.40 +VERSION=$(echo $DEB | sed 's/.*_\(.*\)_.*/\1/') 2.41 + 2.42 +# Install files 2.43 +mkdir -p $PACKAGE-$VERSION/fs 2.44 +dpkg-deb -x $DEB $PACKAGE-$VERSION/fs 2.45 +rm -rf $PACKAGE-$VERSION/fs/usr/share 2.46 + 2.47 +# Create pseudo package 2.48 +cat > $PACKAGE-$VERSION/receipt <<EOT 2.49 +# SliTaz package receipt. 2.50 + 2.51 +PACKAGE="$PACKAGE" 2.52 +VERSION="$VERSION" 2.53 +CATEGORY="development" 2.54 +SHORT_DESC="Obsolate GNU C++ library." 2.55 +WEB_SITE="$WEB_SITE" 2.56 +EOT 2.57 + 2.58 +# Pack 2.59 +tazpkg pack $PACKAGE-$VERSION 2.60 + 2.61 +# Install pseudo package 2.62 +tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT 2.63 + 2.64 +# Clean 2.65 +cd $CUR_DIR 2.66 +rm -rf $TMP_DIR