Given the release of a graphics library, maybe this could be a good thing in the long run.

That was one of the things that led me to ask the question. If you have a simple stand alone app like pacman, it's no big deal -- you can put it wherever you like. But as soon as you have a shared graphics library, a shared font library, etc, etc, then apps have to know where to find it in its shared location -- otherwise you end up with multiple copies scattered all over the place. If you think it's hard for a newbie to install an app now, it'll only get worse when they have to deal with dependancies ("why doesn't this work?" Is the app in the same directory the gfxlib is?).

A package management database would probably be overkill, but joe user should be able to do something like this:

# ftp empeg
> cd /tmp
> rw
> put empacman.tgz
> quote site install empacman.tgz
> ro
> exit

This install script can untar and look for some specific files (LIB, FONTS, etc) that specify any dependancies (none if the files don't exist), and give appropriate error messages if the dependancies are not installed where they are expected. I don't think it would be unreasonable to expect the user to get and install dependancies if they are told what they are -- no apt-get here. The rest of the files in the tarball could simply be:

empacman/bin/empacman
empacman/share/empacman/hi.txt

(Note the extra directory there so clean up is still easy...)

The install script would look sorta like this (time to put up or shut up, I guess... ):

#!/bin/sh
# install script in half sh, half csh, cuz I don't know all the sh syntax...
tar xvf $1
appname = `echo $1 | sed 's/.tgz//'`
approot = '/usr/local'
cd $appname
if [-e ./LIBS] then
foreach i (`cat ./LIBS`)
if [ !-e $approot/lib/$i] then
echo Missing $approot/$i
exit
fi
end
fi
# etc, for fonts and whatever else

# make sure the bins and preinit script are really executable
chmod 755 ./bin/*

# Copy everything to the proper location
foreach i (`ls -cF | grep /` | sed 's/\///'`)
cd $i
( cp -r * $approot/$i ) || ( echo "Error!"; exit )
# maybe just exiting is a bit harsh...
cd ..
end

# Copy the preinit.d script
cp M*$appname /etc/preinit.d
# check exit status here, too!

# Clean up
cd ..
rm -rf $1 $appname


Obviously, this presupposes that hda2 has been formatted, mounted, etc, but genixia's script can do that... It's pretty simple, but I think it's all we really need...

Cheers,


Edited by canuckInLA (23/07/2002 21:20)