![]() |
Optification confusion
As we have to live with this stu.... that is optification can we atleast agree on how it should be done.
I look into /opt and see: /opt/maemo /opt/openvpn /opt/fmradio etc... etc... etc... Also what needs to be optified? libs? or only large media files, executables etc...? Reading: http://wiki.maemo.org/Documentation/...opt_and_MyDocs Doesn't reveal much, the same for it's root: http://wiki.maemo.org/Documentation/...d_Distributing The way I would see it is just have a secondary /usr like tree under /opt/maemo and use that only. Anything outside of that should be a valid bug... no need to put more of a mess than necessary. |
Re: Optification confusion
Well the standard allows either, it seems:
Quote:
There is one massive mailing list thread about this issue starting here |
Re: Optification confusion
It may depend on whether package builders manually optify their package, or if they use maemo-optify to do it. maemo-optify seems to put stuff in /opt/maemo.
|
Re: Optification confusion
Some ramblings (i'm tired, sry for lack of clarity):
Code:
/etc/opt : Configuration files for /opt We should probably have by default a: Code:
ln -s /opt/etc /etc/opt Since /opt packages are supposed to put their configs in /etc, but that could make the root filesystem grow a lot too, depending. In the case of the wonderful asterisk, the /etc files are 600k alone! maemo-optify will only do files greater than 2k, but this isn't so great in all cases. Asterisk, for example, has a jillion little sound files, so if it used maemo-optify, it would still write like 1M to /. Using maemo-optify in debian/rules doesn't use the /opt/maemo subdir, but using maemo-optify-deb does. I just wish we could completely ditch the /opt thing entirely. sigh. -Jeff http://wiki.maemo.org/User:Jebba |
Re: Optification confusion
Quote:
Quote:
|
Re: Optification confusion
have a general question , if an app needs to download files and store settings, this needs to be done in the /opt or /home partition ?
/opt means that the app needs to run as root no ? im assuming here that the files downloaded/ settings for the app are considerably large size, in the order of a few hundred KB lets say. cheers. |
Re: Optification confusion
You should keep the settings in the user's config directory, so /home/user/.appname/. If the app needs to download large amounts of data, you should probably store it in opt or ~/MyDocs, depending on the nature of the data.
For PrBoom i tell users they can put their own wads in /opt/doom/wads, and to make that easier, chown it to user in the postinst script. |
Re: Optification confusion
Quote:
Could you brief me how I can go about the postinst script while packaging my app so I can chmown the /opt/<app> path to my application ? *EDIT* a quick search helped. It looks like a normal file without any predefined format. I just need to have my shell commands in there I guess and it will be run after the debian package is installed. please correct if this is not rightly stated. cheers |
Re: Optification confusion
Yeah that's right. It's a script in ./debian called postinst or <packagename>.postinst that runs after the installation. It sounds like what you want is indeed a directory in opt, probably a subdir of the app directory so that you can just put the data in there. Then you'd have a line in postinst:
chown user /opt/myappsdir/data Make sure you create the directory in the install or postinst and that uninstalling the package properly removes it. Make sure that any data files that get installed during package install are also changed to user ownership, so they can be deleted by the app later on. There's almost certainly a better way to do this. It wouldn't work if e.g. the user had changed their user name to something else. This is just what i've used and it works ok in a single-user N900 setup. |
Re: Optification confusion
Quote:
I dont think my chown command ran when I installed the deb file using dpkg my postinst.ex file looks like this Code:
#!/bin/sh |
All times are GMT. The time now is 11:30. |
vBulletin® Version 3.8.8