From 0b6e64d9aa8caeaa571fe833903d2e5b71a59218 Mon Sep 17 00:00:00 2001 From: mandree Date: Mon, 23 May 2016 22:07:24 +0000 Subject: Modernize Makefile and chase new requisites. * Modernize Makefile [1]. * The Tcl changes suggested in the PR [1] are applied but commented out because the code causes scary "warning: the value of the size argument in 'strncat' is too large, might lead to a buffer overflow [-Wstrncat-size]" in lang/tcl/tcl_*.c on FreeBSD 10.3 amd64. * Other than what is suggested in the PR, refuse to add the TCL option, and leave --disable-tcl in. * JAVA option: restrict to Java versions 1.6 and 1.7 because the port fails to compile with JAVA option enabled and openjdk8 (IllegalArgument exception). portlint cleanups: * Set PATCH_WRKSRC, and refresh patches with "make makepatch". * Use Space (not HTab) after WWW: tag in pkg-descr * Drop "The" from COMMENT. PR: 208740 [1] Submitted by: gahr@ [1] --- databases/db5/Makefile | 93 +++++++++++------------- databases/db5/files/patch-dbinc_mutex_int.h | 11 --- databases/db5/files/patch-dist_configure | 8 +- databases/db5/files/patch-src_dbinc_atomic.h | 4 +- databases/db5/files/patch-src_dbinc_mutex__int.h | 11 +++ databases/db5/pkg-plist | 12 +++ 6 files changed, 71 insertions(+), 68 deletions(-) delete mode 100644 databases/db5/files/patch-dbinc_mutex_int.h create mode 100644 databases/db5/files/patch-src_dbinc_mutex__int.h (limited to 'databases') diff --git a/databases/db5/Makefile b/databases/db5/Makefile index a323233c9ed3..c3cfebca4177 100644 --- a/databases/db5/Makefile +++ b/databases/db5/Makefile @@ -3,7 +3,7 @@ PORTNAME= db5 PORTVERSION= 5.3.28 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= databases java MASTER_SITES= http://download.oracle.com/berkeley-db/ PKGNAMEPREFIX?= @@ -13,7 +13,7 @@ DISTNAME= db-${PORTVERSION} DIST_SUBDIR= bdb MAINTAINER= mandree@FreeBSD.org -COMMENT= The Oracle Berkeley DB, revision ${BDBVER} +COMMENT= Oracle Berkeley DB, revision ${BDBVER} BDBVER= ${PORTVERSION:R} BDBMAJ= ${BDBVER:R} @@ -28,62 +28,50 @@ GNU_CONFIGURE= yes USES= gmake libtool INSTALL_TARGET= install_include install_lib install_utilities WRKSRC= ${WRKDIR}/${DISTNAME}/build_unix +PATCH_WRKSRC= ${WRKDIR}/${DISTNAME} USE_LDCONFIG= yes PLIST_SUB= BDBMAJ=${BDBMAJ} BDBVER=${BDBVER} +MAKE_ARGS+= docdir=${DOCSDIR} OPTIONS_DEFINE= CRYPTO L10N SQL JAVA DOCS +# WARNING: DO NOT ADD TCL TO OPTIONS: +# On FreeBSD 10.3 this causes a heap of warnings of the following kind +# and is deemed unsafe. +# ./lang/tcl/tcl_*.c:*:*: warning: the value of the size argument in 'strncat' is too large, might lead to a buffer overflow [-Wstrncat-size] OPTIONS_DEFAULT=CRYPTO +OPTIONS_SUB= yes CRYPTO_DESC= Cryptography support L10N_DESC= Localization support (EXPERIMENTAL) SQL_DESC= Enable SQL API (EXPERIMENTAL) -.include - -.if ${ARCH} == "aarch64" || ${ARCH:Marmv6*} -# db5 uses a deprecated instruction for mutexes on ARM, fbsd bug#197227 -# also bug#205001 -CONFIGURE_ARGS+= --enable-posixmutexes -.endif - -.if ${PORT_OPTIONS:MDOCS} -INSTALL_TARGET+=install_docs docdir=${DOCSDIR} PORTDOCS= * -.endif -.if ${PORT_OPTIONS:MSQL} -CONFIGURE_ARGS+= --enable-sql_codegen --enable-sql -PLIST_SUB+= SQL="" -libdb_sql= libdb_sql -.else -PLIST_SUB+= SQL="@comment " -libdb_sql= -.endif +DBLIBS= libdb libdb_cxx libdb_stl -.if ${PORT_OPTIONS:MJAVA} -USE_JAVA= yes -JAVA_VERSION= 1.6+ -CONFIGURE_ARGS+= --enable-java -CPPFLAGS+= "-I${JAVA_HOME}/include" -CONFIGURE_ENV= JAVAC="${JAVAC}" JAR="${JAR}" JAVA="${JAVA}" -PLIST_SUB+= JAVA="" -libdb_java= libdb_java -.else -PLIST_SUB+= JAVA="@comment " -libdb_java= -.endif +DEBUG_CONFIGURE_ENABLE= debug umrw +CRYPTO_CONFIGURE_WITH= cryptography=yes +L10N_CONFIGURE_ENABLE= localization +SQL_CONFIGURE_ENABLE= sql sql_codegen +SQL_VARS= DBLIBS+=libdb_sql +JAVA_USE= java +# db5 is incompatible with openjdk8 and causes IllegalArgument +# exceptions during build +JAVA_VARS= DBLIBS+=libdb_java JAVA_VERSION="1.6 1.7" +JAVA_CONFIGURE_ENABLE= java +JAVA_CPPFLAGS= -I"${JAVA_HOME}/include" +JAVA_CONFIGURE_ENV= JAVAC="${JAVAC}" JAR="${JAR}" JAVA="${JAVA}" JAVACFLAGS="-Xlint:unchecked" +#TCL_CONFIGURE_ENABLE= tcl +#TCL_USES= tcl:85+ +#TCL_CONFIGURE_WITH= tcl=${TCL_LIBDIR} +#TCL_VARS= DBLIBS+=libdb_tcl +DOCS_INSTALL_TARGET= install_docs -.if ${PORT_OPTIONS:MCRYPTO} -CONFIGURE_ARGS+= --with-cryptography=yes -.else -CONFIGURE_ARGS+= --with-cryptography=no -.endif - -.if ${PORT_OPTIONS:ML10N} -CONFIGURE_ARGS+= --enable-localization -.endif +.include -.if ${PORT_OPTIONS:MDEBUG} -CONFIGURE_ARGS+= --enable-debug --enable-umrw +.if ${ARCH} == "aarch64" || ${ARCH:Marmv6*} +# db5 uses a deprecated instruction for mutexes on ARM, fbsd bug#197227 +# and also bug#205001 +CONFIGURE_ARGS+= --enable-posixmutexes .endif post-patch: @@ -91,24 +79,17 @@ post-patch: ${REINPLACE_CMD} -Ee 's/[[:<:]]atomic_init[[:>:]]/db_atomic_init/g' ${WRKSRC}/../src/mp/mp* ${WRKSRC}/../src/mutex/mut_* post-install: -.for i in libdb libdb_cxx libdb_stl ${libdb_sql} ${libdb_java} +.for i in ${DBLIBS} ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/${PORTNAME}/${i}-${BDBVER}.so.0 ${LN} -s -f ${PORTNAME}/${i}-${BDBVER}.so.0 ${STAGEDIR}${PREFIX}/lib ${LN} -s -f ${PORTNAME}/${i}-${BDBMAJ}.so ${STAGEDIR}${PREFIX}/lib ${LN} -s -f ${i}-${BDBVER}.so.0 ${STAGEDIR}${PREFIX}/lib/${i}-${BDBVER}.so ${LN} -s -f ${i}-${BDBVER}.so.0 ${STAGEDIR}${PREFIX}/lib/${i}-${BDBMAJ}.so.0 ${LN} -s -f ${i}-${BDBVER}.a ${STAGEDIR}${PREFIX}/lib/${PORTNAME}/${i}.a - ${CHMOD} a-w ${STAGEDIR}${PREFIX}/lib/${PORTNAME}/${i}-${BDBVER}.so.0 \ - ${STAGEDIR}${PREFIX}/lib/${PORTNAME}/${i}-${BDBVER}.a \ - ${STAGEDIR}${PREFIX}/lib/${PORTNAME}/${i}-${BDBVER}.la .endfor cd ${STAGEDIR}${PREFIX}/bin/${PORTNAME}; \ for i in *; do ${LN} -s -f ${PORTNAME}/$$i ../$$i-${BDBVER} ; \ ${LN} -s -f ${PORTNAME}/$$i ../$$i-${BDBMAJ} ; done -.if ${PORT_OPTIONS:MDOCS} -.for i in api_reference/TCL - ${RM} -r -f ${STAGEDIR}${DOCSDIR}/${i} -.endfor .if empty(PORT_OPTIONS:MJAVA) ${RM} -r -f ${STAGEDIR}${DOCSDIR}/java .for i in gsg gsg_db_rep gsg_txn @@ -118,6 +99,14 @@ post-install: .if empty(PORT_OPTIONS:MSQL) ${RM} -r -f ${STAGEDIR}${DOCSDIR}/bdb-sql .endif +.if !empty(PORT_OPTIONS:MTCL) + echo "package ifneeded Db_tcl ${BDBVER} \ + [list load [file join $$dir libdb_tcl-${BDBVER}.so]] \ + " > ${STAGEDIR}${PREFIX}/lib/${PORTNAME}/pkgIndex.tcl +.else +.for i in api_reference/TCL + ${RM} -r -f ${STAGEDIR}${DOCSDIR}/${i} +.endfor .endif .include diff --git a/databases/db5/files/patch-dbinc_mutex_int.h b/databases/db5/files/patch-dbinc_mutex_int.h deleted file mode 100644 index 8e1ea186217f..000000000000 --- a/databases/db5/files/patch-dbinc_mutex_int.h +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src/dbinc/mutex_int.h.orig 2010-04-12 13:25:22.000000000 -0700 -+++ ../src/dbinc/mutex_int.h 2014-06-28 01:16:48.321255725 -0700 -@@ -596,7 +596,7 @@ - : "=&r" (__r), "+r" (tsl) - : - : "cr0", "memory"); -- return (int)tsl; -+ return (tsl != 0); - } - - static inline int diff --git a/databases/db5/files/patch-dist_configure b/databases/db5/files/patch-dist_configure index 2dac99fc909d..830bc1f487ef 100644 --- a/databases/db5/files/patch-dist_configure +++ b/databases/db5/files/patch-dist_configure @@ -1,6 +1,7 @@ ---- ../dist/configure.orig Wed Dec 5 13:14:02 2001 -+++ ../dist/configure Wed Dec 5 13:24:01 2001 -@@ -20867,8 +20867,8 @@ +--- dist/configure.orig 2013-09-09 15:35:02 UTC ++++ dist/configure +@@ -17712,10 +17712,10 @@ LIBTOOL="./libtool" + INSTALLER="\$(LIBTOOL) --mode=install cp -p" MAKEFILE_CC="\$(LIBTOOL) --mode=compile ${MAKEFILE_CC}" -MAKEFILE_SOLINK="\$(LIBTOOL) --mode=link ${MAKEFILE_CCLINK} -avoid-version" @@ -11,3 +12,4 @@ +MAKEFILE_XSOLINK="\$(LIBTOOL) --mode=link ${MAKEFILE_CXXLINK} -version-info 0:0:0" MAKEFILE_CXXLINK="\$(LIBTOOL) --mode=link ${MAKEFILE_CXXLINK}" + diff --git a/databases/db5/files/patch-src_dbinc_atomic.h b/databases/db5/files/patch-src_dbinc_atomic.h index 46412294ec2b..1c858f07291e 100644 --- a/databases/db5/files/patch-src_dbinc_atomic.h +++ b/databases/db5/files/patch-src_dbinc_atomic.h @@ -1,5 +1,5 @@ ---- ../src/dbinc/atomic.h.orig 2012-02-29 19:48:38.000000000 +0100 -+++ ../src/dbinc/atomic.h 2012-05-04 22:39:32.000000000 +0200 +--- src/dbinc/atomic.h.orig 2013-09-09 15:35:08 UTC ++++ src/dbinc/atomic.h @@ -70,7 +70,7 @@ typedef struct { * These have no memory barriers; the caller must include them when necessary. */ diff --git a/databases/db5/files/patch-src_dbinc_mutex__int.h b/databases/db5/files/patch-src_dbinc_mutex__int.h new file mode 100644 index 000000000000..976940882950 --- /dev/null +++ b/databases/db5/files/patch-src_dbinc_mutex__int.h @@ -0,0 +1,11 @@ +--- src/dbinc/mutex_int.h.orig 2013-09-09 15:35:08 UTC ++++ src/dbinc/mutex_int.h +@@ -596,7 +596,7 @@ MUTEX_SET(int *tsl) { + : "=&r" (__r), "+r" (tsl) + : + : "cr0", "memory"); +- return (int)tsl; ++ return (tsl != 0); + } + + static inline int diff --git a/databases/db5/pkg-plist b/databases/db5/pkg-plist index 0228138d02ab..4786815e655c 100644 --- a/databases/db5/pkg-plist +++ b/databases/db5/pkg-plist @@ -123,3 +123,15 @@ lib/libdb_stl-%%BDBMAJ%%.so lib/libdb_stl-%%BDBMAJ%%.so.0 lib/libdb_stl-%%BDBVER%%.so lib/libdb_stl-%%BDBVER%%.so.0 +@comment %%TCL%%lib/db5/libdb_tcl-%%BDBVER%%.a +@comment %%TCL%%lib/db5/libdb_tcl-%%BDBVER%%.so +@comment %%TCL%%lib/db5/libdb_tcl-%%BDBVER%%.so.0 +@comment %%TCL%%lib/db5/libdb_tcl-%%BDBVER%%.so.0.0.0 +@comment %%TCL%%lib/db5/libdb_tcl-5.so +@comment %%TCL%%lib/db5/libdb_tcl.a +@comment %%TCL%%lib/db5/libdb_tcl.so +@comment %%TCL%%lib/db5/pkgIndex.tcl +@comment %%TCL%%lib/libdb_tcl-%%BDBVER%%.so +@comment %%TCL%%lib/libdb_tcl-%%BDBVER%%.so.0 +@comment %%TCL%%lib/libdb_tcl-5.so +@comment %%TCL%%lib/libdb_tcl-5.so.0 -- cgit