db42 stable port information

Package: db42
Version: 4.2.52
Revision: 1024
Distribution: 10.4, 10.5
CustomMirror: <<
nam-US: http://download-east.oracle.com/berkeley-db/
nam-US: http://download-west.oracle.com/berkeley-db/
eur-UK: http://download-uk.oracle.com/berkeley-db/
<<
Source: mirror:custom:db-%v.NC.tar.gz
Replaces: <<
db, db3, db31 (<< 3.1.17-8),
db4-ssl, db4,
db41-ssl, db41,
db42-ssl, db42,
db43-ssl, db43,
db44-aes, db44,
db47-aes, db47, db47-aes-64bit, db47-64bit,
db48-aes, db48, db48-aes-64bit, db48-64bit,
db50-aes, db50, db50-aes-64bit, db50-64bit,
db51-aes, db51, db51-aes-64bit, db51-64bit,
db53-aes, db53-aes-64bit
<<
Conflicts: <<
db, db3, db31 (<< 3.1.17-8),
db4-ssl, db4,
db41-ssl, db41,
db42-ssl, db42,
db43-ssl, db43,
db44-aes, db44,
db47-aes, db47, db47-aes-64bit, db47-64bit,
db48-aes, db48, db48-aes-64bit, db48-64bit,
db50-aes, db50, db50-aes-64bit, db50-64bit,
db51-aes, db51, db51-aes-64bit, db51-64bit,
db53-aes, db53-aes-64bit
<<
Depends: db42-shlibs (= %v-%r) | db42-ssl-shlibs (=%v-%r)
BuildDepends: fink (>= 0.24.12-1)
BuildDependsOnly: true
NoSetLDFlags: true
NoSetCPPFlags: true
SetCFlags: -Os
SetCXXFlags: -Os
PatchFile: %n.patch
PatchFile-MD5: ae7c90884234a7a8cd54d88f669162be
ConfigureParams: --enable-compat185 --enable-cxx --includedir=%p/include/db4
GCC: 4.0
CompileScript: <<
#! /bin/sh -ex
VERSIONS="-avoid-version -XCClinker -current_version -XCClinker 4.2.52 -XCClinker -compatibility_version -XCClinker 4.2 -no-undefined"
LIBDB="libdb-4.2.la"
LIBDBCXX="libdb_cxx-4.2.la"
cd build_unix;
F77=no ../dist/configure %c
perl -pi.bak -e 's,api_java,,g' Makefile
make UTIL_PROGS=""
rm ".libs/$LIBDB" $LIBDB
make SOLINK="\$(LIBTOOL) --mode=link --tag=CC gcc $VERSIONS" UTIL_PROGS=""
rm ".libs/$LIBDBCXX" $LIBDBCXX
make XSOLINK="\$(LIBTOOL) --mode=link --tag=CXX g++ $VERSIONS" UTIL_PROGS=""
make
<<
InstallScript: <<
#! /bin/sh -ev
(cd build_unix; make install prefix=%I docdir=%I/share/doc/db42-doc/docs includedir=%I/include/db4) || exit 1
binfiles="db_archive db_checkpoint db_deadlock db_dump db_load db_printlog db_recover db_stat db_upgrade db_verify"
for binfile in $binfiles ; do
mv %i/bin/$binfile %i/bin/$binfile.%N
done
<<
SplitOff: <<
Package: %N-shlibs
Replaces: db42-ssl-shlibs
Conflicts: db42-ssl-shlibs
Description: Shared Libraries for db42
Files: lib/libdb-4.2.dylib lib/libdb_cxx-4.2.dylib lib/libdb-4.2.la lib/libdb_cxx-4.2.la
Shlibs: <<
%p/lib/libdb-4.2.dylib 4.2.0 %n (>= 4.2.50-1)
%p/lib/libdb_cxx-4.2.dylib 4.2.0 %n (>= 4.2.50-1)
<<
DocFiles: LICENSE
<<
SplitOff2: <<
Package: %N-bin
Depends: %N-shlibs (= %v-%r)
Conflicts: db3-bin (<< 3.3.11-25), db31 (<< 3.1.17-2), db4-ssl-bin (<< 4.0.14-24), db4-bin (<< 4.0.14-24), db41-ssl-bin (<< 4.1.25-20), db42-ssl-bin, db41-bin (<< 4.1.25-20)
Replaces: db3-bin (<< 3.3.11-25), db4 (<< 4.0.14-4), db31 (<< 3.1.17-2), db4-ssl-bin (<< 4.0.14-24), db4-bin (<< 4.0.14-24), db41-ssl-bin (<< 4.1.25-20), db42-ssl-bin, db41-bin (<< 4.1.25-20)
Description: Binary utilities for db42
Files: bin
DocFiles: LICENSE
PostInstScript: <<
binfiles="db_archive db_checkpoint db_deadlock db_dump db_load db_printlog db_recover db_stat db_upgrade db_verify"
priority=`echo %N | sed -e 's/[^0-9]//g'`
for binfile in $binfiles ; do
update-alternatives --install %p/bin/$binfile $binfile %p/bin/$binfile.%N $priority
done
<<
PreRmScript: <<
if [ $1 != "upgrade" ]; then
binfiles="db_archive db_checkpoint db_deadlock db_dump db_load db_printlog db_recover db_stat db_upgrade db_verify"
for binfile in $binfiles ; do
update-alternatives --remove $binfile %p/bin/$binfile.%N
done
fi
<<
<<
SplitOff3: <<
Package: %N-doc
Description: Documentation for db42
Files: share/doc/db42-doc
DocFiles: LICENSE
<<
#Splitoff4: <<
# Package: %N-java
# Conflicts: db41-ssl-java, db42-ssl-java, db41-java
# Replaces: db41-ssl-java, db42-ssl-java, db41-java
# Depends: system-java13
# Description: Java libraries for db42
# Files: lib/libdb_java*
# JarFiles: build_unix/db.jar
# DocFiles: LICENSE
#<<
DocFiles: LICENSE README
License: OSI-Approved
Description: Berkeley DB embedded database - non crypto
Homepage: http://www.oracle.com/database/berkeley-db/index.html
Maintainer: None
Source-MD5: 0a6e48fd10e5dce407c4117312902541

