Active Topics

 


Reply
Thread Tools
Posts: 543 | Thanked: 181 times | Joined on Aug 2009 @ Universe,LocalCluster.MilkyWay.Sol.Earth.Europe.Slovenia.Ljubljana
#1
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.
 
Posts: 236 | Thanked: 223 times | Joined on Oct 2009 @ NE UK
#2
Well the standard allows either, it seems:

A package to be installed in /opt must locate its static files in a separate /opt/<package> or /opt/<provider> directory tree, where <package> is a name that describes the software package and <provider> is the provider's LANANA registered name.
( http://www.pathname.com/fhs/pub/fhs-...FTWAREPACKAGES )

There is one massive mailing list thread about this issue starting here
 

The Following 4 Users Say Thank You to kwotski For This Useful Post:
fnordianslip's Avatar
Posts: 670 | Thanked: 359 times | Joined on May 2007
#3
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.
__________________
Class .. : Lame hacker & beardy boffin
Humour . : [#######---] Alignment: Apathetic anarchist
Patience : [####------] Weapon(s): My cat, my code.
Agro ... : |#---------] Relic(s) : N900, MacBookPro, NSLU2, N800, SheevaPlug, Eee-901, Core2-Quad, PS3
"In theory, theory and practice are the same. In practice, they're not."
--
Beware of extras-devel.
 

The Following User Says Thank You to fnordianslip For This Useful Post:
Posts: 355 | Thanked: 566 times | Joined on Nov 2009 @ Redstone Canyon, Colorado
#4
Some ramblings (i'm tired, sry for lack of clarity):

Code:
/etc/opt : Configuration files for /opt
Purpose

Host-specific configuration files for add-on application software packages must be installed within the directory /etc/opt/<subdir>, where <subdir> is the name of the subtree in /opt where the static data from that package is stored.

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
 
Posts: 1,208 | Thanked: 1,028 times | Joined on Oct 2007
#5
Originally Posted by jebba View Post
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 /.
maemo-optify links the directory if the package name and directory name are the same. Usually works fine for applications which have only one package, but for multi package apps it's not so great.

Originally Posted by jebba View Post
Using maemo-optify in debian/rules doesn't use the /opt/maemo subdir, but using maemo-optify-deb does.
Hmm, using maemo-optify is rules and maemo-optfiy-deb should produce exactly same output. (And in my experience they do)
 
krk969's Avatar
Posts: 754 | Thanked: 630 times | Joined on Sep 2009 @ London
#6
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.
 
Flandry's Avatar
Posts: 1,559 | Thanked: 1,786 times | Joined on Oct 2009 @ Boston
#7
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.
__________________

Unofficial PR1.3/Meego 1.1 FAQ

***
Classic example of arbitrary Nokia decision making. Couldn't just fallback to the no brainer of tagging with lat/lon if network isn't accessible, could you Nokia?
MAME: an arcade in your pocket
Accelemymote: make your accelerometer more joy-ful
 

The Following User Says Thank You to Flandry For This Useful Post:
krk969's Avatar
Posts: 754 | Thanked: 630 times | Joined on Sep 2009 @ London
#8
Originally Posted by Flandry View Post
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.
thanks Flandry, these data that Im talking about are huge xml files so I'd want them to be in /opt and not take up space, they get deleted by the app if they are +7 days old.

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

Last edited by krk969; 2010-02-05 at 17:47.
 
Flandry's Avatar
Posts: 1,559 | Thanked: 1,786 times | Joined on Oct 2009 @ Boston
#9
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.
__________________

Unofficial PR1.3/Meego 1.1 FAQ

***
Classic example of arbitrary Nokia decision making. Couldn't just fallback to the no brainer of tagging with lat/lon if network isn't accessible, could you Nokia?
MAME: an arcade in your pocket
Accelemymote: make your accelerometer more joy-ful

Last edited by Flandry; 2010-02-05 at 18:18.
 
krk969's Avatar
Posts: 754 | Thanked: 630 times | Joined on Sep 2009 @ London
#10
Originally Posted by Flandry View Post
Yeah that's right. It's a script in ./debian called postinst or <packagename>.postinst that runs after the installation. .......
does it only run when installing using aptitude ?
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

gtk-update-icon-cache -f /usr/share/icons/hicolor
chown -R user /opt/myapp/

set -e

case "$1" in
    configure)
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

exit 0
cheers
 
Reply


 
Forum Jump


All times are GMT. The time now is 23:47.