OESF Portables Forum

Everything Else => Zaurus - Everything Development => Distros, Development, and Model Specific Forums => Archived Forums => Personal Java/Jeode/J2ME Personal Profile => Topic started by: Mongoosefred on April 01, 2005, 04:01:56 pm

Title: Problem A Java App's Installer
Post by: Mongoosefred on April 01, 2005, 04:01:56 pm
I've got a real dilema, I've got QuackNews installing, but I want to install a number of configuration files, such as templates, basic config file, etc and they have to be ableto be modified by the application.  This is fine on OZ, which is what I'm using, because I run as root and have permissions to write in /opt/Qtopia/, however my friend uses the CRACKO ROM and he is having problems.
What I thought was I'd install the config files into the /opt/Qtopia folder then move them using post install into $HOME and the app can find that using the Runtime properties.  However I just can't get that working.  
What I need is either some really good details of writing move advanced ipk files, or I move the files when I first run the application...  Which is just a little to much like a hack for my liking  
I would appriciate any surgestions.

-MF
Title: Problem A Java App's Installer
Post by: lardman on April 02, 2005, 04:37:07 am
I'm pretty sure that the installer runs as root on all ROMs (otherwise it'd have troubles installing some things).

Let's see the postinst script you're proposing.


Si
Title: Problem A Java App's Installer
Post by: tovarish on April 02, 2005, 04:46:20 am
i had problems with QuackNews and cacko too. The configuration file at /opt/QtPalmtop/QuackNews was not writable by user zaurus so I had to make it as well as the directory writable for quacknews to work.
It works fine now.

tovarish
Title: Problem A Java App's Installer
Post by: Mongoosefred on April 02, 2005, 07:46:26 am
Sorry about the lack of detail in the first post...  it was a late last night.  Heres what I've tried:

I've read the the IPKG Tutorial on uk-dave.com (http://http://www.uk-dave.com/tutorials/zaurus/ipkg.shtml) and I think I've done it right.
I created a folder called CONTROL in the ipk's root, in it was a file called control (which used to be tar'd and gz'd into control.tar.gz and works there) and a postinst file that include a single line
Code: [Select]
cp /opt/Qtopia/QuackNews $HOMEI'm a little new to Unix scripting so I'm not sure if I need
Code: [Select]
#!/bin/shas the first command in the file.
I tar'd and gz'd the CONTROL folder as control.tar.gz and then created the ipk as per usual.  When I came to install it on my Zaurus (OpenZaurus 3.5.2 - Hentges) the package manager says that it fails to create sym-links and does not list it as installed. However QuackNews appears on the Jeode tab when the icons are reloaded and runs correctly, therefore the sym-links are correct.
The QuackNews folder is not copied.
I am assuming (I know, never make assumptions) the the sym-link failure is because the script is failing.
The tutorial says a script must return 0, how do you do this?
I think it might be because I have either got the case wrong for the folder name, the script is wrong or both...  

Is there a way of finding where the files are actually installed into rather than where I think they are, for instance on OZ - Hentges installing into /opt/Qtopia actually installs into /mnt/card/opt/Qtopia.

If anyone has some examples of post and pre install scripts I would be VERY greatful.
Thanks in advance.
-MF
Title: Problem A Java App's Installer
Post by: lardman on April 02, 2005, 08:00:29 am
Quote
I am assuming (I know, never make assumptions) the the sym-link failure is because the script is failing.

Some symlink failures always occur as ipkg tries to symlink all the way down to / (some of which will obviously exist already). So this is normal, not a problem, ignore it.

Quote
a postinst file that include a single line
Code: [Select]
cp /opt/Qtopia/QuackNews $HOMEI'm a little new to Unix scripting so I'm not sure if I need
Code: [Select]
#!/bin/shas the first command in the file.

You do need this as otherwise the script won't be run.

Quote
Is there a way of finding where the files are actually installed into rather than where I think they are, for instance on OZ - Hentges installing into /opt/Qtopia actually installs into /mnt/card/opt/Qtopia.

ipkg files <package-name>

The reason it ends up on the card is that the hentages ROM has opt symlinked there.


Now I really don't understand what you're trying to do. Why are you trying to move this QuackNews file (what is it? a binary, a directory, etc.?) to $HOME? Does $HOME even exist (as in the variable rather than the location)?

The next thing is that you probably shouldn't use /opt/Qtopia/QuackNews, but rather /opt/QtPalmtop/QuackNews (it just offends my sensibilities to use the symlink rather than the actual directory). I also think it's probably bad form to place temporary files in /opt/Qt*, you might try placing them in /tmp as that's what it's there for (unless someone can give me a reason not to do this).


Si
Title: Problem A Java App's Installer
Post by: Mongoosefred on April 02, 2005, 12:45:31 pm
Thanks for the help lardman.
After thinking it through I really don't think I need to do this.  I was just over complicating the solution.
-MF