java-bdb48: don't obsolete libdb-java, provided by libdb51-java [release 4.8.30-4mamba;Thu Sep 15 2011]

This commit is contained in:
Silvan Calarco 2024-01-05 21:39:37 +01:00
parent eb00fb0b4d
commit 77570b74f0
15 changed files with 4540 additions and 0 deletions

View File

@ -1,2 +1,9 @@
# db48 # db48
The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides embedded database support for both traditional and client/server applications.
The Berkeley DB includes B+tree, Extended Linear Hashing, Fixed and Variable-length record access methods, transactions, locking, logging, shared memory caching, and database recovery.
The Berkeley DB supports C, C++, Java, and Perl APIs.
It is used by many applications, including Python and Perl, so this should be installed on all systems.
This package contains the tools for managing Berkeley DB.

39
bdb-transactions.diff Normal file
View File

@ -0,0 +1,39 @@
--- db4-4.2.52/dbinc/db.in.orig 2004-09-09 18:29:17.987387000 -0700
+++ db4-4.2.52/dbinc/db.in 2004-09-09 18:30:00.547903000 -0700
@@ -839,6 +839,7 @@
#define TXN_NOWAIT 0x040 /* Do not wait on locks. */
#define TXN_RESTORED 0x080 /* Transaction has been restored. */
#define TXN_SYNC 0x100 /* Sync on prepare and commit. */
+#define TXN_NOLOG 0x200 /* Do not log this transaction. */
u_int32_t flags;
};
--- db4-4.2.52/txn/txn.c.orig 2004-09-09 18:30:36.348345000 -0700
+++ db4-4.2.52/txn/txn.c 2004-09-09 18:32:14.559561000 -0700
@@ -127,7 +127,7 @@
if ((ret = __db_fchk(dbenv,
"txn_begin", flags,
DB_DIRTY_READ | DB_TXN_NOWAIT |
- DB_TXN_NOSYNC | DB_TXN_SYNC)) != 0)
+ DB_TXN_NOSYNC | DB_TXN_SYNC | DB_TXN_NOT_DURABLE )) != 0)
return (ret);
if ((ret = __db_fcchk(dbenv,
"txn_begin", flags, DB_TXN_NOSYNC, DB_TXN_SYNC)) != 0)
@@ -193,6 +193,8 @@
F_SET(txn, TXN_SYNC);
if (LF_ISSET(DB_TXN_NOWAIT))
F_SET(txn, TXN_NOWAIT);
+ if (LF_ISSET(DB_TXN_NOT_DURABLE))
+ F_SET(txn, TXN_NOLOG);
if ((ret = __txn_begin_int(txn, 0)) != 0)
goto err;
@@ -328,7 +330,7 @@
* We should set this value when we write the first log record, not
* here.
*/
- if (DBENV_LOGGING(dbenv))
+ if (DBENV_LOGGING(dbenv) && !F_ISSET(txn, TXN_NOLOG))
__log_txn_lsn(dbenv, &begin_lsn, NULL, NULL);
else
ZERO_LSN(begin_lsn);

20
btree.diff Normal file
View File

