[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Include in PATH



On Sat, Oct 12, 2013 at 09:51:52PM -0300, Beco wrote:
>    I'm creating a "makefile" with two installation rules.
>    One, the global installation, program with SGID and score in /var/games/
>    like some other games do.
>    The second one would "install" the program and scores under ~/.gamedir/A 
>    Global installation allow me to call the game directly because /usr/games
>    is in $PATH.
You have to decide at what point you want to make the decision between
global or user scores. At install time is a bad point. The two better
options are
 configure time
 run time
For configure time, use a ./configure option, say --enable-globalscores
compile with this on and it looks for scores in /var/games and the only
way to not use that is recompile. This is not as a big a limitation as
you first think.

The second way is at run time. You can make it an option or environment
variable or some configuration item. If you have to configure stuff in
the program already put it with that.

You could just try the global directory and if it fails use the local
directory.

>    Now, for the second installation process, what would be the best way to
>    include the game on PATH?
The game *binary* should be in the PATH, don't mess with the path to
find it. The game *score file* should be worked out by the binary. A
config item, ./configure option or environment variable.
Wether or not it is SGID, it is installed in the same spot.
As a package distributor you can ask the user if they want SGID, set is
a low priority and default to NO.

>    Would it be polite to do something like:
>    echo "PATH=~./gamedir/:$PATH" >> ~/.profile
Uh no, you never do that. Have a sane default and let the user know how
to set it. PATH is where the binaries are, not score/config/data files.

-- 
Craig Small VK2XLZ   http://enc.com.au/          csmall at : enc.com.au
Debian GNU/Linux     http://www.debian.org/      csmall at : debian.org
GPG fingerprint:     5D2F B320 B825 D939 04D2  0519 3938 F96B DF50 FEA5


Reply to: