Desktop Icon Doesn't work.


Forum: Apps
Topic: Desktop Icon Doesn't work.
started by: Headly

Posted by Headly on Oct. 22 2005,06:40
Hi Everyone,
I have been working on getting Gpsdrive to compile and install on DSL for some time. :)  I have it almost working.  I can start it from the command line no problem.

I have created the fille /home/dsl/.xtdesktop/Gpsdrive.lnk
I'm not sure what the permissions are supposed to be for the files in this folder so I set them to rwxrxrx dsl staff  (also tried chmod 777)

Here is the contents of Gpsdrive.lnk
The icon is displayed on the desktop no problem but double clicking doesn't do anything in particular.

Any Ideas?


David
(Headly)

Code Sample

table Icon
 Type: Program
 Caption: GpsDrive
 Command: LD_LIBRARY_PATH=/opt/gpsdrive/lib /opt/gpsdrive/bin/gpsdirve
 Icon: /home/dsl/.xtdesktop/Gpsdrive.gif
 X: 218
 Y: 82
end


Posted by mikshaw on Oct. 22 2005,16:19
Practically nothing (except tmp directories) should be chmod'ed 777 unless you don't care about security at all.  Typically, non-executable personal files are one of these: 644 (read-write by owner, read-only by everyone else), 664 (read-write by owner and group, read-only by everyone else), or 600 (read-write by owner, unreadable by everyone else).  There are other combinations you can use, like 640 or 660, depending on the specific permissions you want.  If it's a directory or executable, add 1 to each digit except zero (644 becomes 755, 600 becomes 700).
The specifics:
first digit = file's owner
second = file's group
third = everyone else
0 = no permission
4 = read-only
5 = read and execute ('execute' = 'enter' for directories)
6 = read and write
7 = read, write and execute
Other numbers can be used but are not used because they are pointless...in order to execute a file you need to be able to read it, so making a file executable but not readable is useless.

Your icon looks fine to me (except for the 'gpsdirve' typo), but maybe xtdesk has trouble with the way the variable is set.  One thing that might help is to set the LD_LIBRARY_PATH from a wrapper script instead of the icon.  Say you made a script called /opt/gpsdrive/start_gpsdrive (chmod 755) and put that script in the icon instead.
The script would just be something like this:
Code Sample
#!/bin/bash
LD_LIBRARY_PATH=/opt/gpsdrive/lib /opt/gpsdrive/bin/gpsdrive

or
Code Sample
#!/bin/bash
export LD_LIBRARY_PATH=/opt/gpsdrive/lib
exec /opt/gpsdrive/bin/gpsdrive


Doing it that way will also help from terminal, since you just have to run the script itself rather than setting the variable every time.

Another possibility....Is this an interactive application without a gui? If so you would need to start it in a terminal (aterm -e /opt/gpsdrive/start_gpsdrive)

Posted by Headly on Oct. 22 2005,22:48
Hi Mikshaw,
Thanks for the lengthy reply.  When I saw the typo I thought that was going to be it for sure.  But it didn't fix it.  I made a wrapper script as you sugested and tested it from the command line and it works from there but my icon still does the same thing.  It flashes once the cpu goes to 3% and straight back to zero.  This makes me think it is actually doing something.  I'm wondering if it is generating an error message and sending it to the big bit bucket on the floor.

It is a gui application.  It reads data from a gps and displays your location on a moving map on the screen.  I think it will be nifty if I can sought out a few more glitches.  (I'm just going through them one at a time :) ). I have dummied up a simulated GPS on another machine and I have it driving around my neighbourhood and GPS drive is following it around so I'm almost there.

Once I get it to a stable state I'd like to post it on DSL somewhere to let some other people have a play with it.  It is a .tar.gz and it writes everything to /opt/gpsdrive except for the icon stuff (I think).  It is a little huge with the zip being around 30mb but with some help I think it can be trimmed a bit.  I read some stuff on the wiki about asking for ftp access.  Do you know who I should contact about that?

Thanks again for your help.

David (Headly)

Posted by Headly on Oct. 22 2005,23:03
UPDATE.
I just put some simple loging in my start.sh wrapper so that if put some output into a file.

When run from the desktop icon it doesn't even call it.

I get the feeling I'm missing something obvious.

Dave

Posted by mikshaw on Oct. 23 2005,02:13
I can't think what the problem might be.  It works from the commandline, but the same command does not work from the icon.  Does it work from the fluxbox menu?
Posted by Headly on Oct. 23 2005,06:51
I'm not sure what a fluxbox is.  I'm assuming it is the right click on the desktop that brings up the menu.  If so, I haven't created a menu item.  As I plan to use this in my car with a touch screen I'm not sure if the menu will be accessible.

In any case I think I might have figured it out.  Using the "Hello World" principle of debuging I copied an existing .lnk file and created a shell script that just wrote to a log file and nothing else.  One by one I changed things and tested it between every change.

Those little .lnk files are touchy little begers :)
One character out of place and nothing happens.  I made one mistake along the way and I had it so that no icons would come up at all.

I haven't rebuilt the pachage yet to do a full end to end test but so far it is looking like it is going to work.

Thanks again for your help with this.

David
(Headly)

Posted by mikshaw on Oct. 23 2005,15:06
Fluxbox is the name of the Window manager (graphical interface) that DSL uses...it controls the position, size, and decoration of windows, toolbar and menu, and has that box of apps on the right side (the slit).

Yes the icons are touchy little things.  I've seen some stupid problems with them, but until now had never seen an error that would allow display of the icon but prevent its use.

Posted by ctcurtis on Nov. 05 2005,16:34
Any updates on getting gpsDrive to work?  Can you post the application, or at least the steps you took to get it to work properly.
Posted by crusadingknight on Nov. 05 2005,22:58
EDIT: Oops.
Posted by Headly on Nov. 06 2005,04:32
I have got their last stable version 2.09 to work.
I think it is about a year and a half old and lots of development work as gone into it since then.  I'm currently working on compiling their latest CVS version but there are some more compile problems that I'm working on.

It came out faily big (28mb) as I had to include all the gtk+ stuff in the archive.  Only because I don't know of a better way to do it.

I'm willing to make the version available for testing purposes so long as everyone knows it is a work in progress.

I'm not sure where / how to post this kind of thing here on the DSL site.   Any suggestions.

David

Posted by Headly on Nov. 06 2005,05:24
For those who are interested here are my current build scripts for gpsdrive.  These are for the latest CVS versions of gpsdrive.  I assume they will still work for 2.09 but I haven't tried it.  Anyone interested should also visit the nice people at < http://gpsdrive.cc > and read all about the package and what it does.

This build process is still work in progress and currently the compile doesn't succeed and fails during the make process of Gpsdrive.  If you can figure out why I'm all ears. :)  I'm still working on it.

I have been running the scripts below on Knoppix (boot from cd) as I couldn't get all the build stuff to work on DSL.  I'm told they should be binary compatible and execute no problem when installed on DSL.  

As Knoppix runs from RAM disk I couldn't get it to run on a system with 256Mb of RAM.  But 512mb is ok.  It doesn't crash or give an error it just never completes.

You compile each package using build.sh (see below) or just run everything.sh (which calls build.sh many times) to build the lot.  It takes about one and a half hours on my little 800mhz beast.

Build.sh outputs a "0" at each successfull stage and something else if it fails.  The output from the compile process goes to .log files one for each package.  I also capture the configure --help output that shows all the different switches available that will come in handy when we try and cut down the size of this.

I haven't botherd to make the script exit on failure it just presses on so it is important to scroll back and see where the first problem occured.  You will need to change around the variables at the top of each file to suit your system depending on your file system and where you decide to put things along the way.

Don't forget each time you reboot you will need to stat the build from the begining as it is in memory it is all lost on shutdown.

There is a section in build.sh that removes many of the non esiental files like man pages etc and then it builds the .tar.gz file and places it on my usb key.  The whole lot when installed to DSL is contained in /opt/gpsdrive except for the Desktop Icon (I think). So I think it will qualify for one of those "green" ratings if it gets published on DSL's site.  

