1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit db flag-o-matic multilib
8 #Number of official patches
9 #PATCHNO=`echo ${PV}|sed -e "s,\(.*_p\)\([0-9]*\),\2,"`
10 PATCHNO="${PV/*.*.*_p}"
11 if [[ ${PATCHNO} == "${PV}" ]] ; then
16 MY_PV="${PV/_p${PATCHNO}}"
20 DESCRIPTION="Berkeley DB for transaction support in MySQL"
21 HOMEPAGE="http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/overview/index.html"
22 SRC_URI="http://download.oracle.com/berkeley-db/${MY_P}.tar.gz"
23 for (( i=1 ; i<=${PATCHNO} ; i++ )) ; do
24 export SRC_URI="${SRC_URI} http://www.oracle.com/technology/products/berkeley-db/db/update/${MY_PV}/patch.${MY_PV}.${i}"
29 # This ebuild is to be the compatibility ebuild for when db4 is put
31 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 m68k ~mips ppc ppc64 s390 sparc x86"
33 RESTRICT="!test? ( test )"
38 S="${WORKDIR}/${MY_P}"
41 # Get db to link libdb* to correct dependencies ... for example if we use
42 # NPTL or NGPT, db detects usable mutexes, and should link against
43 # libpthread, but does not do so ...
44 # <azarah@gentoo.org> (23 Feb 2003)
45 "${FILESDIR}"/${MY_P}-fix-dep-link.patch
47 "${FILESDIR}"/${MY_P}-gcc43.patch
51 # This doesn't build without exceptions
52 replace-flags -fno-exceptions -fexceptions
56 for (( i=1 ; i<=${PATCHNO} ; i++ ))
58 eapply -p0 "${DISTDIR}"/patch."${MY_PV}"."${i}"
63 # We should get dump185 to link against system db1 ..
64 # <azarah@gentoo.org> (23 Feb 2003)
65 mv dist/Makefile.in{,.orig} || die
67 -e 's:DB185INC=:DB185INC= -I/usr/include/db1:' \
68 -e 's:DB185LIB=:DB185LIB= -ldb1:' \
69 dist/Makefile.in.orig \
70 > dist/Makefile.in || die
73 # remove config.guess else we have problems with gcc-3.2
74 rm config.guess || die
75 sed -i "s,\(-D_GNU_SOURCE\),\1 ${CFLAGS}," configure || die
91 # --enable-rpc DOES NOT BUILD
92 # Robin H. Johnson <robbat2@gentoo.org> (18 Oct 2003)
101 # TCL support is also broken
102 # Robin H. Johnson <robbat2@gentoo.org> (18 Oct 2003)
103 # conf_shared="${conf_shared}
104 # `use_enable tcl tcl`
105 # `use_with tcl tcl /usr/$(get_libdir)`"
107 # NOTE: we should not build both shared and static versions
108 # of the libraries in the same build root!
110 einfo "Configuring ${P} (static)..."
111 mkdir build-static || die
112 pushd build-static &>/dev/null || die
113 strip="${EPREFIX}"/bin/true \
114 ECONF_SOURCE="${S}"/dist \
115 econf "${conf[@]}" "${conf_static[@]}"
116 popd &>/dev/null || die
118 einfo "Configuring ${P} (shared)..."
119 mkdir build-shared || die
120 pushd build-shared &>/dev/null || die
121 strip="${EPREFIX}"/bin/true \
122 ECONF_SOURCE="${S}"/dist \
123 econf "${conf[@]}" "${conf_shared[@]}"
124 popd &>/dev/null || die
128 # Parallel make does not work
129 MAKEOPTS="${MAKEOPTS} -j1"
131 einfo "Building ${P} (static)..."
132 pushd "${S}"/build-static &>/dev/null || die
133 emake strip="${EPREFIX}"/bin/true
134 popd &>/dev/null || die
136 einfo "Building ${P} (shared)..."
137 pushd build-shared &>/dev/null || die
138 emake strip="${EPREFIX}"/bin/true
139 popd &>/dev/null || die
143 pushd build-shared &>/dev/null || die
144 # build system does not support DESTDIR
147 libcxx=libcxx_3.2.a \
150 libdir="${ED}"/usr/$(get_libdir) \
151 strip="${EPREFIX}"/bin/true \
153 popd &>/dev/null || die
155 pushd build-static &>/dev/null || die
156 newlib.a libdb.a libdb-3.2.a
157 newlib.a libdb_cxx.a libdb_cxx-3.2.a
158 popd &>/dev/null || die
160 db_src_install_headerslot || die "db_src_install_headerslot failed!"
162 # this is now done in the db eclass, function db_fix_so and db_src_install_usrlibcleanup
164 #ln -s libdb-3.2.so libdb.so.3
166 # For some reason, db.so's are *not* readable by group or others,
167 # resulting in no one but root being able to use them!!!
168 # This fixes it -- DR 15 Jun 2001
169 pushd "${ED}"/usr/$(get_libdir) &>/dev/null || die
171 # The .la's aren't readable either
173 popd &>/dev/null || die
177 db_src_install_doc || die "db_src_install_doc failed!"
179 db_src_install_usrbinslot || die "db_src_install_usrbinslot failed!"
181 db_src_install_usrlibcleanup || die "db_src_install_usrlibcleanup failed!"
194 eerror "We'd love to be able to test, but the testsuite is broken in the 3.2.9 series"