Hi,
I've got a general question about software packaging under Linux - nothing C or C++ specific. The problem is that I cannot imagine how an executable binary knows where to find its configuration file and shared data on a target installation environment.
For example, if my package was named `myapplication', the compiled binary would most probably get installed to `/usr/bin/myapplication' (depending on the distribution and package maintainer). So far so good - but what if the binary makes use of a configuration file?
The binary could simply assume that its configuration file would be located at `/etc/myapplication.conf' and refuse to execute if it didn't exist. This would force a package maintainer to actually install the configuration to `/etc/myapplication.conf' or to patch the source code in order to make the application work - both solutions are anything but elegant.
So how does the application know where to look for its configuration (and other files)? The package maintainer could have decided to install it anywhere for whatever reason... Of course I could pass the location of the configuration file to the application via a command line option such as `--configuration=<path>' when executing it. But if the application makes also use of an image (e.g. `/usr/share/myapplication/icon.bmp') in addition to the configuration file it would need to take one more command line option - and so on.
Is there any best practice on how to solve this?
Thanks in advance!