There are comments in the scripts but just ask if it isn't clear what they do.  I know my scripts are LAME and there are more efficient ways of doing this but when I started I had no idea how big they would become or how similar each of the different packages are.

These are the required packages.  They should be easy to find and download as they are all very popular things.
I think if you find newer versions they should work too.

atk-1.10.1.tar.gz
cairo-1.0.2.tar.gz
expat-1.95.8.tar.gz
fontconfig-2.3.2.tar.gz
freetype-2.1.10.tar.gz
gettext-0.14.5.tar.gz
glib-2.8.1.tar.gz
gtk+-2.8.3.tar.gz
pango-1.10.0.tar.gz
pkg-config-0.19.tar.gz
autoconf-2.59.tar.gz
automake-1.9.6.tar.gz

And

gpsdrive-2.10pre3.tar.gz

Use this copy of gpsdrive if you don't want to use CVS but they should be almost identical anyway on build.sh will download the latest CVS version when you run it anyway.

BTW the CVS download stops and waits for you to enter a password.  There is no password just press return.  I couldn't figure out how to send a CR automatically.



everything.sh
==================

mount /dev/hda2         # Knoppix on car computer with usbkey
# mount /dev/hda5 # Knoppic on notebook and 2nd partition

# echo Compiling Autoconf
./build.sh autoconf /usr        # This will install programs to /usr/bin

echo Compiling Automake
./build.sh automake /usr        # This will install programs to /usr/bin

# echo Compiling pkgconfig
# Not required on Knoppix
# ./build.sh pkgconfig

# echo Compiling gettext
# Not required on Knoppix
# ./build.sh gettext

# NOTE:
# I can't figure out how to get the library path stuff to work properly.
# To work around this I have compiled the packages once into their standard
# location so that ./configure can find them and the again into /opt/gpsdrive
# which will be the defalut location on DSL
#
# Note when starting the package on DSL use the following command line.
# LD_LIBRARY_PATH=/opt/gpsdrive/lib /opt/gpsdrive/bin/gpsdrive

echo Compiling glib
./build.sh glib /usr
./build.sh glib /opt/gpsdrive

echo Compiling freetype
./build.sh freetype /opt/gpsdrive

echo Compiling expat
./build.sh expat /opt/gpsdrive

echo Compiling fontconfig
./build.sh fontconfig /opt/gpsdrive

echo Compiling atk
./build.sh atk /usr
./build.sh atk /opt/gpsdrive

echo compiling cairo
./build.sh cairo /usr
./build.sh cairo /opt/gpsdrive

echo compiling pango
./build.sh pango /usr
./build.sh pango /opt/gpsdrive

echo compiling gtk
./build.sh gtk /usr
./build.sh gtk /opt/gpsdrive

echo Update CVS gpsdrive
./build.sh cvsupdate

echo compiling GPSDrive
# ./build.sh gpsdrive /opt/gpsdrive tar     #build from the tar file
./build.sh gpsdrive /opt/gpsdrive           #build from the cvs source

# echo Moving executables onto Hard Disk
./build.sh cpy

# echo Building the gpsdrive.tar.gz package
./build.sh package





Build.sh
=============
################################################################
# This script is called from everything.sh
# D. Pollard
#
################################################################
USB=sda1           # Usb key
#
LOGFILE=/mnt/$USB/$1.log
CONFIGHELP=/mnt/$USB/$1-help.txt
UNPACK=/mnt/hda2/unpack
# UNPACK=/mnt/hda5/unpack
DEST=$2
BUILDFROM=$3
# WORK=/mnt/hda2/work
WORK=/work
#
echo "================================================================" > $LOGFILE
echo $1 >> $LOGFILE
date >> $LOGFILE
echo "================================================================" >> $LOGFILE

# export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH=/usr/lib/pkgconfig
     
