wok view get-upx/stuff/get-upx @ rev 2636

Up: slitaz-base-files (change release string) + slitaz-doc for 2.0
author Christophe Lincoln <pankso@slitaz.org>
date Thu Apr 16 19:59:30 2009 +0200 (2009-04-16)
parents
children 32959e7975fc
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
29 # Extract
30 tar xjf $TARBALL
32 # Install files
33 dir=upx-$VERSION/fs/usr/bin
34 mkdir -p $dir
35 mv upx-$VERSION-i386_linux/upx $dir
37 # Create pseudo package
38 cat > upx-$VERSION/receipt <<EOT
39 PACKAGE="upx"
40 VERSION="$VERSION"
41 CATEGORY="non-free"
42 SHORT_DESC="Executable packer for several different executable formats."
43 WEB_SITE="$WEB_SITE"
44 EOT
46 # Pack
47 tazpkg pack upx-$VERSION
49 # Install pseudo package
50 tazpkg install upx-$VERSION.tazpkg --root=$ROOT
51 cd $BASE
53 # Clean
54 rm -rf $DIR $TARBALL