[lug] Library locations

Zan Lynx zlynx at acm.org
Wed Feb 6 16:55:20 MST 2008


On Wed, 2008-02-06 at 16:32 -0700, Jeffrey Haemer wrote:
> I'm building a package: my company's commercial product, so it's our
> code, not something off the web.
> 
> It includes a shared library, which I eventually need to install on
> target machines.  Off-hand, I'd have guessed it should go
> into /usr/local/lib, or maybe /usr/share/lib.  Still, every rpm or
> Debian package installed on the boxes I have at hand installs
> libraries right into /usr/lib, which makes me suspect I'm probably
> wrong.
> 
> Can someone explain where I should install my library and why?  I seem
> to be thinking about it fuzzily.

I would say that if you plan to install as part of the distro, with a
RPM or DEB for example, then put your libraries into /usr/lib just like
a regular package.

If you are going to install as a separate application with a tarball or
shar, I like apps that will install to /opt/appname by default or as
$HOME/appname if they can be installed by a user.

In that case your libraries would go in /opt/appname/lib, binaries
in /opt/appname/bin, etc.  Most apps like that use a launch script that
sets LD_LIBRARY_PATH before executing the real app.
-- 
Zan Lynx <zlynx at acm.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.lug.boulder.co.us/pipermail/lug/attachments/20080206/cdf46e2a/attachment.pgp>


More information about the LUG mailing list