##############################################################
# Autoconf  
##############################################################
# Reuired for the build
# Version 1.79 comes with knoppix and 1.9 is required to build
# gpsdrive.  Current version appears to be 2.5
if [ "$1" == "autoconf"  ]
then
cd $UNPACK
mkdir autoconf
cd autoconf
tar -xvzf /mnt/$USB/source/autoconf-2.59.tar.gz >> $LOGFILE 2>&1
echo "    unpack status " $?
cd autoconf-2.59
./configure --help > $CONFIGHELP
./configure --prefix=$DEST >> $LOGFILE 2>&1
echo "    Configure status " $?
make clean >> $LOGFILE 2>&1
echo "    Make Clean Status " $?
make >> $LOGFILE 2>&1
echo "    Make Status " $?
make install >> $LOGFILE 2>&1
echo "    Make install staus " $?
cd $UNPACK
rm -rf autoconf >> $LOGFILE 2>&1
fi
##############################################################
# Automake
##############################################################
# Required for the build.
# Version 1.79 comes with knoppis and 1.9 is required to build
# gpsdrive.  Current version appears to be 1.96
if [ "$1" == "automake"  ]
then
cd $UNPACK
mkdir automake
cd automake
tar -xvzf /mnt/$USB/source/automake-1.9.6.tar.gz >> $LOGFILE 2>&1
echo "    unpack status " $?
cd automake-1.9.6
./configure --help > $CONFIGHELP
./configure --prefix=$DEST >> $LOGFILE 2>&1
echo "    Configure status " $?
make clean >> $LOGFILE 2>&1
echo "    Make Clean Status " $?
make >> $LOGFILE 2>&1
echo "    Make Status " $?
make install >> $LOGFILE 2>&1
echo "    Make install staus " $?
cd $UNPACK
rm -rf automake >> $LOGFILE 2>&1
fi


##############################################################
# Pkgconfig
##############################################################
# Requied for the build on DSL (not for the runtime)

if [ "$1" == "pkgconfig" ]
then
cd $UNPACK
mkdir pkgconfig
cd pkgconfig
tar -xvzf /mnt/$USB/source/pkg-config-0.19.tar.gz >> $LOGFILE 2>&1
echo "    unpack status " $?
cd pkg-config-0.19
./configure --help > $CONFIGHELP
./configure >> $LOGFILE 2>&1
echo "    Configure status " $?
make clean >> $LOGFILE 2>&1
echo "    Make clean status "$?
make >> $LOGFILE 2>&1
echo "    Make status " $?
make install >> $LOGFILE 2>&1
echo "    Make Install Status "$?
cd $UNPACK
rm -rf pkgconfig >> $LOGFILE 2>&1
fi
##############################################################
# Gettext
##############################################################
# Required for the build on DSL (not for the runtime)

if [ "$1" ==  "gettext" ]
then
cd $UNPACK
mkdir gettext
cd gettext
tar -xvzf /mnt/$USB/source/gettext-0.14.5.tar.gz >> $LOGFILE 2>&1
echo "    unpack status " $?
cd gettext-0.14.5
./configure --help > $CONFIGHELP
./configure >> $LOGFILE 2>&1
echo "    Configure status " $?
make clean >> $LOGFILE 2>&1
echo "    Make clean status " $?
make >> $LOGFILE 2>&1
echo "    Make status " $?
make install >> $LOGFILE 2>&1
echo "    Make Install Status " $?
cd $UNPACK
rm -rf gettext >> $LOGFILE 2>&1
fi
##############################################################
# Glib
##############################################################
# It looks like glib is alrdady part of Knoppix but it is not in DSL
# Required for the runtime (not for the build)  I think

if [ "$1" == "glib" ]
then
       cd $UNPACK
       mkdir glib
       cd glib
       tar -xvzf /mnt/$USB/source/glib-2.8.1.tar.gz >> $LOGFILE 2>&1
echo "    Unpack Status" $?
       cd glib-2.8.1
./configure --help >  $CONFIGHELP
       ./configure --prefix=$DEST >> $LOGFILE 2>&1
       echo "    Configure Status" $?
       make clean >> $LOGFILE 2>&1
echo "    Make Clean Status" $?
       make >> $LOGFILE 2>&1
echo "    Make Status" $?
       make install >> $LOGFILE 2>&1
echo "    Make Install Status" $?
cd $UNPACK
       rm -rf glib >> $LOGFILE 2>&1
       exit 0
