Index: openldap-2.3.41.ebuild =================================================================== RCS file: /var/cvsroot/gentoo-x86/net-nds/openldap/openldap-2.3.41.ebuild,v retrieving revision 1.7 diff -u -3 -p -r1.7 openldap-2.3.41.ebuild --- openldap-2.3.41.ebuild 18 Mar 2008 23:38:54 -0000 1.7 +++ openldap-2.3.41.ebuild 23 Apr 2008 20:44:54 -0000 @@ -151,6 +151,19 @@ openldap_find_versiontags() { } +openldap_best_db_ver_not46() { + versions="4.5 4.4 4.3 4.2" + for x in $versions; do + if [ $(db_findver "=sys-libs/db-${x}*") ]; then + echo $x + return 0 + fi + done + + eerror "Error finding db version" + return 1 +} + pkg_setup() { if has_version "<=dev-lang/perl-5.8.8_rc1" && built_with_use dev-lang/perl minimal ; then die "You must have a complete (USE='-minimal') Perl install to use the perl backend!" @@ -236,7 +249,7 @@ src_compile() { einfo "Using Berkeley DB for local backend" myconf="${myconf} ${myconf_berkdb}" # We need to include the slotted db.h dir for FreeBSD - append-cppflags -I$(db_includedir) + append-cppflags -I$(db_includedir $(openldap_best_db_ver_not46) ) elif use gdbm ; then einfo "Using GDBM for local backend" myconf="${myconf} ${myconf_gdbm}" @@ -245,7 +258,7 @@ src_compile() { ewarn "Berkeley DB for local backend" myconf="${myconf} ${myconf_berkdb}" # We need to include the slotted db.h dir for FreeBSD - append-cppflags -I$(db_includedir) + append-cppflags -I$(db_includedir $(openldap_best_db_ver_not46) ) fi # extra backend stuff myconf="${myconf} --enable-passwd=mod --enable-phonetic=mod"