You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
184 lines
4.4 KiB
184 lines
4.4 KiB
4 years ago
|
# Copyright 1999-2021 Gentoo Authors
|
||
13 years ago
|
# Distributed under the terms of the GNU General Public License v2
|
||
|
|
||
5 years ago
|
EAPI=7
|
||
6 years ago
|
|
||
5 years ago
|
inherit autotools db flag-o-matic java-pkg-opt-2 multilib
|
||
13 years ago
|
|
||
|
#Number of official patches
|
||
|
#PATCHNO=`echo ${PV}|sed -e "s,\(.*_p\)\([0-9]*\),\2,"`
|
||
5 years ago
|
PATCHNO="${PV/*.*.*_p}"
|
||
13 years ago
|
if [[ ${PATCHNO} == "${PV}" ]] ; then
|
||
5 years ago
|
MY_PV="${PV}"
|
||
|
MY_P="${P}"
|
||
13 years ago
|
PATCHNO=0
|
||
|
else
|
||
5 years ago
|
MY_PV="${PV/_p${PATCHNO}}"
|
||
|
MY_P="${PN}-${MY_PV}"
|
||
13 years ago
|
fi
|
||
|
|
||
|
S="${WORKDIR}/${MY_P}/build_unix"
|
||
|
DESCRIPTION="Oracle Berkeley DB"
|
||
8 years ago
|
HOMEPAGE="http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/overview/index.html"
|
||
13 years ago
|
SRC_URI="http://download.oracle.com/berkeley-db/${MY_P}.tar.gz"
|
||
|
for (( i=1 ; i<=${PATCHNO} ; i++ )) ; do
|
||
|
export SRC_URI="${SRC_URI} http://www.oracle.com/technology/products/berkeley-db/db/update/${MY_PV}/patch.${MY_PV}.${i}"
|
||
|
done
|
||
|
|
||
12 years ago
|
LICENSE="Sleepycat"
|
||
5 years ago
|
SLOT="$(ver_cut 1-2)"
|
||
4 years ago
|
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ppc ppc64 ~s390 sparc x86"
|
||
5 years ago
|
IUSE="tcl java doc cxx"
|
||
5 years ago
|
RESTRICT="!test? ( test )"
|
||
13 years ago
|
|
||
|
DEPEND="tcl? ( >=dev-lang/tcl-8.4 )
|
||
3 years ago
|
java? ( >=virtual/jdk-1.8 )"
|
||
13 years ago
|
RDEPEND="tcl? ( dev-lang/tcl )
|
||
3 years ago
|
java? ( >=virtual/jre-1.8 )"
|
||
13 years ago
|
|
||
5 years ago
|
PATCHES=(
|
||
|
"${FILESDIR}"/"${PN}"-"${SLOT}"-libtool.patch
|
||
|
|
||
|
# use the includes from the prefix
|
||
5 years ago
|
"${FILESDIR}"/"${PN}"-4.2-jni-check-prefix-first.patch
|
||
|
"${FILESDIR}"/"${PN}"-4.2-listen-to-java-options.patch
|
||
5 years ago
|
|
||
|
"${FILESDIR}"/"${PN}"-4.3.27-fix-dep-link.patch
|
||
|
)
|
||
|
|
||
|
# Required to avoid unpack attempt of patches
|
||
13 years ago
|
src_unpack() {
|
||
|
unpack "${MY_P}".tar.gz
|
||
5 years ago
|
}
|
||
|
|
||
|
src_prepare() {
|
||
|
pushd "${WORKDIR}"/"${MY_P}" &>/dev/null || die
|
||
13 years ago
|
for (( i=1 ; i<=${PATCHNO} ; i++ ))
|
||
|
do
|
||
5 years ago
|
eapply -p0 "${DISTDIR}"/patch."${MY_PV}"."${i}"
|
||
13 years ago
|
done
|
||
|
|
||
5 years ago
|
default
|
||
13 years ago
|
|
||
5 years ago
|
sed -e "/^DB_RELEASE_DATE=/s/%B %e, %Y/%Y-%m-%d/" \
|
||
|
-i dist/RELEASE || die
|
||
13 years ago
|
|
||
|
# Include the SLOT for Java JAR files
|
||
|
# This supersedes the unused jarlocation patches.
|
||
5 years ago
|
sed -r \
|
||
13 years ago
|
-e '/jarfile=.*\.jar$/s,(.jar$),-$(LIBVERSION)\1,g' \
|
||
5 years ago
|
-i dist/Makefile.in || die
|
||
13 years ago
|
|
||
|
# START of 4.5+earlier specific
|
||
|
# Upstream sucks, they normally concat these
|
||
5 years ago
|
local i j
|
||
|
for j in dist/aclocal{,_java} ; do
|
||
|
pushd ${j} &>/dev/null || die
|
||
|
for i in * ; do
|
||
|
ln -s ${i} ${i%.ac}.m4 || die
|
||
|
done
|
||
|
popd &>/dev/null || die
|
||
|
done
|
||
13 years ago
|
# END of 4.5+earlier specific
|
||
5 years ago
|
|
||
|
pushd dist &>/dev/null || die
|
||
|
rm aclocal/libtool.{m4,ac} || die
|
||
|
sed \
|
||
13 years ago
|
-e '/AC_PROG_LIBTOOL$/aLT_OUTPUT' \
|
||
5 years ago
|
-i configure.ac || die
|
||
|
sed \
|
||
13 years ago
|
-e '/^AC_PATH_TOOL/s/ sh, missing_sh/ bash, missing_sh/' \
|
||
5 years ago
|
-i aclocal/programs.m4 || die
|
||
|
|
||
13 years ago
|
AT_M4DIR="aclocal aclocal_java" eautoreconf
|
||
5 years ago
|
|
||
13 years ago
|
# Upstream sucks - they do autoconf and THEN replace the version variables.
|
||
|
. ./RELEASE
|
||
5 years ago
|
sed \
|
||
13 years ago
|
-e "s/__EDIT_DB_VERSION_MAJOR__/$DB_VERSION_MAJOR/g" \
|
||
|
-e "s/__EDIT_DB_VERSION_MINOR__/$DB_VERSION_MINOR/g" \
|
||
|
-e "s/__EDIT_DB_VERSION_PATCH__/$DB_VERSION_PATCH/g" \
|
||
|
-e "s/__EDIT_DB_VERSION_STRING__/$DB_VERSION_STRING/g" \
|
||
|
-e "s/__EDIT_DB_VERSION_UNIQUE_NAME__/$DB_VERSION_UNIQUE_NAME/g" \
|
||
5 years ago
|
-e "s/__EDIT_DB_VERSION__/$DB_VERSION/g" \
|
||
|
-i configure || die
|
||
|
popd &>/dev/null || die
|
||
|
popd &>/dev/null || die
|
||
13 years ago
|
}
|
||
|
|
||
5 years ago
|
src_configure() {
|
||
|
local myconf=(
|
||
|
--enable-compat185
|
||
|
--enable-o_direct
|
||
|
--without-uniquename
|
||
5 years ago
|
--disable-rpc
|
||
5 years ago
|
--host="${CHOST}"
|
||
|
|
||
|
$(usex amd64 '--with-mutex=x86/gcc-assembly' '')
|
||
|
$(use_enable cxx)
|
||
|
$(use_enable tcl)
|
||
|
$(usex tcl "--with-tcl=${EPREFIX}/usr/$(get_libdir)" '') #"
|
||
|
$(use_enable java)
|
||
|
)
|
||
13 years ago
|
|
||
|
if use java; then
|
||
5 years ago
|
myconf+=(
|
||
|
--with-java-prefix="${JAVA_HOME}"
|
||
|
--with-javac-flags="$(java-pkg_javac-args)"
|
||
|
)
|
||
13 years ago
|
fi
|
||
|
|
||
|
# the entire testsuite needs the TCL functionality
|
||
|
if use tcl && use test ; then
|
||
5 years ago
|
myconf+=( --enable-test )
|
||
13 years ago
|
else
|
||
5 years ago
|
myconf+=( --disable-test )
|
||
13 years ago
|
fi
|
||
|
|
||
|
# Add linker versions to the symbols. Easier to do, and safer than header
|
||
|
# file mumbo jumbo.
|
||
|
if use userland_GNU; then
|
||
|
append-ldflags -Wl,--default-symver
|
||
|
fi
|
||
|
|
||
5 years ago
|
ECONF_SOURCE="${S}"/../dist \
|
||
|
econf "${myconf[@]}"
|
||
13 years ago
|
}
|
||
|
|
||
|
src_install() {
|
||
5 years ago
|
emake \
|
||
|
DESTDIR="${D}" \
|
||
|
libdir="${EPREFIX}/usr/$(get_libdir)" \
|
||
|
strip="${EPREFIX}/bin/strip" \
|
||
|
install
|
||
13 years ago
|
|
||
|
db_src_install_usrbinslot
|
||
|
|
||
|
db_src_install_headerslot
|
||
|
|
||
|
db_src_install_doc
|
||
|
|
||
|
db_src_install_usrlibcleanup
|
||
|
|
||
|
dodir /usr/sbin
|
||
|
# This file is not always built, and no longer exists as of db-4.8
|
||
5 years ago
|
if [[ -f "${ED}"/usr/bin/berkeley_db_svc ]] ; then
|
||
|
mv "${ED}"/usr/bin/berkeley_db_svc \
|
||
|
"${ED}"/usr/sbin/berkeley_db"${SLOT/./}"_svc || die
|
||
|
fi
|
||
13 years ago
|
|
||
|
if use java; then
|
||
8 years ago
|
java-pkg_regso "${ED}"/usr/"$(get_libdir)"/libdb_java*.so
|
||
|
java-pkg_dojar "${ED}"/usr/"$(get_libdir)"/*.jar
|
||
|
rm -f "${ED}"/usr/"$(get_libdir)"/*.jar
|
||
13 years ago
|
fi
|
||
|
}
|
||
|
|
||
|
pkg_postinst() {
|
||
|
db_fix_so
|
||
|
}
|
||
|
|
||
|
pkg_postrm() {
|
||
|
db_fix_so
|
||
|
}
|