fi
##############################################################
# Freetype
##############################################################
# Required by atk and cairo for the run time
if [ "$1" == "freetype" ]
then
cd $UNPACK
mkdir freetype
cd freetype
tar -xvzf /mnt/$USB/source/freetype-2.1.10.tar.gz >> $LOGFILE 2>&1
echo "   Unpack Status" $?
cd freetype-2.1.10
chmod -R 777 * >> $LOGFILE 2>&1
echo "   Chmod Status" $?
./configure --help > $CONFIGHELP
./configure --prefix=$DEST >> $LOGFILE 2>&1
echo "   Configure Status" $?
make clean >> $LOGFILE 2>&1
echo "   Make Clean Status" $?
make >> $LOGFILE 2>&1
echo "Make Status" $?
make install >> $LOGFILE 2>&1
echo "   Make Install Status" $?
cd $UNPACK
rm -rf freetype >> $LOGFILE 2>&1
exit 0
fi
##############################################################
# Expat
##############################################################
# Required by fontconfig
if [ "$1" == "expat" ]
then
cd $UNPACK
mkdir expat
cd expat
tar -xvzf /mnt/$USB/source/expat-1.95.8.tar.gz >> $LOGFILE 2>&1
echo "   Unpack Status" $?
cd expat-1.95.8
./configure --help > $CONFIGHELP
./configure --prefix=$DEST >> $LOGFILE 2>&1
echo "   Config status" $?
make clean >> $LOGFILE 2>&1
echo "  Make Clean Status" $?
make >> $LOGFILE 2>&1
echo "   Make Status" $?
make install >> $LOGFILE 2>&1
echo "   Make Install Staus" $?
cd $UNPACK
rm -rf expat >> $LOGFILE 2>&1
exit 0
fi
##############################################################
# Fontconfig
##############################################################
# Required by atk for the run time
if [ "$1" == "fontconfig" ]
then
cd $UNPACK
mkdir fontconfig
cd fontconfig
tar -xvzf /mnt/$USB/source/fontconfig-2.3.2.tar.gz >> $LOGFILE 2>&1
echo "   Unpack Status" $?
cd fontconfig-2.3.2
./configure --help >  $CONFIGHELP
echo "-------------- Configure starts here ---------------" >> $LOGFILE
./configure --prefix=$DEST >> $LOGFILE 2>&1
echo "   Configure Status" $?
echo "-------------- Make clan starts here ---------------" >> $LOGFILE
make clean >> $LOGFILE 2>&1
echo "   Make Clean Status" $?
echo "--------------- Make starts here ----------------" >> $LOGFILE
make -j1 >> $LOGFILE 2>&1
echo "   Make status" $?
echo "--------------- Make Install starts here ------------------" >> $LOGFILE
# fix permission problem
chmod 777 -R /usr/share/fonts >> $LOGFILE
make install >> $LOGFILE 2>&1
echo "   Make Install Status" $?
cd $UNPACK
rm -rf fontcontig >> $LOGFILE 2>&1
exit 0
fi
##############################################################
# Freetype
##############################################################
# Required for the runtime (not for the build)
# This package requires the following packages
#    freetype
#    fontconfig

if [ "$1" == "atk" ]
then
ldconfig            # need this line so glib can be found
cd $UNPACK
mkdir atk
cd atk
tar -xvzf /mnt/$USB/source/atk-1.10.1.tar.gz >> $LOGFILE 2>&1
echo "    Unpack Status" $?
cd atk-1.10.1
./configure --help > $CONFIGHELP
./configure --prefix=$DEST >> $LOGFILE 2>&1
echo "    Configure Status" $?
make clean >> $LOGFILE 2>&1
echo "    Make Clean Status" $?
make >> $LOGFILE 2>&1
echo "    Make Status" $?
make install >> $LOGFILE 2>&1
echo "    Make Install Status" $?
cd $UNPACK
rm -rf atk >> $LOGFILE 2>&1
       exit 0
fi

###############################################################
# Pango
###############################################################
# Required for the runtime