@ -0,0 +1,20 @@
--- db4-4.2.52/btree/bt_rec.c.orig 2003-09-13 11:48:58.000000000 -0700
+++ db4-4.2.52/btree/bt_rec.c 2005-05-04 13:25:29.349243000 -0700
@@ -222,7 +222,7 @@
* previous-page pointer updated to our new page. The next
* page must exist because we're redoing the operation.
*/
- if (!rootsplit && !IS_ZERO_LSN(argp->nlsn)) {
+ if (!rootsplit && argp->npgno != PGNO_INVALID ) {
if ((ret =
__memp_fget(mpf, &argp->npgno, 0, &np)) != 0) {
ret = __db_pgerr(file_dbp, argp->npgno, ret);
@@ -294,7 +294,7 @@
* possible that the next-page never existed, we ignore it as
* if there's nothing to undo.
*/
- if (!rootsplit && !IS_ZERO_LSN(argp->nlsn)) {
+ if (!rootsplit && argp->npgno != PGNO_INVALID) {
if ((ret =
__memp_fget(mpf, &argp->npgno, 0, &np)) != 0) {
np = NULL;

89
db-1.85-errno.patch Normal file
View File

@ -0,0 +1,89 @@
glibc doesn't like errno as the name of a field.
--- db.1.85/hash/hash.h Mon Feb 18 19:12:14 2002
+++ db.1.85/hash/hash.h Mon Feb 18 19:12:20 2002
@@ -103,7 +103,7 @@
BUFHEAD *cpage; /* Current page */
int cbucket; /* Current bucket */
int cndx; /* Index of next item on cpage */
- int errno; /* Error Number -- for DBM
+ int err; /* Error Number -- for DBM
* compatability */
int new_file; /* Indicates if fd is backing store
* or no */
--- db.1.85/hash/hash.c Mon Feb 18 19:12:24 2002
+++ db.1.85/hash/hash.c Mon Feb 18 19:12:44 2002
@@ -505,7 +505,7 @@
else
if (wsize != sizeof(HASHHDR)) {
errno = EFTYPE;
- hashp->errno = errno;
+ hashp->err = errno;
return (-1);
}
for (i = 0; i < NCACHED; i++)
@@ -536,7 +536,7 @@
hashp = (HTAB *)dbp->internal;
if (flag) {
- hashp->errno = errno = EINVAL;
+ hashp->err = errno = EINVAL;
return (ERROR);
}
return (hash_access(hashp, HASH_GET, (DBT *)key, data));
@@ -553,11 +553,11 @@
hashp = (HTAB *)dbp->internal;
if (flag && flag != R_NOOVERWRITE) {
- hashp->errno = errno = EINVAL;
+ hashp->err = errno = EINVAL;
return (ERROR);
}
if ((hashp->flags & O_ACCMODE) == O_RDONLY) {
- hashp->errno = errno = EPERM;
+ hashp->err = errno = EPERM;
return (ERROR);
}
return (hash_access(hashp, flag == R_NOOVERWRITE ?
@@ -574,11 +574,11 @@
hashp = (HTAB *)dbp->internal;
if (flag && flag != R_CURSOR) {
- hashp->errno = errno = EINVAL;
+ hashp->err = errno = EINVAL;
return (ERROR);
}
if ((hashp->flags & O_ACCMODE) == O_RDONLY) {
- hashp->errno = errno = EPERM;
+ hashp->err = errno = EPERM;
return (ERROR);
}
return (hash_access(hashp, HASH_DELETE, (DBT *)key, NULL));
@@ -729,7 +729,7 @@
hashp = (HTAB *)dbp->internal;
if (flag && flag != R_FIRST && flag != R_NEXT) {
- hashp->errno = errno = EINVAL;
+ hashp->err = errno = EINVAL;
return (ERROR);
}
#ifdef HASH_STATISTICS
--- db.1.85/hash/ndbm.c Mon Feb 18 19:12:58 2002
+++ db.1.85/hash/ndbm.c Mon Feb 18 19:13:05 2002
@@ -180,7 +180,7 @@
HTAB *hp;
hp = (HTAB *)db->internal;
- return (hp->errno);
+ return (hp->err);
}
extern int
@@ -190,7 +190,7 @@
HTAB *hp;
hp = (HTAB *)db->internal;
- hp->errno = 0;
+ hp->err = 0;
return (0);
}

View File

@ -0,0 +1,14 @@
diff -ur db-4.6.21/dist/Makefile.in db-4.6.21-db.h_include-patched/dist/Makefile.in
--- db-4.6.21/dist/Makefile.in 2007-07-05 18:35:02.000000000 +0000
+++ db-4.6.21-db.h_include-patched/dist/Makefile.in 2008-09-05 08:59:36.000000000 +0000
@@ -139,8 +139,8 @@
# local libraries, for example. Do that by adding -I options to the DB185INC
# line, and -l options to the DB185LIB line.
##################################################
-DB185INC= -c @CFLAGS@ -I$(srcdir) @CPPFLAGS@
-DB185LIB=
+DB185INC= -c @CFLAGS@ -I$(srcdir) -I$(srcdir)/db.1.85/PORT/linux/include @CPPFLAGS@
+DB185LIB= ${srcdir}/db.1.85/PORT/linux/libdb.a
##################################################
# NOTHING BELOW THIS LINE SHOULD EVER NEED TO BE MODIFIED.

View File

@ -0,0 +1,11 @@
--- dist/configure.ac 2010-04-12 22:25:23.000000000 +0200
+++ dist/configure.ac-gil 2011-02-26 19:15:53.000000000 +0100
@@ -404,7 +404,7 @@
AC_PROG_JAVAC
AC_PROG_JAR
AC_PROG_JAVA
- AC_JNI_INCLUDE_DIR
+ JNI_INCLUDE_DIRS="/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/include/"
AC_MSG_CHECKING(java version)
case "$JAVA" in

3533
db4-jni-casting.diff Normal file

File diff suppressed because it is too large Load Diff

400
db48.spec Normal file
View File

@ -0,0 +1,400 @@
%define majver %(echo %version | cut -d . -f1-2)
%define majvershort %(echo %version | cut -d . -f1-2 | tr -d .)
%define MAJver %(echo %version | cut -d . -f1)
Name: db48
Version: 4.8.30
Release: 4mamba
Summary: The Berkeley DB database library
Group: System/Libraries
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://www.oracle.com/technology/products/berkeley-db/index.html
Source0: http://download.oracle.com/berkeley-db/db-%{version}.tar.gz
Source1: http://download.oracle.com/berkeley-db/db.1.85.tar.gz
Patch0: patch.4.2.52.1
Patch1: patch.4.2.52.2
Patch2: db4-jni-casting.diff
# from http://www.stanford.edu/services/directory/openldap/configuration/patches/db/
Patch3: bdb-transactions.diff
Patch4: btree.diff
Patch5: java.diff
# db-1.85 upstream patches
Patch6: http://www.oracle.com/technology/products/berkeley-db/db/update/1.85/patch.1.1
Patch7: http://www.oracle.com/technology/products/berkeley-db/db/update/1.85/patch.1.2
Patch8: http://www.oracle.com/technology/products/berkeley-db/db/update/1.85/patch.1.3
Patch9: http://www.oracle.com/technology/products/berkeley-db/db/update/1.85/patch.1.4
Patch10: db-1.85-errno.patch
Patch11: db-4.6.21-1.85-compat.patch
Patch12: db-4.8.30-jni-include-dir.patch
License: BSD, GPL
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: libgcc
BuildRequires: libstdc++6-devel
## AUTOBUILDREQ-END
BuildRequires: libtcl-devel
BuildRequires: gcc-java
BuildRequires: java-gcj-compat
#BuildRequires: java-openjdk
BuildRequires: jpackage-utils
BuildRequires: sharutils
Requires: libdb48 = %{version}-%{release}
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides embedded database support for both traditional and client/server applications.
The Berkeley DB includes B+tree, Extended Linear Hashing, Fixed and Variable-length record access methods, transactions, locking, logging, shared memory caching, and database recovery.
The Berkeley DB supports C, C++, Java, and Perl APIs.
It is used by many applications, including Python and Perl, so this should be installed on all systems.
This package contains the tools for managing Berkeley DB.
%package docs
Summary: The Berkeley DB database Documentation
Group: Documentation
Requires: libdb48 = %{version}-%{release}
%description docs
The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides embedded database support for both traditional and client/server applications.
The Berkeley DB includes B+tree, Extended Linear Hashing, Fixed and Variable-length record access methods, transactions, locking, logging, shared memory caching, and database recovery.
The Berkeley DB supports C, C++, Java, and Perl APIs.
It is used by many applications, including Python and Perl, so this should be installed on all systems.
This package contains documentation for %{name}.
%package -n libdb48
Summary: The Berkeley DB database library
Group: System/Libraries
%description -n libdb48
The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides embedded database support for both traditional and client/server applications.
The Berkeley DB includes B+tree, Extended Linear Hashing, Fixed and Variable-length record access methods, transactions, locking, logging, shared memory caching, and database recovery.
The Berkeley DB supports C, C++, Java, and Perl APIs.
It is used by many applications, including Python and Perl, so this should be installed on all systems.
%package -n libdb48-devel
Summary: Development files for the Berkeley DB library.
Group: Development/Libraries
Requires: libdb48 = %{version}-%{release}
%description -n libdb48-devel
The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides embedded database support for both traditional and client/server applications.
This package contains the header files, libraries, and documentation for building programs which use the Berkeley DB.
%package -n libdb48-static
Summary: Development files for the Berkeley DB library - static libraries.
Group: Development/Libraries
Requires: libdb48-devel = %{version}-%{release}
%description -n libdb48-static
The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides embedded database support for both traditional and client/server applications.
This package contains static libraries for building programs which use the Berkeley DB.
%package -n java-bdb48
Summary: Java bindings for the Berkeley DB library
Group: System/Libraries
Requires: libdb48 = %{version}-%{release}
Provides: libdb48-java
%description -n java-bdb48
Java bindings for the Berkeley DB library.
%package -n libdb48-tcl
Summary: Development files for using the Berkeley DB (version 4) with tcl
Group: Development/Libraries
Requires: libdb48 = %{version}-%{release}
%description -n libdb48-tcl
The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides embedded database support for both traditional and client/server applications. This package contains the libraries for building programs which use the Berkeley DB in Tcl.
%prep
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%setup -q -n db-%{version} -a 1
#%patch0 -p0
#%patch1 -p0
#%patch2 -p2
#%patch3 -p1
#%patch4 -p1
#%patch5 -p1
pushd db.1.85/PORT/linux
%patch6 -p0 -b .1.1
popd
pushd db.1.85
%patch7 -p0 -b .1.2
%patch8 -p0 -b .1.3
%patch9 -p0 -b .1.4
%patch10 -p1 -b .errno
popd
%patch11 -p1 -b .185compat
%patch12 -p0 -b .4.8.30.jni
cd dist
./s_config
%build
case "%{_target_cpu}" in
i586) mutex="x86/gcc-assembly" ;;
ppc) mutex="PPC/gcc-assembly" ;;
arm) mutex="ARM/gcc-assembly" ;;
x86_64) mutex="x86_64/gcc-assembly" ;;
*) mutex="UNIX/fcntl" ;;
esac
CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"; export CFLAGS
# Build the old db-185 libraries.
make -C db.1.85/PORT/%{_os} OORG="$CFLAGS"
/bin/sh libtool --mode=compile %{__cc} $RPM_OPT_FLAGS -Idb.1.85/PORT/%{_os}/include -D_REENTRANT -c db_dump185/db_dump185.c -o dist/$1/db_dump185.lo
/bin/sh libtool --mode=link %{__cc} -o dist/$1/db_dump185 dist/$1/db_dump185.lo db.1.85/PORT/%{_os}/libdb.a
build() {
test -d dist/$1 || mkdir dist/$1
# Static link db_dump185 with old db-185 libraries.
/bin/sh libtool --mode=compile %{__cc} $RPM_OPT_FLAGS -Idb.1.85/PORT/%{_os}/include -D_REENTRANT -c db_dump185/db_dump185.c -o dist/$1/db_dump185.lo
/bin/sh libtool --mode=link %{__cc} -o dist/$1/db_dump185 dist/$1/db_dump185.lo db.1.85/PORT/%{_os}/libdb.a
pushd dist
popd
pushd dist/$1
ln -sf ../configure .
JAVA_HOME=%{_jvmdir}/java/ \
%configure -C \
--prefix=%{_prefix} \
--datadir=%{_datadir} \
--includedir=%{_includedir}/db4 \
--enable-compat185 \
--enable-dump185 \
--enable-shared \
--enable-static \
--enable-tcl \
--with-tcl=%{_libdir} \
--with-mutex="$mutex" \
--enable-cxx \
%if "%{stage1}" != "1"
--enable-java \
%endif
--enable-test \
# --enable-diagnostic
# --enable-debug
# --enable-debug_rop
# --enable-debug_wop
perl -pi -e 's/^predep_objects=".*$/predep_objects=""/' libtool
perl -pi -e 's/^postdep_objects=".*$/postdep_objects=""/' libtool
perl -pi -e 's/-shared -nostdlib/-shared/' libtool
%make
LDBJ=./.libs/libdb_java-%{majver}.la
if test -f ${LDBJ} -a ! -f ${LDBJ}i; then
sed -e 's,^installed=no,installed=yes,' < ${LDBJ} > ${LDBJ}i
fi
popd
}
build dist-tls
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
mkdir -p %{buildroot}%{_includedir}
mkdir -p %{buildroot}%{_libdir}
%makeinstall -C dist/dist-tls
mkdir -p %{buildroot}%{_datadir}/doc/libdb4-%{version}
mv %{buildroot}%{_prefix}/docs/* \
%{buildroot}%{_datadir}/doc/libdb4-%{version}
rmdir %{buildroot}%{_prefix}/docs
## need for build pythonic extension
#for i in db.h db_cxx.h db_185.h; do
# ln -s db4/$i %{buildroot}%{_includedir}
#done
pushd %{buildroot}%{_bindir}
find * -exec ln -s {} {}-%{majvershort} \;
popd
# fix strange permissions
chmod u+w %{buildroot}%{_bindir} %{buildroot}%{_bindir}/*
ln -s libdb-%{majver}.so %{buildroot}%{_libdir}/libdb.so.%{majver}
%if "%{stage1}" != "1"
ln -s libdb_java-%{majver}.so %{buildroot}%{_libdir}/libdb_java.so.%{majver}
mkdir -p %{buildroot}%{_datadir}/java
mv %{buildroot}%{_libdir}/db.jar %{buildroot}%{_datadir}/java/db-%{version}.jar
(
cd %{buildroot}%{_datadir}/java
for jar in *-%{version}*; do
ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`
done
)
%endif
# remove unneeded files
rm -f %{buildroot}%{_libdir}/*.la
rm -f %{buildroot}%{_libdir}/libdb.so
rm -f %{buildroot}%{_libdir}/libdb_cxx.so
rm -f %{buildroot}%{_libdir}/libdb.a
rm -f %{buildroot}%{_libdir}/libdb_cxx.a
rm -f %{buildroot}%{_libdir}/libdb_tcl.so
rm -f %{buildroot}%{_libdir}/libdb-%{MAJver}.so
rm -f %{buildroot}%{_libdir}/libdb_cxx-%{MAJver}.so
rm -f %{buildroot}%{_libdir}/libdb_tcl-%{MAJver}.so
chmod +x %{buildroot}%{_libdir}/*.so*
#ln -sf libdb-%{majver}.so %{buildroot}%{_libdir}/libdb.so
#ln -sf libdb_cxx-%{majver}.so %{buildroot}%{_libdir}/libdb_cxx.so
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%post -n libdb48 -p /sbin/ldconfig
%postun -n libdb48 -p /sbin/ldconfig
%files
%defattr(-,root,root)
%{_bindir}/*
%files -n libdb48
%defattr(-,root,root)
%{_libdir}/libdb-%{majver}.so
%{_libdir}/libdb_cxx-%{majver}.so
%{_libdir}/libdb.so.%{majver}
%files -n libdb48-devel
%defattr(-,root,root)
%{_includedir}/*
#%{_libdir}/libdb_cxx.so
#%{_libdir}/libdb.so
%files docs
%defattr(-,root,root)
%dir %{_datadir}/doc/libdb4-%{version}
%{_datadir}/doc/libdb4-%{version}/*
%files -n libdb48-static
%defattr(-,root,root)
%{_libdir}/libdb-%{majver}.a
%{_libdir}/libdb_cxx-%{majver}.a
%{_libdir}/libdb_java-%{majver}.a
%{_libdir}/libdb_tcl-%{majver}.a
%post -n libdb48-tcl -p /sbin/ldconfig
%postun -n libdb48-tcl -p /sbin/ldconfig
%files -n libdb48-tcl
%defattr(-,root,root)
%{_libdir}/libdb_tcl-%{majver}.so
%post -n java-bdb48 -p /sbin/ldconfig
%postun -n java-bdb48 -p /sbin/ldconfig
%files -n java-bdb48
%defattr(-,root,root)
%{_libdir}/libdb_java.so
%{_libdir}/libdb_java-%{MAJver}.so
%{_libdir}/libdb_java-%{majver}.so
%{_libdir}/libdb_java-%{majver}_g.so
%{_libdir}/libdb_java.so.%{majver}
%{_datadir}/java/db-%{version}.jar
%{_datadir}/java/db.jar
%changelog
* Thu Sep 15 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 4.8.30-4mamba
- java-bdb48: don't obsolete libdb-java, provided by libdb51-java
* Thu Mar 31 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 4.8.30-3mamba
- remove requirement for java-openjdk; current system jdk is used
- ok let's leave headers in %{_includedir}/db4 instead of %{_includedir}/db48
- but don't make this the system default db version thus not installing %{_includedir}/db*.h
* Sat Feb 26 2011 gil <puntogil@libero.it> 4.8.30-2mamba
- rename to db48
- add db48 libdb48-static docs sub packages
* Mon Jan 17 2011 gil <puntogil@libero.it> 4.8.30-1mamba
- update to 4.8.30
- add java-openjdk support
- add db 185 support
- add libtcl support
- move headers files in %{_includedir}/db4 and create db.h db_cxx.h db_185.h links in %{_includedir}
- add db.jar with version
- add libdb-tcl sub package
* Thu Dec 31 2009 Automatic Build System <autodist@mambasoft.it> 4.8.26-1mamba
- automatic update to 4.8.26 by autodist
* Fri Sep 25 2009 Silvan Calarco <silvan.calarco@mambasoft.it> 4.8.24-1mamba
- update to 4.8.24
* Thu Jul 03 2008 gil <puntogil@libero.it> 4.7.25-1mamba
- update to version 4.7.25
- removed patches
* Wed Jun 04 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 4.2.52-8mamba
- specfile updated
* Thu Jul 13 2006 Davide Madrisan <davide.madrisan@qilinux.it> 4.2.52-7qilnx
- fixed openldap warning: "BerkeleyDB 4.2.52 library needs TXN patch!"
- official patches applied
- fixed permissions of binary files
* Wed Oct 26 2005 Silvan Calarco <silvan.calarco@mambasoft.it> 4.2.52-6qilnx
- add OpenOffice patch
* Mon Oct 24 2005 Silvan Calarco <silvan.calarco@mambasoft.it> 4.2.52-5qilnx
- do not link against libpthread
* Mon Oct 24 2005 Silvan Calarco <silvan.calarco@mambasoft.it> 4.2.52-4qilnx
- rebuild with gcj
* Wed Feb 02 2005 Silvan Calarco <silvan.calarco@mambasoft.it> 4.2.52-3qilnx
- rebuilt with java bindings
* Tue Jul 27 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 4.2.25-8qilnx
- new version build
- source RPM renamed to db42 (should cohexist with libdb4)
* Sun May 09 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 4.1.25-8qilnx
- added libdb.so provides
* Fri May 07 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 4.1.25-7qilnx
- fixed symlinks for compatibility
* Fri May 07 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 4.1.25-6qilnx
- rebuild with --enable-compat185
* Tue Sep 15 2003 Silvan Calarco <silvan.calarco@mambasoft.it> 4.1.25-5qilnx
- Added symlink /usr/include/db.h so that db4 is system default version
* Tue Sep 09 2003 Silvan Calarco <silvan.calarco@mambasoft.it> 4.1.25-4qilnx
- Moved includes to /usr/include/db4 for devel packages co-existence
* Fri Jul 25 2003 Silvan Calarco <silvan.calarco@qinet.it> 4.1.25-3qilnx
- Removed compat185 (it looks broken, I'll try to use db2's compat185)
* Thu Jul 24 2003 Silvan Calarco <silvan.calarco@qinet.it> 4.1.25-2qilnx
- Enabled compatibiliy with version 185
* Tue Apr 22 2003 Luca Tinelli <luca.tinelli@qinet.it> 4.1.25-1qilnx
- Creation of db4 package

248
java.diff Normal file
View File

@ -0,0 +1,248 @@
--- db4-4.2.52/java/src/com/sleepycat/db/DbEnv.java 2003-12-03 16:26:27.000000000 -0500
+++ db4-4.2.52/java/src/com/sleepycat/db/DbEnv.java 2004-03-18 15:15:42.000000000 -0500
@@ -61,7 +61,7 @@
// Internally, the JNI layer creates a global reference to each DbEnv,
// which can potentially be different to this. We keep a copy here so
// we can clean up after destructors.
- private Object dbenv_ref;
+ private long dbenv_ref;
private DbAppDispatch app_dispatch_handler;
private DbEnvFeedbackHandler env_feedback_handler;
private DbErrorHandler error_handler;
@@ -94,7 +94,7 @@
void cleanup() {
swigCPtr = 0;
db_java.deleteRef0(dbenv_ref);
- dbenv_ref = null;
+ dbenv_ref = 0L;
}
--- db4-4.2.52/java/src/com/sleepycat/db/Db.java 2003-12-03 16:26:25.000000000 -0500
+++ db4-4.2.52/java/src/com/sleepycat/db/Db.java 2004-03-18 15:15:55.000000000 -0500
@@ -57,7 +57,7 @@
// Internally, the JNI layer creates a global reference to each Db,
// which can potentially be different to this. We keep a copy here so
// we can clean up after destructors.
- private Object db_ref;
+ private long db_ref;
private DbEnv dbenv;
private boolean private_dbenv;
private DbAppendRecno append_recno_handler;
@@ -84,7 +84,7 @@
private void cleanup() {
swigCPtr = 0;
db_java.deleteRef0(db_ref);
- db_ref = null;
+ db_ref = 0L;
if (private_dbenv) {
dbenv.cleanup();
}
--- db4-4.2.52/java/src/com/sleepycat/db/db_java.java 2003-12-03 16:10:54.000000000 -0500
+++ db4-4.2.52/java/src/com/sleepycat/db/db_java.java 2004-03-18 15:17:24.000000000 -0500
@@ -14,15 +14,15 @@
db_javaJNI.DbEnv_lock_vec(DbEnv.getCPtr(dbenv), locker, flags, list, offset, nlist);
}
- static Object initDbEnvRef0(DbEnv self, Object handle) {
+ static long initDbEnvRef0(DbEnv self, Object handle) {
return db_javaJNI.initDbEnvRef0(DbEnv.getCPtr(self), handle);
}
- static Object initDbRef0(Db self, Object handle) {
+ static long initDbRef0(Db self, Object handle) {
return db_javaJNI.initDbRef0(Db.getCPtr(self), handle);
}
- static void deleteRef0(Object ref) {
+ static void deleteRef0(long ref) {
db_javaJNI.deleteRef0(ref);
}
--- db4-4.2.52/java/src/com/sleepycat/db/db_javaJNI.java 2003-12-03 16:10:55.000000000 -0500
+++ db4-4.2.52/java/src/com/sleepycat/db/db_javaJNI.java 2004-03-18 15:16:18.000000000 -0500
@@ -45,9 +45,9 @@
static native final void initialize();
public final static native void DbEnv_lock_vec(long jarg1, int jarg2, int jarg3, DbLockRequest[] jarg4, int jarg5, int jarg6) throws DbException;
- final static native Object initDbEnvRef0(long jarg1, Object jarg2);
- final static native Object initDbRef0(long jarg1, Object jarg2);
- final static native void deleteRef0(Object jarg1);
+ final static native long initDbEnvRef0(long jarg1, Object jarg2);
+ final static native long initDbRef0(long jarg1, Object jarg2);
+ final static native void deleteRef0(long jarg1);
final static native long getDbEnv0(long jarg1);
public final static native long new_Db(long jarg1, int jarg2) throws DbException;
public final static native void Db_associate(long jarg1, long jarg2, long jarg3, DbSecondaryKeyCreate jarg4, int jarg5) throws DbException;
--- db4-4.2.52/libdb_java/db_java.i 2003-11-17 15:00:52.000000000 -0500
+++ db4-4.2.52/libdb_java/db_java.i 2004-03-18 09:21:14.000000000 -0500
@@ -53,7 +53,7 @@
// Internally, the JNI layer creates a global reference to each DbEnv,
// which can potentially be different to this. We keep a copy here so
// we can clean up after destructors.
- private Object dbenv_ref;
+ private long dbenv_ref;
private DbAppDispatch app_dispatch_handler;
private DbEnvFeedbackHandler env_feedback_handler;
private DbErrorHandler error_handler;
@@ -76,7 +76,7 @@
void cleanup() {
swigCPtr = 0;
db_java.deleteRef0(dbenv_ref);
- dbenv_ref = null;
+ dbenv_ref = 0L;
}
public synchronized void close(int flags) throws DbException {
@@ -220,7 +220,7 @@
// Internally, the JNI layer creates a global reference to each Db,
// which can potentially be different to this. We keep a copy here so
// we can clean up after destructors.
- private Object db_ref;
+ private long db_ref;
private DbEnv dbenv;
private boolean private_dbenv;
private DbAppendRecno append_recno_handler;
@@ -245,7 +245,7 @@
private void cleanup() {
swigCPtr = 0;
db_java.deleteRef0(db_ref);
- db_ref = null;
+ db_ref = 0L;
if (private_dbenv)
dbenv.cleanup();
dbenv = null;
@@ -503,46 +503,42 @@
}
%}
-%native(initDbEnvRef0) jobject initDbEnvRef0(DB_ENV *self, void *handle);
-%native(initDbRef0) jobject initDbRef0(DB *self, void *handle);
-%native(deleteRef0) void deleteRef0(jobject ref);
+%native(initDbEnvRef0) jlong initDbEnvRef0(DB_ENV *self, void *handle);
+%native(initDbRef0) jlong initDbRef0(DB *self, void *handle);
+%native(deleteRef0) void deleteRef0(jlong ref);
%native(getDbEnv0) DB_ENV *getDbEnv0(DB *self);
%{
-JNIEXPORT jobject JNICALL Java_com_sleepycat_db_db_1javaJNI_initDbEnvRef0(
+JNIEXPORT jlong JNICALL Java_com_sleepycat_db_db_1javaJNI_initDbEnvRef0(
JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2) {
DB_ENV *self = *(DB_ENV **)&jarg1;
+ jlong ret;
COMPQUIET(jcls, NULL);
DB_ENV_INTERNAL(self) = (void *)(*jenv)->NewGlobalRef(jenv, jarg2);
self->set_errpfx(self, (const char*)self);
- return (jobject)DB_ENV_INTERNAL(self);
+ *(jobject *)&ret = (jobject)DB_ENV_INTERNAL(self);
+ return (ret);
}
-JNIEXPORT jobject JNICALL Java_com_sleepycat_db_db_1javaJNI_initDbRef0(
+JNIEXPORT jlong JNICALL Java_com_sleepycat_db_db_1javaJNI_initDbRef0(
JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2) {
DB *self = *(DB **)&jarg1;
+ jlong ret;
COMPQUIET(jcls, NULL);
DB_INTERNAL(self) = (void *)(*jenv)->NewGlobalRef(jenv, jarg2);
- return (jobject)DB_INTERNAL(self);
+ *(jobject *)&ret = (jobject)DB_INTERNAL(self);
+ return (ret);
}
JNIEXPORT void JNICALL Java_com_sleepycat_db_db_1javaJNI_deleteRef0(
- JNIEnv *jenv, jclass jcls, jobject jref) {
- COMPQUIET(jcls, NULL);
-
- if (jref != NULL)
- (*jenv)->DeleteGlobalRef(jenv, jref);
-}
-
-JNIEXPORT jobject JNICALL Java_com_sleepycat_db_db_1javaJNI_getDbRef0(
JNIEnv *jenv, jclass jcls, jlong jarg1) {
- DB *self = *(DB **)&jarg1;
+ jobject jref = *(jobject *)&jarg1;
COMPQUIET(jcls, NULL);
- COMPQUIET(jenv, NULL);
- return (jobject)DB_INTERNAL(self);
+ if (jref != 0L)
+ (*jenv)->DeleteGlobalRef(jenv, jref);
}
JNIEXPORT jlong JNICALL Java_com_sleepycat_db_db_1javaJNI_getDbEnv0(
@@ -554,7 +550,7 @@
COMPQUIET(jcls, NULL);
*(DB_ENV **)&env_cptr = self->dbenv;
- return env_cptr;
+ return (env_cptr);
}
JNIEXPORT jboolean JNICALL
--- db4-4.2.52/libdb_java/db_java_wrap.c 2003-12-03 16:10:36.000000000 -0500
+++ db4-4.2.52/libdb_java/db_java_wrap.c 2004-03-18 12:18:58.000000000 -0500
@@ -1192,40 +1192,36 @@
}
-JNIEXPORT jobject JNICALL Java_com_sleepycat_db_db_1javaJNI_initDbEnvRef0(
+JNIEXPORT jlong JNICALL Java_com_sleepycat_db_db_1javaJNI_initDbEnvRef0(
JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2) {
DB_ENV *self = *(DB_ENV **)&jarg1;
+ jlong ret;
COMPQUIET(jcls, NULL);
DB_ENV_INTERNAL(self) = (void *)(*jenv)->NewGlobalRef(jenv, jarg2);
self->set_errpfx(self, (const char*)self);
- return (jobject)DB_ENV_INTERNAL(self);
+ *(jobject *)&ret = (jobject)DB_ENV_INTERNAL(self);
+ return (ret);
}
-JNIEXPORT jobject JNICALL Java_com_sleepycat_db_db_1javaJNI_initDbRef0(
+JNIEXPORT jlong JNICALL Java_com_sleepycat_db_db_1javaJNI_initDbRef0(
JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2) {
DB *self = *(DB **)&jarg1;
+ jlong ret;
COMPQUIET(jcls, NULL);
DB_INTERNAL(self) = (void *)(*jenv)->NewGlobalRef(jenv, jarg2);
- return (jobject)DB_INTERNAL(self);
+ *(jobject *)&ret = (jobject)DB_INTERNAL(self);
+ return (ret);
}
JNIEXPORT void JNICALL Java_com_sleepycat_db_db_1javaJNI_deleteRef0(
- JNIEnv *jenv, jclass jcls, jobject jref) {
- COMPQUIET(jcls, NULL);
-
- if (jref != NULL)
- (*jenv)->DeleteGlobalRef(jenv, jref);
-}
-
-JNIEXPORT jobject JNICALL Java_com_sleepycat_db_db_1javaJNI_getDbRef0(
JNIEnv *jenv, jclass jcls, jlong jarg1) {
- DB *self = *(DB **)&jarg1;
+ jobject jref = *(jobject *)&jarg1;
COMPQUIET(jcls, NULL);
- COMPQUIET(jenv, NULL);
- return (jobject)DB_INTERNAL(self);
+ if (jref != 0L)
+ (*jenv)->DeleteGlobalRef(jenv, jref);
}
JNIEXPORT jlong JNICALL Java_com_sleepycat_db_db_1javaJNI_getDbEnv0(
@@ -1237,7 +1233,7 @@
COMPQUIET(jcls, NULL);
*(DB_ENV **)&env_cptr = self->dbenv;
- return env_cptr;
+ return (env_cptr);
}
JNIEXPORT jboolean JNICALL

20
patch.1.1 Normal file
View File

@ -0,0 +1,20 @@
*** Makefile.orig Wed Jul 13 21:43:16 1994
--- Makefile Wed Dec 31 19:00:00 1969
***************
*** 15,22 ****
${LIBDB}: ${OBJ1} ${OBJ2} ${OBJ3} ${OBJ4} ${OBJ5} ${MISC}
rm -f $@
! ar cq $@ \
! `lorder ${OBJ1} ${OBJ2} ${OBJ3} ${OBJ4} ${OBJ5} ${MISC} | tsort`
ranlib $@
clean:
--- 15,21 ----
${LIBDB}: ${OBJ1} ${OBJ2} ${OBJ3} ${OBJ4} ${OBJ5} ${MISC}
rm -f $@
! ar cq $@ ${OBJ1} ${OBJ2} ${OBJ3} ${OBJ4} ${OBJ5} ${MISC}
ranlib $@
clean:

19
patch.1.2 Normal file
View File

@ -0,0 +1,19 @@
*** btree/bt_split.c Tue Jul 26 14:22:02 1994
--- btree/bt_split.c Sat Jan 4 14:38:55 1997
***************
*** 673,679 ****
* where we decide to try and copy too much onto the left page.
* Make sure that doesn't happen.
*/
! if (skip <= off && used + nbytes >= full) {
--off;
break;
}
--- 673,679 ----
* where we decide to try and copy too much onto the left page.
* Make sure that doesn't happen.
*/
! if (skip <= off && used + nbytes >= full || nxt == top - 1) {
--off;
break;
}

37
patch.1.3 Normal file
View File

@ -0,0 +1,37 @@
*** btree/bt_split.c.orig Sat Feb 8 10:14:10 1997
--- btree/bt_split.c Sat Feb 8 10:14:51 1997
***************
*** 673,679 ****
* where we decide to try and copy too much onto the left page.
* Make sure that doesn't happen.
*/
! if (skip <= off && used + nbytes >= full || nxt == top - 1) {
--off;
break;
}
--- 673,680 ----
* where we decide to try and copy too much onto the left page.
* Make sure that doesn't happen.
*/
! if (skip <= off &&
! used + nbytes + sizeof(indx_t) >= full || nxt == top - 1) {
--off;
break;
}
***************
*** 686,692 ****
memmove((char *)l + l->upper, src, nbytes);
}
! used += nbytes;
if (used >= half) {
if (!isbigkey || bigkeycnt == 3)
break;
--- 687,693 ----
memmove((char *)l + l->upper, src, nbytes);
}
! used += nbytes + sizeof(indx_t);
if (used >= half) {
if (!isbigkey || bigkeycnt == 3)
break;

22
patch.1.4 Normal file
View File

@ -0,0 +1,22 @@
*** btree/bt_page.c.orig Wed Jul 13 21:29:02 1994
--- btree/bt_page.c Wed Jun 11 20:14:43 1997
***************
*** 65,70 ****
--- 65,71 ----
h->prevpg = P_INVALID;
h->nextpg = t->bt_free;
t->bt_free = h->pgno;
+ F_SET(t, B_METADIRTY);
/* Make sure the page gets written back. */
return (mpool_put(t->bt_mp, h, MPOOL_DIRTY));
***************
*** 92,97 ****
--- 93,99 ----
(h = mpool_get(t->bt_mp, t->bt_free, 0)) != NULL) {
*npg = t->bt_free;
t->bt_free = h->nextpg;
+ F_SET(t, B_METADIRTY);
return (h);
}
return (mpool_new(t->bt_mp, npg));

