[Pdx-pm] Library for executables
Michael G Schwern
schwern at pobox.com
Sun Mar 27 19:49:26 PST 2005
On Sun, Mar 27, 2005 at 07:01:09PM -0800, Keith Lofstrom wrote:
> Greetings. I am writing a linux command line application with a small
> set of executables that will go in /usr/local/sbin, or alternately
> /usr/sbin . These executables will share a platform-independent common
> library, which I will call parse.pl, to do application specific parsing.
> I will be using a library rather than a package because I specifically
> want to set up some global variables.
> Where should such libraries go?
Alas, it depends on the Linux distribution.
But there's the Filesystem Hierarchy Standard which people at least try to
Debian, for example, follows the FHS.
> I plowed through a dozen perl and linux books looking for an answer
> to this, and was unsuccessful. The Filesystem Hierarchy Standard
> ( http://www.pathname.com/fhs/pub/fhs-2.3.pdf ) seems to suggest
> "share", but I'm not clear about that. I will probably go with that
> if I don't hear otherwise.
If you're not targetting a specific Linux distro, use share. Though nobody
would yell at you (too much) for using lib. If you are targetting a specific
distro do whatever it does.
libexec is just weird.
Or you can just let something like autoconf decide.
What ever you do make sure its configurable, then no matter what decision
you make it can be corrected for a given dist.
More information about the Pdx-pm-list