wok view get-foxit-reader/stuff/get-foxit-reader @ rev 3893

get-*: do not create empty packages
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Aug 14 10:01:38 2009 +0200 (2009-08-14)
parents 5b931c2fda37
children 0feddf601f07
line source
1 #!/bin/sh
3 # Get and install FoxitReader for Linux
5 PACKAGE="FoxitReader"
6 VERSION="1.0-1"
7 RPMPKG="$PACKAGE-$VERSION.i386.rpm"
8 URL="http://mirrors.foxitsoftware.com/pub/foxit/reader/desktop/linux/1.x/1.0/enu/$RPMPKG"
9 CUR_DIR=$(pwd)
10 TEMP_DIR=/tmp/$PACKAGE-$VERSION-$$
11 ROOT="$1"
13 # Check if we are root
14 if test $(id -u) != 0 ; then
15 echo -e "\nYou must be root to run `basename $0`."
16 echo -e "Please type 'su' and root password to become super-user.\n"
17 exit 1
18 fi
20 # Avoid reinstall
21 if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ]; then
22 echo -e "\n$PACKAGE package is already installed.\n"
23 exit 1
24 fi
26 # Create a TEMP_DIR
27 mkdir $TEMP_DIR
28 cd $TEMP_DIR
30 # Download the file
31 wget $URL
32 if [ ! -f $RPMPKG ]; then
33 cd $CUR_DIR
34 rm -rf $TEMP_DIR
35 echo "Could not download $RPMPKG. Exiting."
36 exit 1
37 fi
39 rpm2cpio $RPMPKG | cpio -dium
40 mkdir -p $PACKAGE-$VERSION/fs
41 mv $TEMP_DIR/usr $PACKAGE-$VERSION/fs
42 cd $PACKAGE-$VERSION/fs/usr/share/applications/ && mv fedora-Foxit-Reader.desktop Foxit-Reader.desktop
44 cd $TEMP_DIR
46 cat > $PACKAGE-$VERSION/receipt << EOT
47 PACKAGE="$PACKAGE"
48 VERSION="$VERSION"
49 CATEGORY="non-free"
50 SHORT_DESC="A free PDF document viewer for the Linux platform."
51 DEPENDS="gtk+"
52 WEB_SITE="http://www.foxitsoftware.com/pdf/desklinux/"
53 EOT
55 # Pack
56 tazpkg pack $PACKAGE-$VERSION
58 # Install pseudo package
59 yes y | tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
61 # Clean
62 cd $CUR_DIR
63 rm -rf $TEMP_DIR