forked from freebsd/freebsd-ports
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Berkeley DB cleanup, remove versions 4.0 ... 4.7.
- Mk/bsd.database.mk rewrite, new default to db5. - db6 is eligible by default only if installed on the system. - Bump PORTREVISION of all ports that directly depend on BerkeleyDB or where USE_BDB is found in the port's directory - Patch a few ports such that they will pick up or work with newer versions. - Add UPDATING entry - Drive-by format fix for pks - Drop BerkeleyDB option from mail/popular for now, requires more work. - Exp-run logs linked from the PR below. - Ports that do not build (IGNORE, BROKEN, etc.) have pro-forma changes for new Berkeley DB, but are untested. NOTE: please read UPDATING and the Wiki page before proceeding! Announcement: http://lists.freebsd.org/pipermail/freebsd-ports-announce/2014-August/000090.html Wiki reference: https://wiki.freebsd.org/Ports/BerkeleyDBCleanup PR: 192690 Approved by: portmgr (implicit, PORTREVISION bump on unstaged ports)
- Loading branch information
Showing
162 changed files
with
403 additions
and
2,077 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,11 +50,13 @@ Database_Include_MAINTAINER= [email protected] | |
# PGSQL_VER | ||
# - Detected PostgreSQL version. | ||
## | ||
# USE_BDB - Add Berkeley DB library dependency. | ||
# USE_BDB - Add Berkeley DB library dependency. | ||
# If no version is given (by the maintainer via the port or | ||
# by the user via defined variable), try to find the | ||
# currently installed version. Fall back to default if | ||
# necessary (db41+). | ||
# necessary (db5 if compatible). | ||
# This adds a "debug-bdb" make target which will dump the | ||
# related data. | ||
# INVALID_BDB_VER | ||
# - This variable can be defined when the port does not | ||
# support one or more versions of Berkeley DB. | ||
|
@@ -68,6 +70,14 @@ Database_Include_MAINTAINER= [email protected] | |
# version. | ||
# WITH_BDB_HIGHEST | ||
# - Use the highest installed version of Berkeley DB. | ||
# WITH_BDB6_PERMITTED | ||
# - If defined, BerkeleyDB 6 is added to the | ||
# default version set, making it eligible even | ||
# if not already installed. This is due to its | ||
# stricter Affero GNU Public License. | ||
# | ||
# These variables will then be filled in by this .mk file: | ||
# | ||
# BDB_LIB_NAME | ||
# - This variable is automatically set to the name of the | ||
# Berkeley DB library (default: db41). | ||
|
@@ -290,195 +300,181 @@ LDFLAGS+= -L${LOCALBASE}/lib | |
.endif # USE_PGSQL | ||
|
||
.if defined(USE_BDB) | ||
# TODO: avoid malformed conditional with invalid USE_BDB/WITH_BDB_VER | ||
# check if + works properly from test builds 01h12m23s | ||
|
||
_DB_PORTS= 40 41 42 43 44 46 47 48 5 6 40+ 41+ 42+ 43+ 44+ 46+ 47+ 48+ 5+ 6+ | ||
# Dependence lines for different db versions | ||
db40_DEPENDS= libdb4.so:${PORTSDIR}/databases/db4 | ||
db41_DEPENDS= libdb41.so:${PORTSDIR}/databases/db41 | ||
db42_DEPENDS= libdb-4.2.so:${PORTSDIR}/databases/db42 | ||
db43_DEPENDS= libdb-4.3.so:${PORTSDIR}/databases/db43 | ||
db44_DEPENDS= libdb-4.4.so:${PORTSDIR}/databases/db44 | ||
db46_DEPENDS= libdb-4.6.so:${PORTSDIR}/databases/db46 | ||
db47_DEPENDS= libdb-4.7.so:${PORTSDIR}/databases/db47 | ||
_USE_BDB_save:=${USE_BDB} | ||
_WITH_BDB_VER_save:=${WITH_BDB_VER} | ||
|
||
_DB_PORTS= 48 5 6 | ||
_DB_DEFAULTS= 48 5 # does not include 6 due to different licensing | ||
# but user can re-add it through WITH_BDB6_PERMITTED | ||
. if defined(WITH_BDB6_PERMITTED) | ||
_DB_DEFAULTS+= 6 | ||
. endif | ||
|
||
# Dependency lines for different db versions | ||
db48_DEPENDS= libdb-4.8.so:${PORTSDIR}/databases/db48 | ||
db5_DEPENDS= libdb-5.3.so:${PORTSDIR}/databases/db5 | ||
db6_DEPENDS= libdb-6.1.so:${PORTSDIR}/databases/db6 | ||
# Detect db versions by finding some files | ||
db40_FIND= ${LOCALBASE}/include/db4/db.h | ||
db41_FIND= ${LOCALBASE}/include/db41/db.h | ||
db42_FIND= ${LOCALBASE}/include/db42/db.h | ||
db43_FIND= ${LOCALBASE}/include/db43/db.h | ||
db44_FIND= ${LOCALBASE}/include/db44/db.h | ||
db46_FIND= ${LOCALBASE}/include/db46/db.h | ||
db47_FIND= ${LOCALBASE}/include/db47/db.h | ||
db48_FIND= ${LOCALBASE}/include/db48/db.h | ||
db5_FIND= ${LOCALBASE}/include/db5/db.h | ||
db6_FIND= ${LOCALBASE}/include/db6/db.h | ||
|
||
# For specifying [40, 41, ..]+ | ||
_DB_40P= 40 ${_DB_41P} | ||
_DB_41P= 41 ${_DB_42P} | ||
_DB_42P= 42 ${_DB_43P} | ||
_DB_43P= 43 ${_DB_44P} | ||
_DB_44P= 44 ${_DB_46P} | ||
_DB_46P= 46 ${_DB_47P} | ||
_DB_47P= 47 ${_DB_48P} | ||
_DB_48P= 48 ${_DB_5P} | ||
_DB_5P= 5 ${_DB_6P} | ||
_DB_6P= 6 | ||
|
||
# Override the global WITH_BDB_VER with the | ||
# port specific <UNIQUENAME>_WITH_BDB_VER | ||
.if defined(${UNIQUENAME:tu:S,-,_,}_WITH_BDB_VER) | ||
WITH_BDB_VER= ${${UNIQUENAME:tu:S,-,_,}_WITH_BDB_VER} | ||
.endif | ||
|
||
# Override USE_BDB with global WITH_BDB_VER | ||
.if defined(WITH_BDB_VER) | ||
. if ${WITH_BDB_VER} == 4 | ||
USE_BDB= 40 | ||
. elif ${WITH_BDB_VER} != 1 | ||
. if ${WITH_BDB_VER} != 1 | ||
USE_BDB= ${WITH_BDB_VER} | ||
. endif | ||
.endif | ||
_WANT_BDB_VER= ${USE_BDB} | ||
|
||
# Assume the default bdb version as 41 | ||
.if ${USE_BDB:tl} == "yes" | ||
_WANT_BDB_VER= 41+ | ||
# Override USE_BDB with maintainer's WANT_BDB_VER | ||
.if defined(WANT_BDB_VER) | ||
USE_BDB= ${WANT_BDB_VER} | ||
.endif | ||
|
||
# Detect bdb version | ||
_BDB_VER= no | ||
_BDB_IGNORE= no | ||
# Compatiblity hack: | ||
# upgrade older plussed versions to 48+ | ||
_BDB_OLDPLUSVERS=4+ 40+ 41+ 42+ 43+ 44+ 45+ 46+ 47+ | ||
.for i in ${USE_BDB} | ||
. if ${_BDB_OLDPLUSVERS:M${i}} | ||
USE_BDB:= 48+ | ||
. endif | ||
.endfor | ||
|
||
# Override the user defined WITH_BDB_VER with the WANT_BDB_VER | ||
.if defined(WANT_BDB_VER) | ||
.for bdb in ${_DB_PORTS} | ||
.if ${WANT_BDB_VER} == "${bdb}" && ${_BDB_VER} == "no" | ||
_BDB_VER= ${WANT_BDB_VER} | ||
.if ${USE_BDB} == yes | ||
USE_BDB:= 48+ | ||
.endif | ||
.endfor | ||
USE_BDB= ${WANT_BDB_VER} | ||
.else | ||
|
||
# 1. detect installed versions | ||
_INST_BDB_VER= | ||
.for bdb in ${_DB_PORTS} | ||
.if ${_WANT_BDB_VER} == "${bdb}" && ${_BDB_VER} == "no" | ||
_MATCHED_DB_VER:= ${bdb:S/+//} | ||
. if ${_MATCHED_DB_VER} == "${bdb}" | ||
# USE_BDB is exactly specified | ||
_BDB_VER= ${bdb} | ||
. if exists(${db${bdb}_FIND}) | ||
_INST_BDB_VER+=${bdb} | ||
. endif | ||
.endfor | ||
|
||
# 2. parse supported versions: | ||
# 2a. build list from USE_BDB | ||
_SUPP_BDB_VER= | ||
_USE_BDB:=${USE_BDB:C,\+$,,:C/(.)(.)$/\1.\2/} | ||
.if !empty(USE_BDB:M*+) | ||
. for bdb in ${_DB_PORTS:C/(.)(.)$/\1.\2/} | ||
. if ${_USE_BDB} <= ${bdb} | ||
_SUPP_BDB_VER+=${bdb:C/\.//} | ||
. endif | ||
. endfor | ||
.else | ||
# USE_BDB is specified as VER+ | ||
. for dbx in ${_DB_${_MATCHED_DB_VER}P} | ||
. if exists(${db${dbx}_FIND}) | ||
_BRKDB= no | ||
# Skip versions we are incompatible with | ||
. if defined(INVALID_BDB_VER) | ||
_CHK_BDB:= ${dbx} | ||
. for BRKDB in ${INVALID_BDB_VER} | ||
. if ${_CHK_BDB} == "${BRKDB}" | ||
_BRKDB= yes | ||
. endif | ||
. endfor | ||
. endif | ||
. if ${_BRKDB} == no | ||
. if defined(WITH_BDB_HIGHEST) | ||
# Use the highest version of Berkeley DB found | ||
_BDB_VER= ${dbx} | ||
. elif ${_BDB_VER} == no | ||
# Use the first Berkeley DB found | ||
_BDB_VER= ${dbx} | ||
. endif | ||
. endif | ||
. endif | ||
. endfor | ||
. if ${_BDB_VER} == "no" | ||
# No existing db4 version is detected in system | ||
_BDB_VER= ${_MATCHED_DB_VER} | ||
_SUPP_BDB_VER=${USE_BDB} | ||
.endif | ||
# 2b. expand INVALID_BDB_VER if given with "+": | ||
.if !empty(INVALID_BDB_VER:M*+) | ||
_INV_BDB:=${INVALID_BDB_VER:C,\+$,,:C/(.)(.)$/\1.\2/} | ||
_INV_BDB_VER:= | ||
. for bdb in ${_DB_PORTS:C/(.)(.)$/\1.\2/} | ||
. if ${_INV_BDB} <= ${bdb} | ||
_INV_BDB_VER+=${bdb:C/\.//} | ||
. endif | ||
. endif | ||
. endfor | ||
.else | ||
_INV_BDB_VER:=${INVALID_BDB_VER} | ||
.endif | ||
# 2c. strip versions from INVALID_BDB_VER out of _SUPP_BDB_VER | ||
.for unsupp in ${_INV_BDB_VER} | ||
_SUPP_BDB_VER:=${_SUPP_BDB_VER:N${unsupp}} | ||
.endfor | ||
|
||
# 3a. calculate intersection in _INST_BDB_VER to see if there | ||
# is a usable installed version | ||
.for i in ${_INST_BDB_VER} | ||
. if empty(_SUPP_BDB_VER:M${i}) | ||
_INST_BDB_VER:= ${_INST_BDB_VER:N${i}} | ||
. endif | ||
.endfor | ||
_ELIGIBLE_BDB_VER:=${_INST_BDB_VER} | ||
|
||
# 3b. if there is no usable version installed, check defaults | ||
.if empty(_INST_BDB_VER) | ||
_DFLT_BDB_VER:=${_DB_DEFAULTS} | ||
# make sure we use a reasonable version for package builds | ||
_WITH_BDB_HIGHEST=yes | ||
. for i in ${_DFLT_BDB_VER} | ||
. if empty(_SUPP_BDB_VER:M${i}) | ||
_DFLT_BDB_VER:= ${_DFLT_BDB_VER:N${i}} | ||
. endif | ||
. endfor | ||
_ELIGIBLE_BDB_VER:=${_DFLT_BDB_VER} | ||
.endif | ||
|
||
# USE_BDB is specified incorrectly, so mark this as IGNORE | ||
.if ${_BDB_VER} == "no" | ||
IGNORE= cannot install: unknown Berkeley DB version: ${USE_BDB} | ||
.else | ||
# Now check if we can use it | ||
. if defined(INVALID_BDB_VER) | ||
. for VER in ${INVALID_BDB_VER} | ||
_CHK_PLUS:= ${VER:S/+//} | ||
# INVALID_BDB_VER is specified as VER+ | ||
. if ${_CHK_PLUS} != "${VER}" | ||
. if ${_BDB_VER} == "${_CHK_PLUS}" | ||
_BDB_IGNORE= yes | ||
. else | ||
. for VER_P in ${_DB_${_CHK_PLUS}P} | ||
. if ${_BDB_VER} == "${VER_P}" | ||
_BDB_IGNORE= yes | ||
. endif | ||
. endfor | ||
. endif | ||
. elif ${_BDB_VER} == "${VER}" | ||
_BDB_IGNORE= yes | ||
. endif | ||
. endfor | ||
# 4. elect a version | ||
_BDB_VER= | ||
.for i in ${_ELIGIBLE_BDB_VER} | ||
. if !empty(WITH_BDB_HIGHEST) || !empty(_WITH_BDB_HIGHEST) || empty(${_BDB_VER}) | ||
_BDB_VER:=${i} | ||
. endif | ||
. if ${_BDB_IGNORE} == "yes" | ||
IGNORE= cannot install: does not work with Berkeley DB version ${_BDB_VER} (${INVALID_BDB_VER} not supported) | ||
. else | ||
# Now add the dependency on Berkeley DB ${_BDB_VER) version | ||
# This is for ports that want to link Berkeley DB statically, such | ||
# as devel/subversion, if the corresponding option is active: | ||
.if defined(BDB_BUILD_DEPENDS) | ||
BUILD_DEPENDS+= ${db${_BDB_VER}_FIND}:${db${_BDB_VER}_DEPENDS:C/^libdb.*://} | ||
.endfor | ||
|
||
# 5. catch errors or set variables | ||
.if empty(_BDB_VER) | ||
IGNORE= cannot install: no eligible BerkeleyDB version. Requested: ${USE_BDB}, incompatible: ${_INV_BDB_VER}. Try: make debug-bdb | ||
.else | ||
. if defined(BDB_BUILD_DEPENDS) | ||
BUILD_DEPENDS+= ${db${_BDB_VER}_FIND}:${db${_BDB_VER}_DEPENDS:C/^libdb.*://} | ||
. else | ||
LIB_DEPENDS+= ${db${_BDB_VER}_DEPENDS} | ||
.endif | ||
. if ${_BDB_VER} == 40 | ||
BDB_LIB_NAME= db4 | ||
BDB_LIB_CXX_NAME= db4_cxx | ||
BDB_INCLUDE_DIR= ${LOCALBASE}/include/db4 | ||
. elif ${_BDB_VER} == 42 | ||
BDB_LIB_NAME= db-4.2 | ||
BDB_LIB_CXX_NAME= db_cxx-4.2 | ||
BDB_LIB_DIR= ${LOCALBASE}/lib/db42 | ||
. elif ${_BDB_VER} == 43 | ||
BDB_LIB_NAME= db-4.3 | ||
BDB_LIB_CXX_NAME= db_cxx-4.3 | ||
BDB_LIB_DIR= ${LOCALBASE}/lib/db43 | ||
. elif ${_BDB_VER} == 44 | ||
BDB_LIB_NAME= db-4.4 | ||
BDB_LIB_CXX_NAME= db_cxx-4.4 | ||
BDB_LIB_DIR= ${LOCALBASE}/lib/db44 | ||
. elif ${_BDB_VER} == 46 | ||
BDB_LIB_NAME= db-4.6 | ||
BDB_LIB_CXX_NAME= db_cxx-4.6 | ||
BDB_LIB_DIR= ${LOCALBASE}/lib/db46 | ||
. elif ${_BDB_VER} == 47 | ||
BDB_LIB_NAME= db-4.7 | ||
BDB_LIB_CXX_NAME= db_cxx-4.7 | ||
BDB_LIB_DIR= ${LOCALBASE}/lib/db47 | ||
. elif ${_BDB_VER} == 48 | ||
. endif | ||
. if ${_BDB_VER} == 48 | ||
BDB_LIB_NAME= db-4.8 | ||
BDB_LIB_CXX_NAME= db_cxx-4.8 | ||
BDB_LIB_DIR= ${LOCALBASE}/lib/db48 | ||
. elif ${_BDB_VER} == 5 | ||
. elif ${_BDB_VER} == 5 | ||
BDB_LIB_NAME= db-5.3 | ||
BDB_LIB_CXX_NAME= db_cxx-5.3 | ||
BDB_LIB_DIR= ${LOCALBASE}/lib/db5 | ||
. elif ${_BDB_VER} == 6 | ||
. elif ${_BDB_VER} == 6 | ||
BDB_LIB_NAME= db-6.1 | ||
BDB_LIB_CXX_NAME= db_cxx-6.1 | ||
BDB_LIB_DIR= ${LOCALBASE}/lib/db6 | ||
. endif | ||
. endif | ||
BDB_LIB_NAME?= db${_BDB_VER} | ||
BDB_LIB_CXX_NAME?= db${_BDB_VER}_cxx | ||
BDB_INCLUDE_DIR?= ${LOCALBASE}/include/db${_BDB_VER} | ||
BDB_LIB_DIR?= ${LOCALBASE}/lib | ||
. endif | ||
BDB_VER= ${_BDB_VER} | ||
.endif | ||
BDB_VER= ${_BDB_VER} | ||
|
||
debug-bdb: | ||
@${ECHO_CMD} "--INPUTS----------------------------------------------------" | ||
@${ECHO_CMD} "${UNIQUENAME:tu:S,-,_,}_WITH_BDB_VER: ${${UNIQUENAME:tu:S,-,_,}_WITH_BDB_VER}" | ||
@${ECHO_CMD} "WITH_BDB_VER: ${_WITH_BDB_VER_save}" | ||
@${ECHO_CMD} "WANT_BDB_VER: ${WANT_BDB_VER}" | ||
@${ECHO_CMD} "BDB_BUILD_DEPENDS: ${BDB_BUILD_DEPENDS}" | ||
@${ECHO_CMD} "USE_BDB (original): ${_USE_BDB_save}" | ||
@${ECHO_CMD} "WITH_BDB_HIGHEST (original): ${WITH_BDB_HIGHEST}" | ||
@${ECHO_CMD} "--PROCESSING------------------------------------------------" | ||
@${ECHO_CMD} "supported versions: ${_SUPP_BDB_VER}" | ||
@${ECHO_CMD} "invalid versions: ${_INV_BDB_VER}" | ||
@${ECHO_CMD} "installed versions: ${_INST_BDB_VER}" | ||
@${ECHO_CMD} "eligible versions: ${_ELIGIBLE_BDB_VER}" | ||
@${ECHO_CMD} "USE_BDB (effective): ${USE_BDB}" | ||
@${ECHO_CMD} "WITH_BDB_HIGHEST (override): ${_WITH_BDB_HIGHEST}" | ||
@${ECHO_CMD} "--OUTPUTS---------------------------------------------------" | ||
@${ECHO_CMD} "IGNORE=${IGNORE}" | ||
@${ECHO_CMD} "BDB_VER=${BDB_VER}" | ||
@${ECHO_CMD} "BDB_INCLUDE_DIR=${BDB_INCLUDE_DIR}" | ||
@${ECHO_CMD} "BDB_LIB_NAME=${BDB_LIB_NAME}" | ||
@${ECHO_CMD} "BDB_LIB_CXX_NAME=${BDB_LIB_CXX_NAME}" | ||
@${ECHO_CMD} "BDB_LIB_DIR=${BDB_LIB_DIR}" | ||
@${ECHO_CMD} "BUILD_DEPENDS=${BUILD_DEPENDS:M*/databases/db*}" | ||
@${ECHO_CMD} "LIB_DEPENDS=${LIB_DEPENDS:M*/databases/db*}" | ||
@${ECHO_CMD} "------------------------------------------------------------" | ||
|
||
# Obsolete variables - ports can define these to want users about | ||
# variables that may be in /etc/make.conf but that are no longer | ||
|
Oops, something went wrong.