db42 stable port .patch

*** foo/mp/mp_fget.c.orig 25 Sep 2003 02:15:16 -0000 11.81
--- foo/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:
/*
*** foo/mp/mp_fput.c.orig 30 Sep 2003 17:12:00 -0000 11.48
--- foo/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);
}
}
*** foo/lock/lock.c.save 2004-01-30 10:48:33.000000000 -0800
--- foo/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;
--- foo/java/src/com/sleepycat/db/DbEnv.java 2003-12-03 16:26:27.000000000 -0500
+++ foo/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;
}


--- foo/java/src/com/sleepycat/db/Db.java 2003-12-03 16:26:25.000000000 -0500
+++ foo/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();
}
--- foo/java/src/com/sleepycat/db/db_java.java 2003-12-03 16:10:54.000000000 -0500
+++ foo/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);
}

--- foo/java/src/com/sleepycat/db/db_javaJNI.java 2003-12-03 16:10:55.000000000 -0500
+++ foo/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;
--- foo/libdb_java/db_java.i 2003-11-17 15:00:52.000000000 -0500
+++ foo/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
--- foo/libdb_java/db_java_wrap.c 2003-12-03 16:10:36.000000000 -0500
+++ foo/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
*** foo/btree/bt_rec.c.orig Tue Mar 22 09:41:49 2005
--- foo/btree/bt_rec.c Tue Mar 22 09:42:11 2005
***************
*** 222,228 ****
* 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 ((ret =
__memp_fget(mpf, &argp->npgno, 0, &np)) != 0) {
ret = __db_pgerr(file_dbp, argp->npgno, ret);
--- 222,228 ----
* previous-page pointer updated to our new page. The next
* page must exist because we're redoing the operation.
*/
! 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,300 ****
* 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 ((ret =
__memp_fget(mpf, &argp->npgno, 0, &np)) != 0) {
np = NULL;
--- 294,300 ----
* possible that the next-page never existed, we ignore it as
* if there's nothing to undo.
*/
! if (!rootsplit && argp->npgno != PGNO_INVALID) {
if ((ret =
__memp_fget(mpf, &argp->npgno, 0, &np)) != 0) {
np = NULL;

db42 _unstable_ port .patch