wok view get-foxit-reader/stuff/get-foxit-reader @ rev 7262
Up: foomatic-filters to 4.0.5.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Sun Nov 14 17:11:35 2010 +0000 (2010-11-14) |
parents | 32959e7975fc |
children | 53bf1ccff1a1 |
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
41 # extracted pkg can be removed: Save RAM
42 rm -rf $RPMPKG
44 mkdir -p $PACKAGE-$VERSION/fs
45 mv $TEMP_DIR/usr $PACKAGE-$VERSION/fs
46 cd $PACKAGE-$VERSION/fs/usr/share/applications/ && mv fedora-Foxit-Reader.desktop Foxit-Reader.desktop
48 cd $TEMP_DIR
50 cat > $PACKAGE-$VERSION/receipt << EOT
51 PACKAGE="$PACKAGE"
52 VERSION="$VERSION"
53 CATEGORY="non-free"
54 SHORT_DESC="A free PDF document viewer for the Linux platform."
55 DEPENDS="gtk+"
56 WEB_SITE="http://www.foxitsoftware.com/pdf/desklinux/"
57 EOT
59 # Pack
60 tazpkg pack $PACKAGE-$VERSION
62 # Clean to save RAM memory
63 rm -rf $PACKAGE-$VERSION
65 # Install pseudo package
66 yes y | tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
68 # Clean
69 cd $CUR_DIR
70 rm -rf $TEMP_DIR