wok-next view get-nz/stuff/get-nz @ rev 12816
gpm: cross compile for ARM
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Mon May 21 01:38:41 2012 +0200 (2012-05-21) |
parents | |
children |
line source
1 #!/bin/sh -e
3 PACKAGE="nz"
4 WGET_URL="http://nanozip.net/"
5 SHORT_DESC="Experimental file archiver"
6 ROOT="$1"
7 [ -d "$ROOT" ] || ROOT=""
9 if test $(id -u) != 0 ; then
10 echo -e "\nYou must be root to run `basename $0`."
11 echo -e "Please type 'su' and root password to become super-user.\n"
12 exit 0
13 fi
15 if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ]; then
16 [ -n "$ROOT" ] && exit 1
17 tazpkg remove $PACKAGE
18 [ -d /var/lib/tazpkg/installed/$PACKAGE ] && exit 1
19 fi
21 TMP_DIR=/tmp/get-$PACKAGE-$$-$RANDOM
22 CUR_DIR=$(pwd)
23 mkdir -p $TMP_DIR && cd $TMP_DIR
25 VERSION="$(wget -O - http://nanozip.net/download.html | sed 's/>/>\n/g' | \
26 sed '/linux32/!d;s/.*href=nanozip-\(.*\).linux32.*/\1/;q')"
27 TARBALL="nanozip-$VERSION.linux32.zip"
28 wget ${WGET_URL}$TARBALL
30 if [ ! -f $TARBALL ]; then
31 cd $CUR_DIR
32 rm -rf $TMP_DIR
33 echo "Could not download $TARBALL from $WGET_URL. Exiting."
34 exit 1
35 fi
37 unzip $TARBALL nz
38 mkdir -p $PACKAGE-$VERSION/fs/usr/bin
39 chmod +x nz
40 mv nz $PACKAGE-$VERSION/fs/usr/bin
42 cat > $PACKAGE-$VERSION/receipt <<EOT
43 PACKAGE="$PACKAGE"
44 VERSION="$VERSION"
45 CATEGORY="non-free"
46 SHORT_DESC="$SHORT_DESC"
47 WEB_SITE="$WEB_SITE"
48 EOT
50 # Pack
51 tazpkg pack $PACKAGE-$VERSION
53 # Clean to save RAM memory
54 rm -rf $PACKAGE-$VERSION
56 # Install pseudo package
57 tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
58 case " $@ " in
59 *\ --k*) mv $PACKAGE-$VERSION.tazpkg $CUR_DIR ;;
60 esac
62 # Clean
63 cd $CUR_DIR
64 rm -rf $TMP_DIR