aboutsummaryrefslogtreecommitdiffstats
path: root/Mk/bsd.database.mk
diff options
context:
space:
mode:
authorcrees <crees@FreeBSD.org>2014-01-13 05:16:06 +0800
committercrees <crees@FreeBSD.org>2014-01-13 05:16:06 +0800
commitb7b8838b378a9bd3e4295db606cae495a0521b8d (patch)
tree28e6ba3507f08777135558fecb204bb522650340 /Mk/bsd.database.mk
parent94ae9be0afc14ad2b27fbf9cb2a22ae34a349d58 (diff)
downloadfreebsd-ports-gnome-b7b8838b378a9bd3e4295db606cae495a0521b8d.tar.gz
freebsd-ports-gnome-b7b8838b378a9bd3e4295db606cae495a0521b8d.tar.zst
freebsd-ports-gnome-b7b8838b378a9bd3e4295db606cae495a0521b8d.zip
Strip postgresql code out of bsd.database.mk, and introduce USES=pgsql.
New syntax: # Depend on postgresql-client USES= pgsql # Depend on postgresql-client at least 9.2 USES= pgsql:9.2+ #Depend on postgresql-server at least 9.0 USES= pgsql:9.0+ WANT_PGSQL= server Postgresql now supports DEFAULT_VERSIONS, and please note that the version syntax now includes dots(!); i.e. before it was 90, now 9.0 Reviewed by: ade, silence from pgsql@
Diffstat (limited to 'Mk/bsd.database.mk')
-rw-r--r--Mk/bsd.database.mk117
1 files changed, 13 insertions, 104 deletions
diff --git a/Mk/bsd.database.mk b/Mk/bsd.database.mk
index c255981852ed..e1395e117e84 100644
--- a/Mk/bsd.database.mk
+++ b/Mk/bsd.database.mk
@@ -35,24 +35,6 @@ Database_Include_MAINTAINER= ports@FreeBSD.org
# MYSQL_VER
# - Detected MySQL version.
##
-# USE_PGSQL - Add PostgreSQL client dependency. Components can be depended
-# on using USE_PGSQL= component[:target]. For the full list
-# use make -V _USE_PGSQL_DEP
-# 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 (PostgreSQL-9.0 = 90).
-# DEFAULT_PGSQL_VER
-# - PostgreSQL default version, currently 90.
-# WANT_PGSQL_VER
-# - Maintainer can set an arbitrary version of PostgreSQL to
-# always build this port with (overrides WITH_PGSQL_VER).
-# Minimum and maximum versions can be set (e.g. 90+)
-# WITH_PGSQL_VER
-# - User defined variable to set PostgreSQL version.
-# PGSQL_VER
-# - Detected PostgreSQL version.
-##
# 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
@@ -189,96 +171,23 @@ IGNORE= cannot install: unknown MySQL version: ${MYSQL_VER}
.endif # USE_MYSQL
.if defined(USE_PGSQL)
-VALID_PGSQL_VER= 84 90 91 92 93
-DEFAULT_PGSQL_VER?= 90
-PGSQL83_LIBVER= 5
-PGSQL84_LIBVER= 5
-PGSQL90_LIBVER= 5
-PGSQL91_LIBVER= 5
-PGSQL92_LIBVER= 5
-PGSQL93_LIBVER= 5
-
-# Setting/finding PostgreSQL version we want.
-. if exists(${LOCALBASE}/bin/pg_config)
-_PGSQL_VER!= ${LOCALBASE}/bin/pg_config --version | ${SED} -n 's/PostgreSQL[^0-9]*\([0-9][0-9]*\)\.\([0-9][0-9]*\)[^0-9].*/\1\2/p'
-WITH_PGSQL_VER?= ${_PGSQL_VER}
-. if ${WITH_PGSQL_VER} != ${_PGSQL_VER}
-IGNORE?= cannot install: you have set WITH_PGSQL_VER=${WITH_PGSQL_VER} in make.conf, but you have postgresql${_PGSQL_VER}-client installed
-. endif
-. endif
-
-. if defined(WANT_PGSQL_VER)
-. if ${WANT_PGSQL_VER:M*+}
-. for version in ${VALID_PGSQL_VER}
-. if ${WANT_PGSQL_VER:S/+//} <= ${version}
-_WANT_PGSQL_VER+=${version}
-. endif
-. endfor
-. elif ${WANT_PGSQL_VER:M*-}
-. for version in ${VALID_PGSQL_VER}
-. if ${WANT_PGSQL_VER:S/-//} >= ${version}
-_WANT_PGSQL_VER+=${version}
-. endif
-. endfor
-. endif
-_WANT_PGSQL_VER?= ${WANT_PGSQL_VER}
-. endif
-
-. if !empty(_WANT_PGSQL_VER)
-. for version in ${_WANT_PGSQL_VER}
-. if defined(WITH_PGSQL_VER)
-. if ${WITH_PGSQL_VER} == ${version}
-PGSQL_VER= ${WITH_PGSQL_VER}
-. endif
-. elif ${DEFAULT_PGSQL_VER} == ${version}
-PGSQL_VER= ${version}
-. endif
-PGSQL_VER?= ${version}
-. endfor
-. if defined(WITH_PGSQL_VER) && ${WITH_PGSQL_VER} != ${PGSQL_VER}
-IGNORE?= cannot install: the port wants postgresql-client version ${WANT_PGSQL_VER} and you have version ${WITH_PGSQL_VER} installed or set in make.conf
-. endif
-. endif
-
-.if !empty(WITH_PGSQL_VER)
-PGSQL_VER?= ${WITH_PGSQL_VER}
+.ifdef WANT_PGSQL_VER
+_USES_POST+= pgsql:${WANT_PGSQL_VER:C,^.,&.,}
+_pgsql_devwarning= USE_PGSQL is deprecated, please use USES=pgsql:${WANT_PGSQL_VER:C,^.,&.,}
.else
-PGSQL_VER?= ${DEFAULT_PGSQL_VER}
+_USES_POST+= pgsql
+_pgsql_devwarning= USE_PGSQL is deprecated, please use USES=pgsql
.endif
+.for dep in contrib docs pgtcl pltcl plperl server
+WANT_PGSQL+= ${USE_PGSQL:M$dep}
+.endfor
-# And now we are checking if we can use it
-.if defined(PGSQL${PGSQL_VER}_LIBVER)
-.if defined(IGNORE_WITH_PGSQL)
-. for ver in ${IGNORE_WITH_PGSQL}
-. if (${PGSQL_VER} == ${ver})
-IGNORE?= cannot install: does not work with postgresql${PGSQL_VER}-client (PostgresSQL ${IGNORE_WITH_PGSQL} not supported)
-. endif
-. endfor
-.endif # IGNORE_WITH_PGSQL
-
-LIB_DEPENDS+= pq.${PGSQL${PGSQL_VER}_LIBVER}:${PORTSDIR}/databases/postgresql${PGSQL_VER}-client
-
-_USE_PGSQL_DEP= contrib docs pgtcl pltcl plperl server
-_USE_PGSQL_DEP_contrib= pgbench
-_USE_PGSQL_DEP_docs= postgresql${PGSQL_VER}-docs>0
-_USE_PGSQL_DEP_pgtcl= ${LOCALBASE}/lib/pgtcl/pkgIndex.tcl
-_USE_PGSQL_DEP_plperl= postgresql${PGSQL_VER}-plperl>0
-_USE_PGSQL_DEP_pltcl= postgresql${PGSQL_VER}-pltcl>0
-_USE_PGSQL_DEP_server= postgres
-. for depend in ${_USE_PGSQL_DEP}
-. if ${USE_PGSQL:M${depend}}
-BUILD_DEPENDS+= ${_USE_PGSQL_DEP_${depend}}:${PORTSDIR}/databases/postgresql${PGSQL_VER}-${depend}
-RUN_DEPENDS+= ${_USE_PGSQL_DEP_${depend}}:${PORTSDIR}/databases/postgresql${PGSQL_VER}-${depend}
-. elif ${USE_PGSQL:M${depend}\:*}
-BUILD_DEPENDS+= ${NONEXISTENT}:${PORTSDIR}/databases/postgresql${PGSQL_VER}-${depend}:${USE_PGSQL:M${depend}\:*:C,^[^:]*\:,,}
-. endif
-. endfor
-
+.if !empty(WANT_PGSQL)
+DEV_WARNING+= "${_pgsql_devwarning} and WANT_PGSQL=${WANT_PGSQL}"
.else
-IGNORE?= cannot install: unknown PostgreSQL version: ${PGSQL_VER}
-.endif # Check for correct version
-CPPFLAGS+= -I${LOCALBASE}/include
-LDFLAGS+= -L${LOCALBASE}/lib
+DEV_WARNING+= "${_pgsql_devwarning}"
+.endif
+
.endif # USE_PGSQL
.if defined(USE_BDB)