wok-current view get-upx/stuff/get-upx @ rev 5147
samba: fix depends.
author | Eric Joseph-Alexandre <erjo@slitaz.org> |
---|---|
date | Tue Mar 23 23:55:44 2010 +0100 (2010-03-23) |
parents | 32959e7975fc |
children | afe3762cd9dc |
line source
1 #!/bin/sh -e
3 ROOT="$1"
4 VERSION="3.03"
5 TARBALL="upx-$VERSION-i386_linux.tar.bz2"
6 WEB_SITE="http://upx.sourceforge.net/"
7 WGET_URL="${WEB_SITE}download/$TARBALL"
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/upx ]; then
16 [ -n "$ROOT" ] && exit 1
17 tazpkg remove upx
18 [ -d /var/lib/tazpkg/installed/upx ] && exit 1
19 fi
21 BASE=$PWD
22 DIR=/tmp/$0-$$
23 mkdir -p $DIR
24 cd $DIR
26 # Download tarball
27 wget $WGET_URL
28 if [ ! -f $TARBALL ]; then
29 cd $BASE
30 rm -rf $DIR
31 echo "Could not download $TARBALL. Exiting."
32 exit 1
33 fi
35 # Extract
36 tar xjf $TARBALL
38 # extracted pkg can be removed: Save RAM before packing
39 rm -rf $TARBALL
41 # Install files
42 dir=upx-$VERSION/fs/usr/bin
43 mkdir -p $dir
44 mv upx-$VERSION-i386_linux/upx $dir
46 # Create pseudo package
47 cat > upx-$VERSION/receipt <<EOT
48 PACKAGE="upx"
49 VERSION="$VERSION"
50 CATEGORY="non-free"
51 SHORT_DESC="Executable packer for several different executable formats."
52 WEB_SITE="$WEB_SITE"
53 EOT
55 # Pack
56 tazpkg pack upx-$VERSION
58 # Clean to save RAM memory
59 rm -rf upx-$VERSION
61 # Install pseudo package
62 tazpkg install upx-$VERSION.tazpkg --root=$ROOT
63 cd $BASE
65 # Clean
66 rm -rf $DIR $TARBALL