RFC: FreeBSD DB Port Reform

Matthias Andree ma at dt.e-technik.uni-dortmund.de
Thu Nov 6 07:26:53 PST 2003


Oliver Eikemeier <eikemeier at fillmore-labs.com> writes:

> You still don't address the problem that PREFIX/BerkeleyDB.N.M violates
> hier(7), see also:
>
>    http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/dads-subdirs.html

I don't see how I could avoid using files like these:

$PREFIX/BerkeleyDB.N.M/libdb-N.so
$PREFIX/BerkeleyDB.N.M/libdb.so

When multiple versions (3.3, 4.0, 4.1) are installed at the same time.

The important aspect is that applications that haven't been natively
developed on Free/Net/Open/Dragonfly/TrustedBSD, but ported, will expect
this exact layout.

The actual libraries that are used at runtime are installed into the
hier(7) conformant locations.

I don't mind where the binaries go, unless it's libexec - the db_*
applications are user-stuff and belong into bin/ somewhere. Again, we
have a name clash here.

Obviously, applications will expect to link against their favourite
version of BDB as libdb.so - libdb.so can be 2.7, 3.3, 4.0, 4.1
whatever, we need to make sure this works.

One of the problem is that FreeBSD isn't currently prepared (in terms of
hier(7)) to deal with vendor tree layouts. The obvious fix would be to
drop anything into /opt/sleepycat.com/BerkeleyDB.N.M, add some
/usr/local/etc/profile.d/ stuff to set paths and LD_LIBRARY_PATH and be
done.

> And, could you name a sample port that would benefit from the changes, i.e.
> post a sample patch for net/openldap22-server or whatever port you like to
> demonstrate the improvements.

To show the full benefit, we'd need to work out the bsd.port.mk stuff
first, which has not been done yet. I'll keep you posted. AFAIR,
openldap22-server needs only the LIB_DEPENDS lines changed. Ideally,
that would read a WANT_BDB_VERSION from the port, which would just set

WITH_BDB_VERSION?=       4.1
WANT_BDB_VERSION=        ${WITH_BDB_VERSION}

and the bsd.port.mk could then stuff proper -I and -L options into
CPPFLAGS, LDFLAGS and return the canonical names in some variables.

-- 
Matthias Andree

Encrypt your mail: my GnuPG key ID is 0x052E7D95


More information about the freebsd-ports mailing list