if [ "$1" == "pango" ]
then
cd $UNPACK
mkdir pango
cd pango
tar -xvzf /mnt/$USB/source/pango-1.10.0.tar.gz >> $LOGFILE 2>&1
echo "    Unpack Status" $?
cd pango-1.10.0
./configure --help > $CONFIGHELP
./configure --prefix=$DEST >> $LOGFILE 2>&1
echo "    Configure Status" $?
make clean >> $LOGFILE 2>&1
echo "    Make Clean Status" $?
make >> $LOGFILE 2>&1
echo "    Make Status" $?
make install >> $LOGFILE 2>&1
echo "    Make Install Status" $?
cd $UNPACK
rm -rf pango >> $LOGFILE 2>&1
exit 0
fi
###############################################################
# Cairo
###############################################################
# Required for the runtime

if [ "$1" == "cairo" ]
then
cd $UNPACK
mkdir cairo
cd cairo
tar -xvzf /mnt/$USB/source/cairo-1.0.2.tar.gz >> $LOGFILE 2>&1
echo "    Unpack Status" $?
cd cairo-1.0.2 >> $LOGFILE 2>&1
./configure --help > $CONFIGHELP
./configure --prefix=$DEST --disable-ps --disable-pdf  >> $LOGFILE 2>&1
echo "    Configure Status" $?
make clean >> $LOGFILE 2>&1
echo "    Make Clean Status" $?
# -j1 limit the number of concurrent jobs to one.
# work around for "libtool link error Object Name Conflicts.
make -j 1 --keep-going >> $LOGFILE 2>&1
echo "    Make Status" $?
make install >> $LOGFILE 2>&1
echo "    Make Install Status" $?
cd $UNPACK
rm -rf cairo >> $LOGFILE 2>&1
exit 0
fi
###############################################################
# Gtk
###############################################################
# Required for the runtime

if [ "$1" == "gtk" ]
then
cd $UNPACK
mkdir gtk
cd gtk
tar -xvzf /mnt/$USB/source/gtk+-2.8.3.tar.gz >> $LOGFILE 2>&1
echo "    Unpack Status" $?
cd gtk+-2.8.3
./configure --help > $CONFIGHELP
./configure --prefix=$DEST >> $LOGFILE 2>&1
echo "    Configure Status" $?
make clean >> $LOGFILE 2>&1
echo "    Make Clean Status" $?
make >> $LOGFILE 2>&1
echo "    Make Status" $?
make install >> $LOGFILE 2>&1
echo "    Make Install Status" $?
cd $UNPACK
rm -rf gtk >> $LOGFILE 2>&1
exit 0
fi
################################################################
# Gps Drive
################################################################A
# Update CVS (get the latest bleeding edge version)
##############
if [ "$1" == "cvsupdate" ]
then
cd /mnt/$USB/source
export CVSROOT=:pserver:anonymous@cvs.gpsdrive.cc:/cvsroot
cp .cvspass /root
cvs login                              # Press return for blank PW
cvs co gpsdrive >> $LOGFILE 2>&1     # use this to get the lot
# cvs up gpsdrive   >> $LOGFILE 2>&1     # use this to get an update
echo "    CVS Checkout status " $?
cvs logout
fi

##############
# Build
##############
if [ "$1" == "gpsdrive" ]
then
if [ "$BUILDFROM" == "tar" ] # otherwise build from CVS source
then
SOURCE=gpsdrive-2.10pre3-cvs-version23-10.tar.gz
ARCHIVE_DIR=gpsdrive-2.10pre3
cd $UNPACK
mkdir gpsdrive
cd gpsdrive
tar -xvzf /mnt/$USB/source/$SOURCE >> $LOGFILE 2>&1
echo "    Unpack Status" $?
else
ARCHIVE_DIR=/mnt/$USB/source/gpsdrive
fi
cd $ARCHIVE_DIR
# /opt running out of space.  remove openoffice
rm -rf /opt/openoffice
./configure --help > $CONFIGHELP
./configure --prefix=$DEST --disable-garmin >> $LOGFILE 2>&1
echo Configure Status $?
make clean >> $LOGFILE 2>&1
echo Make Clean Status $?
make >> $LOGFILE 2>&1
echo Make Status $?
make install >> $LOGFILE 2>&1
echo Make Install Status $?
cd $UNPACK
if [ "$BUILDFROM" == "tar" ]
then
rm -rf gpsdrive >> $LOGFILE 2>&1
fi
exit 0
fi
################################################################
# Copy the files to working folder on Hard Disk
################################################################
if [ "$1" == "cpy" ]
then
# Probably already mounted
# mount /dev/hda2 /mnt/hda2 >> $LOGFILE 2>&1
cd /opt
cp -Pr gpsdrive $WORK/opt >> $LOGFILE 2>&1
# Additional Libraries and Links
ln -s $WORK/opt/gpsdrive/lib/libpangocario-1.0.so.0.1000.0 $WORK/opt/gpsdrive/lib/libpangocairo-1.0.so >> $LOGFILE 2>&1
ln -s i$WORK/opt/gpsdrive/lib/libpangocairo-1.0.so.0.1000.0 $WORK/opt/gpsdrive/lib/libpangocairo-1.0.so.0 >> $LOGFILE 2>&1
cp /usr/lib/libpcre.so.3 $WORK/opt/gpsdrive/lib
cp /usr/X11R6/lib/libXrandr.so.2 $WORK/opt/gpsdrive/lib
cp /usr/lib/libXcursor.so.1 $WORK/opt/gpsdrive/lib
fi
################################################################
# Create the Package for DSL
#################################################################
if [ "$1" == "package" ]
then
cd $WORK
echo "Current working direcory..."
pwd
# Make the install dir
 mkdir opt

# Make the Icon item
 mkdir home
 mkdir home/dsl
 mkdir home/dsl/.xtdesktop
 
# Copy the Icon and the .lnk desktop icon file
 cp /mnt/$USB/gpsdrive.lnk home/dsl/.xtdesktop/Gpsdrive.lnk
 cp /mnt/$USB/gpsdrive.gif home/dsl/.xtdesktop/Gpsdrive.gif
 
# Make the menu item
 #  TODO
 # mkdir var
 # mkdir var/tmp
 # mkdir var/tmp/mydsl.menu
 # cp /mnt/$USB/gpsdrive-menu.txt var/tmp/mydsl.menu/gpsdrive
 
# Fix file ownership
 chown -R 0.0 ./{opt/,var/}
 chown -R 1001.50 ./home/dsl/
 # chown 1001.50 ./var/tmp/mydsl.menu/gpsdrive


# Remove the old archive if any
rm -f gpsdrive.tar.gz

# Create the file list
find . > files.txt

# Remove unwanted files from the list
# -v sends all non matching lines to the output file
# -x matches the whole line only
 echo "Building the files list "
 cat files.txt \
 | grep -vx . \
 | grep -vx ./opt \
 | grep -v  /man/ \
 | grep -vx /man \
 | grep -v  /include \
 | grep -v  /doc \
 | grep -v  /gtk-doc \
 | grep -vx ./home \
 | grep -vx ./home/dsl \
 | grep -vx ./var \
 | grep -vx ./var/tmp \
 | grep -vx .var/tmp/mydsk.menu \
 | grep -vx ./files.txt \
 | grep -v  .gpsdrive.tar \
 > includedfiles.txt
 echo "Build file list status " $?

# Create the archive

  echo " Creating the Archive "
  tar -cvf gpsdrive.tar --no-recursion --numeric-owner -T includedfiles.txt >> $LOGFILE
  echo " Create Archive Status " $?

  echo " Compressing the Archive  (please wait) "
  gzip -9 gpsdrive.tar
  echo " Compress Archive Status " $?

# Create an info file
 # TODO

# Create an md5sum
 # TODO
 md5sum gpsdrive.tar.gz > gpsdrive.tar.gz.md5.txt

fi
################################################################


Start.sh
============
When you want to start GPSdrive on DSL you will need something like this to start the program.
This is so the libraries can all be found.

LOGFILE=/opt/gpsdrive/start.log
echo "=======================================================================" >> $LOGFILE
date >> $LOGFILE
export LD_LIBRARY_PATH=/opt/gpsdrive/lib
/opt/gpsdrive/bin/gpsdrive >> $LOGFILE 2>&1
echo "=======================================================================" >> $LOGFILE

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.