36
patch.4.2.52.1 Normal file
View File

@ -0,0 +1,36 @@
*** mp/mp_fget.c.orig 25 Sep 2003 02:15:16 -0000 11.81
--- mp/mp_fget.c 9 Dec 2003 19:06:28 -0000 11.82
***************
*** 440,446 ****
c_mp->stat.st_pages--;
alloc_bhp = NULL;
R_UNLOCK(dbenv, &dbmp->reginfo[n_cache]);
- MUTEX_LOCK(dbenv, &hp->hash_mutex);
/*
* We can't use the page we found in the pool if DB_MPOOL_NEW
--- 440,445 ----
***************
*** 455,460 ****
--- 454,462 ----
b_incr = 0;
goto alloc;
}
+
+ /* We can use the page -- get the bucket lock. */
+ MUTEX_LOCK(dbenv, &hp->hash_mutex);
break;
case SECOND_MISS:
/*
*** mp/mp_fput.c.orig 30 Sep 2003 17:12:00 -0000 11.48
--- mp/mp_fput.c 13 Dec 2003 00:08:29 -0000 11.49
***************
*** 285,290 ****
--- 285,291 ----
bhp != NULL; bhp = SH_TAILQ_NEXT(bhp, hq, __bh))
if (bhp->priority != UINT32_T_MAX &&
bhp->priority > MPOOL_BASE_DECREMENT)
+ bhp->priority -= MPOOL_BASE_DECREMENT;
MUTEX_UNLOCK(dbenv, &hp->hash_mutex);
}
}

45
patch.4.2.52.2 Normal file
View File

@ -0,0 +1,45 @@
*** lock/lock.c.save 2004-01-30 10:48:33.000000000 -0800
--- lock/lock.c 2004-01-30 10:55:58.000000000 -0800
***************
*** 2216,2226 ****
dp = (u_int8_t *)dp + \
sizeof(db_pgno_t); \
} while (0)
! #define COPY_OBJ(dp, obj) do { \
! memcpy(dp, obj->data, obj->size); \
! dp = (u_int8_t *)dp + \
! ALIGN(obj->size, \
! sizeof(u_int32_t)); \
} while (0)
#define GET_COUNT(dp, count) do { \
--- 2216,2227 ----
dp = (u_int8_t *)dp + \
sizeof(db_pgno_t); \
} while (0)
! #define COPY_OBJ(dp, obj) do { \
! memcpy(dp, \
! (obj)->data, (obj)->size); \
! dp = (u_int8_t *)dp + \
! ALIGN((obj)->size, \
! sizeof(u_int32_t)); \
} while (0)
#define GET_COUNT(dp, count) do { \
***************
*** 2339,2345 ****
for (i = 0; i < nlocks; i = j) {
PUT_PCOUNT(dp, obj[i].ulen);
PUT_SIZE(dp, obj[i].size);
! COPY_OBJ(dp, obj);
lock = (DB_LOCK_ILOCK *)obj[i].data;
for (j = i + 1; j <= i + obj[i].ulen; j++) {
lock = (DB_LOCK_ILOCK *)obj[j].data;
--- 2340,2346 ----
for (i = 0; i < nlocks; i = j) {
PUT_PCOUNT(dp, obj[i].ulen);
PUT_SIZE(dp, obj[i].size);
! COPY_OBJ(dp, &obj[i]);
lock = (DB_LOCK_ILOCK *)obj[i].data;
for (j = i + 1; j <= i + obj[i].ulen; j++) {
lock = (DB_LOCK_ILOCK *)obj[j].data;