wok-6.x rev 14507
Add get-src2pkg
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue May 14 07:26:31 2013 +0200 (2013-05-14) |
parents | 59474b1f63e3 |
children | 5273b8724d00 |
files | get-src2pkg/receipt get-src2pkg/stuff/get-src2pkg |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/get-src2pkg/receipt Tue May 14 07:26:31 2013 +0200 1.3 @@ -0,0 +1,16 @@ 1.4 +# SliTaz package receipt. 1.5 + 1.6 +PACKAGE="src2pkg" 1.7 +VERSION="1.00" 1.8 +CATEGORY="development" 1.9 +WEB_SITE="http://amigolinux.org" 1.10 +SHORT_DESC="Package-creation and conversion software" 1.11 +MAINTAINER="pascal.bellard@slitaz.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-src2pkg $fs/usr/bin 1.18 +} 1.19 +
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/get-src2pkg/stuff/get-src2pkg Tue May 14 07:26:31 2013 +0200 2.3 @@ -0,0 +1,40 @@ 2.4 +#!/bin/sh -e 2.5 + 2.6 +PACKAGE="src2pkg" 2.7 +WEB_SITE="http://distro.ibiblio.org/amigolinux/download/src2pkg" 2.8 + 2.9 +ROOT="$1" 2.10 +[ -d "$ROOT" ] || ROOT="" 2.11 + 2.12 +if test $(id -u) != 0 ; then 2.13 + echo -e "\nYou must be root to run `basename $0`." 2.14 + echo -e "Please type 'su' and root password to become super-user.\n" 2.15 + exit 0 2.16 +fi 2.17 + 2.18 +if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ]; then 2.19 + [ -n "$ROOT" ] && exit 1 2.20 + tazpkg remove $PACKAGE 2.21 + [ -d /var/lib/tazpkg/installed/$PACKAGE ] && exit 1 2.22 +fi 2.23 + 2.24 +TMP_DIR=/tmp/get-$PACKAGE-$$-$RANDOM 2.25 +CUR_DIR=$(pwd) 2.26 +mkdir -p $TMP_DIR && cd $TMP_DIR 2.27 + 2.28 +URL="$(wget -O - $WEB_SITE | sed '/src2pkg-/!d;s/.*href="\([^"]*\).*/\1/;q')" 2.29 +FILE="$(wget -O - $WEB_SITE/$URL | sed '/tazpkg/!d;s/.*href="\([^"]*\).*/\1/')" 2.30 +wget $WEB_SITE/$URL$FILE 2.31 + 2.32 +exit 2.33 + 2.34 +# Install pseudo package 2.35 +tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT 2.36 +case " $@ " in 2.37 +*\ --k*) mv $PACKAGE-$VERSION.tazpkg $CUR_DIR ;; 2.38 +esac 2.39 + 2.40 +# Clean 2.41 +cd $CUR_DIR 2.42 +rm -rf $TMP_DIR 2.43 +