Re: Where should one install .so files?

Steve Langasek <[email protected]>
Newsgroups gmane.comp.db.unixodbc.devel
Message-ID <[email protected]>
Hi Jean-Michel,

On Sat, Jul 14, 2012 at 11:55:01AM +0000, Jean-Michel Vourgère wrote:
> I'm working on mdbtools, that includes a really free odbc driver for
> microsoft access files.

> I'm used to Debian GNU/Linux OS, and I noticed that most drivers are
> installing themselves in /usr/lib/odbc rather that just /usr/lib.  (Then
> it changed to /usr/lib/i386/odbc, but that is another story...) That way,
> odbcinst.ini only have to reference "Driver = libmdbodbc.so.1" without any
> path.

> But general "upstream" makefile installs in lib/ and not lib/odbc.

> My question is where should a driver install itself on most architectures:
> lib/ or lib/odbc/ ?

> Is the odbc subfolder a general thing for distros? Or just a Debian/Ubuntu
> specific thing?

This follows logically from the requirements of the FHS:

  /usr/lib : Libraries for programming and packages

  Purpose

  /usr/lib includes object files, libraries, and internal binaries that are
  not intended to be executed directly by users or shell scripts. [22]

  Applications may use a single subdirectory under /usr/lib. If an
  application uses a subdirectory, all architecture-dependent data
  exclusively used by the application must be placed within that
  subdirectory.  [23]

So the only files that should be installed directly in /usr/lib are "object
files, libraries, and internal binaries".  ODBC drivers are not any of
these: they are DSOs (dynamic shared objects) which are loaded by the
driver manager by name, not via the ELF linker.

The particular use of /usr/lib/odbc as a path for ODBC drivers may be
specific to Debian and its derivatives.  I'm happy to discuss with UnixODBC
upstream whether there should be a standard way to express this in the
source build, and to export the preferred search path in a way that other
software can consume it (e.g., as a pkg-config variable).

BTW, the other consequence of considering ODBC drivers to be DSOs rather
than libraries is that they shouldn't have sonames.  The preferred install
target for mdbcodbc should be libmdbodbc.so, not libmdbodbc.so.1; the latter
implies that it is a shared library that users *should* link against, and I
think it's wise to discourage this.

Hope that helps,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
[email protected]                                     [email protected]

_______________________________________________
unixODBC-dev mailing list
[email protected]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-dev
signature.asc (application/pgp-signature, 836 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQIcBAEBCAAGBQJQAzPxAAoJEFaNMPMhshM9xdsP/0308sswGznxuVkEptHZxboj
MXXkE2Hg9N25GkvFV23YHtm7K6JQVIhId7+QkzFxXU+rplWQWvAUJPBALpNJyMrX
KWzBXfG0n9Hce2DVUI088bLHiL6g+YLk6zzAjXKcEGHxOh/YXNHfDA5+PfXCAyJA
fUzwylMkcb53i5yBITTQNBuZ4xl9HGCc+MdFlV+KAZenIk1YgKxGAKbI0N7ZplTe
5yIQ1E2X9F1VutO1YA8naQWdl+0ruTtawgQ/j/I8UWb7CB6APc3ax4K0xxWveQjf
9Ohien7UytAAA0Ni5NX7gsTaFupU3zxkOtSlsug/YKeicZO7MFErokFXUtgXOVP4
9X2Tw9xyKsFCoSAZCGeqpka6i18rbGy+QiiTP5v4LHEj51/D32nuCvaiYz3wy212
wZgSJvmVP1IBWDruZLNpLF/prKQiw0I5p84xU2KqZVPCw8YetMTTwT/EvS2tNgyg
jVEswqrcFcHWHksCdksMa3ybYmWS6p4Y4Ilv+CwsXAnZAJUMmKJB5G7EeIHX1n2k
NQDKySoc+kxN+5p4oJBZ947Ub/iuLuk4ZFTx6MjYpQY8HTrzIjrdNOgkrWXdfbaJ
/kifOBLqFkR1CZ5HvwmMpNdM8KLETf6KeJspCG7Bl+C152+dCZovam2FC568CuBM
pP2yyqDcalAjYsc51YPu
=yFrA
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.