diff options
author | Paul de Vrieze <pauldv@gentoo.org> | 2003-05-24 14:38:06 +0000 |
---|---|---|
committer | Paul de Vrieze <pauldv@gentoo.org> | 2003-05-24 14:38:06 +0000 |
commit | 93ef459556338d4a4b6cfd665b9ab4b59efa3ba9 (patch) | |
tree | 3557eb578a02dd04c3a92ae6b7cac11c4102bf4d | |
parent | cleanup (diff) | |
download | gentoo-2-93ef459556338d4a4b6cfd665b9ab4b59efa3ba9.tar.gz gentoo-2-93ef459556338d4a4b6cfd665b9ab4b59efa3ba9.tar.bz2 gentoo-2-93ef459556338d4a4b6cfd665b9ab4b59efa3ba9.zip |
Adding an eclass to collect all fixes to make things work with db4.
-rw-r--r-- | eclass/db4-fix.eclass | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/eclass/db4-fix.eclass b/eclass/db4-fix.eclass new file mode 100644 index 000000000000..948541c2fd44 --- /dev/null +++ b/eclass/db4-fix.eclass @@ -0,0 +1,44 @@ +# Copyright 1999-2003 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/eclass/db4-fix.eclass,v 1.1 2003/05/24 14:38:06 pauldv Exp $ +# +# Author: Paul de Vrieze <pauldv@gentoo.org> +# +# This eclass is meant to fix configure scripts to work with our versioned db4 +# +# the dodb4-fix script should be run from the directory where autoconf needs to +# be run from + +ECLASS=db4-fix +INHERITED="$INHERITED $ECLASS" + +newdepend "sys-apps/sed" + +DESCRIPTION="Based on the ${ECLASS} eclass" + +EDB4_FIX_VERSION=0.1 + +dodb4-fix () { + postfix=`grep "#define.db_create" /usr/include/db4/db.h \ + |cut -d " " -f 2|sed -e "s,db_create,,"` + + if [ $# -ne 1 ];then + die "This function needs as argument the name of the file to fix" + fi + if has_version =sys-libs/db-4*; then + if [ "`basename $1`" == "configure" ]; then + die "sorry configure fixing is not supported yet" + else + einfo "fixing $1 to work with db-4 by appending ${postfix}" + cp $1 ${1}.cpy + cat ${1}.cpy \ + |sed -e "s;\( *AC_CHECK_LIB( *db4? *, db_[^ ,]*\);\1${postfix};" \ + -e "s/\( *AC_CHECK_LIB([^,]*, db_create\)\( *,\)/\1${postfix}\2/" \ + >${1} || die "sed failed" + autoconf + fi + else + einfo "db4 not found, so not applying db4 fixes" + fi + +}
\ No newline at end of file |