Import security/amavis-stats version 0.1.12_3
[dports.git] / Mk / bsd.database.mk
1 # -*- tab-width: 4; -*-
2 # ex: ts=4
3 #
4 # $FreeBSD$
5 #
6
7 .if defined(_POSTMKINCLUDED) && !defined(Database_Post_Include)
8
9 Database_Post_Include=                  bsd.database.mk
10 Database_Include_MAINTAINER=    ports@FreeBSD.org
11
12 # This file contains some routines to interact with different databases, such
13 # as MySQL, PostgreSQL, and Berkley DB.  To include this file, define macro
14 # USE_[DATABASE], for example USE_MYSQL.  Defining macro like
15 # USE_[DATABASE]_VER or WANT_[DATABASE]_VER will include this file as well.
16 #
17 ##
18 # USE_MYSQL             - Add MySQL (client/server/embedded) dependency (default:
19 #                                 client).
20 #                                 If no version is given (by the maintainer via the port or
21 #                                 by the user via defined variable), try to find the
22 #                                 currently installed version.  Fall back to default if
23 #                                 necessary (MySQL-5.5 = 55).
24 # DEFAULT_MYSQL_VER
25 #                               - MySQL default version.  Can be overridden within a port.
26 #                                 Default: 55.
27 # WANT_MYSQL_VER
28 #                               - Maintainer can set an arbitrary version of MySQL to always
29 #                                 build this port with (overrides WITH_MYSQL_VER).
30 # IGNORE_WITH_MYSQL
31 #                               - This variable can be defined if the ports does not support
32 #                                 one or more versions of MySQL.
33 # WITH_MYSQL_VER
34 #                               - User defined variable to set MySQL version.
35 # MYSQL_VER
36 #                               - Detected MySQL version.
37 ##
38 # USE_PGSQL             - Add PostgreSQL client dependency.  Components can be depended
39 #                                 on using USE_PGSQL=   component[:target].  For the full list
40 #                                 use make -V _USE_PGSQL_DEP
41 #                                 If no version is given (by the maintainer via the port or
42 #                                 by the user via defined variable), try to find the
43 #                                 currently installed version.  Fall back to default if
44 #                                 necessary (PostgreSQL-9.0 = 90).
45 # DEFAULT_PGSQL_VER
46 #                               - PostgreSQL default version, currently 92.
47 # WANT_PGSQL_VER
48 #                               - Maintainer can set an arbitrary version of PostgreSQL to
49 #                                 always build this port with (overrides WITH_PGSQL_VER).
50 #                                 Minimum and maximum versions can be set (e.g. 90+)
51 # WITH_PGSQL_VER
52 #                               - User defined variable to set PostgreSQL version.
53 # PGSQL_VER
54 #                               - Detected PostgreSQL version.
55 ##
56 # USE_BDB               - Add Berkeley DB library dependency.
57 #                                 If no version is given (by the maintainer via the port or
58 #                                 by the user via defined variable), try to find the
59 #                                 currently installed version.  Fall back to default if
60 #                                 necessary (db48).
61 # INVALID_BDB_VER
62 #                               - This variable can be defined when the port does not
63 #                                 support one or more versions of Berkeley DB.
64 # WANT_BDB_VER
65 #                               - Maintainer can set a version of Berkeley DB to always
66 #                                 build this port with (overrides WITH_BDB_VER).
67 # WITH_BDB_VER
68 #                               - User defined global variable to set Berkeley DB version.
69 # <UNIQUENAME>_WITH_BDB_VER
70 #                               - User defined port specific variable to set Berkeley DB
71 #                                 version.
72 # WITH_BDB_HIGHEST
73 #                               - Use the highest installed version of Berkeley DB.
74 # BDB_LIB_NAME
75 #                               - This variable is automatically set to the name of the
76 #                                 Berkeley DB library (default: db48).
77 # BDB_LIB_CXX_NAME
78 #                               - This variable is automatically set to the name of the
79 #                                 Berkeley DB C++ library (default: db48_cxx).
80 # BDB_INCLUDE_DIR
81 #                               - This variable is automatically set to the location of
82 #                                 the Berkeley DB include directory (default:
83 #                                 ${LOCALBASE}/include/db48).
84 # BDB_LIB_DIR
85 #                               - This variable is automatically set to the location of
86 #                                 the Berkeley DB library directory.
87 # BDB_VER
88 #                               - Detected Berkeley DB version.
89 ##
90 # USE_SQLITE    - Add dependency on SQLite library.  Valid values are:
91 #                                 3 and 2.  If version is not specified directly then
92 #                                 SQLite-3 is used (if USE_SQLITE= yes).
93 # SQLITE_VER
94 #                               - Detected SQLite version.
95 ##
96 # USE_FIREBIRD  - Add dependency on Firebird library.  Valid values are:
97 #                                 2 and 1.  If no version is given by the maintainer (if
98 #                                 USE_FIREBIRD= yes) and the user did not define
99 #                                 WITH_FIREBIRD_VER variable, fall back to default "2".
100 # WITH_FIREBIRD_VER
101 #                               - User defined variable to set Firebird version.
102 # FIREBIRD_VER
103 #                               - Detected Firebird version.
104
105 .include "${PORTSDIR}/Mk/bsd.default-versions.mk"
106
107 .if defined(DEFAULT_MYSQL_VER)
108 WARNING+=       "DEFAULT_MYSQL_VER is defined, consider using DEFAULT_VERSIONS=mysql=${DEFAULT_MYSQL_VER} instead"
109 .endif
110
111 .if defined(DEFAULT_PGSQL_VER)
112 WARNING+=       "DEFAULT_PGSQL_VER is defined, consider using DEFAULT_VERSIONS=pgsql=${DEFAULT_PGSQL_VER} instead"
113 .endif
114
115 .if defined(USE_MYSQL)
116 DEFAULT_MYSQL_VER?=     ${MYSQL_DEFAULT:S/.//}
117 # MySQL client version currently supported.
118 MYSQL51_LIBVER=         16
119 MYSQL53m_LIBVER=        16
120 MYSQL55_LIBVER=         18
121 MYSQL55m_LIBVER=        18
122 MYSQL55p_LIBVER=        18
123 MYSQL56_LIBVER=         18
124 MYSQL56p_LIBVER=        18
125
126 # Setting/finding MySQL version we want.
127 .if exists(${LOCALBASE}/bin/mysql)
128 _MYSQL!=        ${LOCALBASE}/bin/mysql --version | ${SED} -e 's/.*Distrib \([0-9]\)\.\([0-9]*\).*/\1\2/'
129 _PERCONA!=      ${LOCALBASE}/bin/mysql --version | ${GREP} Percona | wc -l
130 _MARIADB!=      ${LOCALBASE}/bin/mysql --version | ${GREP} MariaDB | wc -l
131
132 .if ${_PERCONA} == 1
133 _MYSQL_VER=     ${_MYSQL}p
134 .elif ${_MARIADB} == 1
135 _MYSQL_VER=     ${_MYSQL}m
136 .else
137 _MYSQL_VER=     ${_MYSQL}
138 .endif
139 .endif
140
141 .if defined(WANT_MYSQL_VER)
142 .if defined(WITH_MYSQL_VER) && ${WITH_MYSQL_VER} != ${WANT_MYSQL_VER}
143 IGNORE=         cannot install: the port wants mysql${WANT_MYSQL_VER}-client and you try to install mysql${WITH_MYSQL_VER}-client
144 .endif
145 MYSQL_VER=      ${WANT_MYSQL_VER}
146 .elif defined(WITH_MYSQL_VER)
147 MYSQL_VER=      ${WITH_MYSQL_VER}
148 .else
149 .if defined(_MYSQL_VER)
150 MYSQL_VER=      ${_MYSQL_VER}
151 .else
152 MYSQL_VER=      ${DEFAULT_MYSQL_VER}
153 .endif
154 .endif # WANT_MYSQL_VER
155
156 .if defined(_MYSQL_VER)
157 .if ${_MYSQL_VER} != ${MYSQL_VER}
158 IGNORE=         cannot install: MySQL versions mismatch: mysql${_MYSQL_VER}-client is installed and wanted version is mysql${MYSQL_VER}-client
159 .endif
160 .endif
161
162 .if (${MYSQL_VER} == "53m")
163 _MYSQL_CLIENT=  databases/mariadb-client
164 _MYSQL_SERVER=  databases/mariadb-server
165 .elif (${MYSQL_VER} == "55m")
166 _MYSQL_CLIENT=  databases/mariadb55-client
167 _MYSQL_SERVER=  databases/mariadb55-server
168 .elif (${MYSQL_VER} == "55p")
169 _MYSQL_CLIENT=  databases/percona55-client
170 _MYSQL_SERVER=  databases/percona55-server
171 .elif (${MYSQL_VER} == "56p")
172 _MYSQL_CLIENT=  databases/percona56-client
173 _MYSQL_SERVER=  databases/percona56-server
174 .else
175 _MYSQL_CLIENT=  databases/mysql${MYSQL_VER}-client
176 _MYSQL_SERVER=  databases/mysql${MYSQL_VER}-server
177 .endif
178
179 # And now we are checking if we can use it
180 .if defined(MYSQL${MYSQL_VER}_LIBVER)
181 .if defined(IGNORE_WITH_MYSQL)
182 .       for VER in ${IGNORE_WITH_MYSQL}
183 .               if (${MYSQL_VER} == "${VER}")
184 IGNORE=         cannot install: does not work with MySQL version ${MYSQL_VER} (MySQL ${IGNORE_WITH_MYSQL} not supported)
185 .               endif
186 .       endfor
187 .endif # IGNORE_WITH_MYSQL
188 .if (${USE_MYSQL} == "server" || ${USE_MYSQL} == "embedded")
189 RUN_DEPENDS+=   ${LOCALBASE}/libexec/mysqld:${PORTSDIR}/${_MYSQL_SERVER}
190 .if (${USE_MYSQL} == "embedded")
191 BUILD_DEPENDS+= ${LOCALBASE}/lib/mysql/libmysqld.a:${PORTSDIR}/${_MYSQL_SERVER}
192 .endif
193 .else
194 LIB_DEPENDS+=   mysqlclient.${MYSQL${MYSQL_VER}_LIBVER}:${PORTSDIR}/${_MYSQL_CLIENT}
195 .endif
196 .else
197 IGNORE=         cannot install: unknown MySQL version: ${MYSQL_VER}
198 .endif # Check for correct libs
199 .endif # USE_MYSQL
200
201 .if defined(USE_PGSQL)
202 VALID_PGSQL_VER=        84 90 91 92 93
203 DEFAULT_PGSQL_VER?=     ${PGSQL_DEFAULT:S/.//}
204 PGSQL83_LIBVER=         5
205 PGSQL84_LIBVER=         5
206 PGSQL90_LIBVER=         5
207 PGSQL91_LIBVER=         5
208 PGSQL92_LIBVER=         5
209 PGSQL93_LIBVER=         5
210
211 # Setting/finding PostgreSQL version we want.
212 .  if exists(${LOCALBASE}/bin/pg_config)
213 _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'
214 WITH_PGSQL_VER?=        ${_PGSQL_VER}
215 .        if ${WITH_PGSQL_VER} != ${_PGSQL_VER}
216 IGNORE?=                cannot install: you have set WITH_PGSQL_VER=${WITH_PGSQL_VER} in make.conf, but you have postgresql${_PGSQL_VER}-client installed
217 .        endif
218 .  endif
219
220 .  if defined(WANT_PGSQL_VER)
221 .    if ${WANT_PGSQL_VER:M*+}
222 .      for version in ${VALID_PGSQL_VER}
223 .        if ${WANT_PGSQL_VER:S/+//} <= ${version}
224 _WANT_PGSQL_VER+=${version}
225 .        endif
226 .      endfor
227 .    elif ${WANT_PGSQL_VER:M*-}
228 .      for version in ${VALID_PGSQL_VER}
229 .        if ${WANT_PGSQL_VER:S/-//} >= ${version}
230 _WANT_PGSQL_VER+=${version}
231 .        endif
232 .      endfor
233 .    endif
234 _WANT_PGSQL_VER?=       ${WANT_PGSQL_VER}
235 .  endif
236
237 .  if !empty(_WANT_PGSQL_VER)
238 .    for version in ${_WANT_PGSQL_VER}
239 .      if defined(WITH_PGSQL_VER)
240 .        if ${WITH_PGSQL_VER} == ${version}
241 PGSQL_VER=      ${WITH_PGSQL_VER}
242 .        endif
243 .      elif ${DEFAULT_PGSQL_VER} == ${version}
244 PGSQL_VER=      ${version}
245 .      endif
246 PGSQL_VER?=     ${version}
247 .    endfor
248 .    if defined(WITH_PGSQL_VER) && ${WITH_PGSQL_VER} != ${PGSQL_VER}
249 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
250 .    endif
251 .  endif
252
253 .if !empty(WITH_PGSQL_VER)
254 PGSQL_VER?=     ${WITH_PGSQL_VER}
255 .else
256 PGSQL_VER?=     ${DEFAULT_PGSQL_VER}
257 .endif
258
259 # And now we are checking if we can use it
260 .if defined(PGSQL${PGSQL_VER}_LIBVER)
261 .if defined(IGNORE_WITH_PGSQL)
262 .       for ver in ${IGNORE_WITH_PGSQL}
263 .               if (${PGSQL_VER} == ${ver})
264 IGNORE?=                cannot install: does not work with postgresql${PGSQL_VER}-client (PostgresSQL ${IGNORE_WITH_PGSQL} not supported)
265 .               endif
266 .       endfor
267 .endif # IGNORE_WITH_PGSQL
268
269 LIB_DEPENDS+=   pq.${PGSQL${PGSQL_VER}_LIBVER}:${PORTSDIR}/databases/postgresql${PGSQL_VER}-client
270
271 _USE_PGSQL_DEP=                 contrib docs pgtcl pltcl plperl server
272 _USE_PGSQL_DEP_contrib= pgbench
273 _USE_PGSQL_DEP_docs=    postgresql${PGSQL_VER}-docs>0
274 _USE_PGSQL_DEP_pgtcl=   ${LOCALBASE}/lib/pgtcl/pkgIndex.tcl
275 _USE_PGSQL_DEP_plperl=  postgresql${PGSQL_VER}-plperl>0
276 _USE_PGSQL_DEP_pltcl=   postgresql${PGSQL_VER}-pltcl>0
277 _USE_PGSQL_DEP_server=  postgres
278 .  for depend in ${_USE_PGSQL_DEP}
279 .    if ${USE_PGSQL:M${depend}}
280 BUILD_DEPENDS+= ${_USE_PGSQL_DEP_${depend}}:${PORTSDIR}/databases/postgresql${PGSQL_VER}-${depend}
281 RUN_DEPENDS+=   ${_USE_PGSQL_DEP_${depend}}:${PORTSDIR}/databases/postgresql${PGSQL_VER}-${depend}
282 .    elif ${USE_PGSQL:M${depend}\:*}
283 BUILD_DEPENDS+= ${NONEXISTENT}:${PORTSDIR}/databases/postgresql${PGSQL_VER}-${depend}:${USE_PGSQL:M${depend}\:*:C,^[^:]*\:,,}
284 .    endif
285 .  endfor
286
287 .else
288 IGNORE?=                cannot install: unknown PostgreSQL version: ${PGSQL_VER}
289 .endif # Check for correct version
290 CPPFLAGS+=              -I${LOCALBASE}/include
291 LDFLAGS+=               -L${LOCALBASE}/lib
292 .endif # USE_PGSQL
293
294 .if defined(USE_BDB)
295
296 _DB_PORTS=      40 41 42 43 44 46 47 48 5 6 40+ 41+ 42+ 43+ 44+ 46+ 47+ 48+ 5+ 6+
297 # Dependence lines for different db versions
298 db40_DEPENDS=   libdb4.so:${PORTSDIR}/databases/db4
299 db41_DEPENDS=   libdb41.so:${PORTSDIR}/databases/db41
300 db42_DEPENDS=   libdb-4.2.so:${PORTSDIR}/databases/db42
301 db43_DEPENDS=   libdb-4.3.so:${PORTSDIR}/databases/db43
302 db44_DEPENDS=   libdb-4.4.so:${PORTSDIR}/databases/db44
303 db46_DEPENDS=   libdb-4.6.so:${PORTSDIR}/databases/db46
304 db47_DEPENDS=   libdb-4.7.so:${PORTSDIR}/databases/db47
305 db48_DEPENDS=   libdb-4.8.so:${PORTSDIR}/databases/db48
306 db5_DEPENDS=    libdb-5.3.so:${PORTSDIR}/databases/db5
307 db6_DEPENDS=    libdb-6.0.so:${PORTSDIR}/databases/db6
308 # Detect db versions by finding some files
309 db40_FIND=      ${LOCALBASE}/include/db4/db.h
310 db41_FIND=      ${LOCALBASE}/include/db41/db.h
311 db42_FIND=      ${LOCALBASE}/include/db42/db.h
312 db43_FIND=      ${LOCALBASE}/include/db43/db.h
313 db44_FIND=      ${LOCALBASE}/include/db44/db.h
314 db46_FIND=      ${LOCALBASE}/include/db46/db.h
315 db47_FIND=      ${LOCALBASE}/include/db47/db.h
316 db48_FIND=      ${LOCALBASE}/include/db48/db.h
317 db5_FIND=       ${LOCALBASE}/include/db5/db.h
318 db6_FIND=       ${LOCALBASE}/include/db6/db.h
319
320 # For specifying [40, 41, ..]+
321 _DB_40P=        40 ${_DB_41P}
322 _DB_41P=        41 ${_DB_42P}
323 _DB_42P=        42 ${_DB_43P}
324 _DB_43P=        43 ${_DB_44P}
325 _DB_44P=        44 ${_DB_46P}
326 _DB_46P=        46 ${_DB_47P}
327 _DB_47P=        47 ${_DB_48P}
328 _DB_48P=        48 ${_DB_5P}
329 _DB_5P=         5 ${_DB_6P}
330 _DB_6P=         6
331
332 # Override the global WITH_BDB_VER with the
333 # port specific <UNIQUENAME>_WITH_BDB_VER
334 .if defined(${UNIQUENAME:tu:S,-,_,}_WITH_BDB_VER)
335 WITH_BDB_VER=   ${${UNIQUENAME:tu:S,-,_,}_WITH_BDB_VER}
336 .endif
337
338 .if defined(WITH_BDB_VER)
339 . if ${WITH_BDB_VER} == 4
340 USE_BDB=        40
341 . elif ${WITH_BDB_VER} != 1
342 USE_BDB=        ${WITH_BDB_VER}
343 . endif
344 .endif
345 _WANT_BDB_VER=  ${USE_BDB}
346
347 # Assume the default bdb version as 48
348 .if ${USE_BDB:tl} == "yes"
349 _WANT_BDB_VER=  48
350 .endif
351
352 # Detect bdb version
353 _BDB_VER=       no
354 _BDB_IGNORE=    no
355
356 # Override the user defined WITH_BDB_VER with the WANT_BDB_VER
357 .if defined(WANT_BDB_VER)
358 .for bdb in ${_DB_PORTS}
359 .if ${WANT_BDB_VER} == "${bdb}" && ${_BDB_VER} == "no"
360 _BDB_VER=       ${WANT_BDB_VER}
361 .endif
362 .endfor
363 USE_BDB=        ${WANT_BDB_VER}
364 .else
365 .for bdb in ${_DB_PORTS}
366 .if ${_WANT_BDB_VER} == "${bdb}" && ${_BDB_VER} == "no"
367 _MATCHED_DB_VER:=       ${bdb:S/+//}
368 . if ${_MATCHED_DB_VER} == "${bdb}"
369 # USE_BDB is exactly specified
370 _BDB_VER=       ${bdb}
371 .else
372 # USE_BDB is specified as VER+
373 .  for dbx in ${_DB_${_MATCHED_DB_VER}P}
374 .   if exists(${db${dbx}_FIND})
375 _BRKDB= no
376 # Skip versions we are incompatible with
377 .    if defined(INVALID_BDB_VER)
378 _CHK_BDB:=      ${dbx}
379 .     for BRKDB in ${INVALID_BDB_VER}
380 .      if ${_CHK_BDB} == "${BRKDB}"
381 _BRKDB= yes
382 .      endif
383 .     endfor
384 .    endif
385 .    if ${_BRKDB} == no
386 .     if defined(WITH_BDB_HIGHEST)
387 # Use the highest version of Berkeley DB found
388 _BDB_VER=       ${dbx}
389 .     elif ${_BDB_VER} == no
390 # Use the first Berkeley DB found
391 _BDB_VER=       ${dbx}
392 .     endif
393 .    endif
394 .   endif
395 .  endfor
396 .  if ${_BDB_VER} == "no"
397 # No existing db4 version is detected in system, use the default
398 _BDB_VER=       48
399 .  endif
400 . endif
401 .endif
402 .endfor
403 .endif
404
405 # USE_BDB is specified incorrectly, so mark this as IGNORE
406 .if ${_BDB_VER} == "no"
407 IGNORE=         cannot install: unknown Berkeley DB version: ${USE_BDB}
408 .else
409 # Now check if we can use it
410 . if defined(INVALID_BDB_VER)
411 .  for VER in ${INVALID_BDB_VER}
412 _CHK_PLUS:=     ${VER:S/+//}
413 # INVALID_BDB_VER is specified as VER+
414 .   if ${_CHK_PLUS}  != "${VER}"
415 .    if ${_BDB_VER} == "${_CHK_PLUS}"
416 _BDB_IGNORE=    yes
417 .    else
418 .     for VER_P in ${_DB_${_CHK_PLUS}P}
419 .      if ${_BDB_VER} == "${VER_P}"
420 _BDB_IGNORE=    yes
421 .      endif
422 .     endfor
423 .    endif
424 .   elif ${_BDB_VER} == "${VER}"
425 _BDB_IGNORE=    yes
426 .   endif
427 .  endfor
428 . endif
429 . if ${_BDB_IGNORE} == "yes"
430 IGNORE=         cannot install: does not work with Berkeley DB version ${_BDB_VER} (${INVALID_BDB_VER} not supported)
431 . else
432 # Now add the dependency on Berkeley DB ${_BDB_VER) version
433 # This is for ports that want to link Berkeley DB statically, such
434 # as devel/subversion, if the corresponding option is active:
435 .if defined(BDB_BUILD_DEPENDS)
436 BUILD_DEPENDS+= ${db${_BDB_VER}_FIND}:${db${_BDB_VER}_DEPENDS:C/^libdb.*://}
437 .else
438 LIB_DEPENDS+=   ${db${_BDB_VER}_DEPENDS}
439 .endif
440 .  if ${_BDB_VER} == 40
441 BDB_LIB_NAME=           db4
442 BDB_LIB_CXX_NAME=       db4_cxx
443 BDB_INCLUDE_DIR=        ${LOCALBASE}/include/db4
444 .  elif ${_BDB_VER} == 42
445 BDB_LIB_NAME=           db-4.2
446 BDB_LIB_CXX_NAME=       db_cxx-4.2
447 BDB_LIB_DIR=            ${LOCALBASE}/lib/db42
448 .  elif ${_BDB_VER} == 43
449 BDB_LIB_NAME=           db-4.3
450 BDB_LIB_CXX_NAME=       db_cxx-4.3
451 BDB_LIB_DIR=            ${LOCALBASE}/lib/db43
452 .  elif ${_BDB_VER} == 44
453 BDB_LIB_NAME=           db-4.4
454 BDB_LIB_CXX_NAME=       db_cxx-4.4
455 BDB_LIB_DIR=            ${LOCALBASE}/lib/db44
456 .  elif ${_BDB_VER} == 46
457 BDB_LIB_NAME=           db-4.6
458 BDB_LIB_CXX_NAME=       db_cxx-4.6
459 BDB_LIB_DIR=            ${LOCALBASE}/lib/db46
460 .  elif ${_BDB_VER} == 47
461 BDB_LIB_NAME=           db-4.7
462 BDB_LIB_CXX_NAME=       db_cxx-4.7
463 BDB_LIB_DIR=            ${LOCALBASE}/lib/db47
464 .  elif ${_BDB_VER} == 48
465 BDB_LIB_NAME=           db-4.8
466 BDB_LIB_CXX_NAME=       db_cxx-4.8
467 BDB_LIB_DIR=            ${LOCALBASE}/lib/db48
468 .  elif ${_BDB_VER} == 5
469 BDB_LIB_NAME=           db-5.3
470 BDB_LIB_CXX_NAME=       db_cxx-5.3
471 BDB_LIB_DIR=            ${LOCALBASE}/lib/db5
472 .  elif ${_BDB_VER} == 6
473 BDB_LIB_NAME=           db-6.0
474 BDB_LIB_CXX_NAME=       db_cxx-6.0
475 BDB_LIB_DIR=            ${LOCALBASE}/lib/db6
476 .  endif
477 BDB_LIB_NAME?=          db${_BDB_VER}
478 BDB_LIB_CXX_NAME?=      db${_BDB_VER}_cxx
479 BDB_INCLUDE_DIR?=       ${LOCALBASE}/include/db${_BDB_VER}
480 BDB_LIB_DIR?=           ${LOCALBASE}/lib
481 . endif
482 BDB_VER=        ${_BDB_VER}
483 .endif
484
485 # Obsolete variables - ports can define these to want users about
486 # variables that may be in /etc/make.conf but that are no longer
487 # effective:
488 .if defined(OBSOLETE_BDB_VAR)
489 . for var in ${OBSOLETE_BDB_VAR}
490 .  if defined(${var})
491 BAD_VAR+=       ${var},
492 .  endif
493 . endfor
494 . if defined(BAD_VAR)
495 _IGNORE_MSG=    Obsolete variable(s) ${BAD_VAR} use WITH_BDB_VER or ${UNIQUENAME:tu:S,-,_,}_WITH_BDB_VER to select Berkeley DB version
496 .  if defined(IGNORE)
497 IGNORE+= ${_IGNORE_MSG}
498 .  else
499 IGNORE= ${_IGNORE_MSG}
500 .  endif
501 . endif
502 .endif
503
504 .endif # USE_BDB
505
506 # Handling SQLite dependency
507 .if defined(USE_SQLITE)
508
509 .if ${USE_SQLITE:tl} == "yes"
510 _SQLITE_VER=    3
511 .else
512 _SQLITE_VER=     ${USE_SQLITE}
513 .endif
514
515 # USE_SQLITE is specified incorrectly, so mark this as IGNORE
516 .if ${_SQLITE_VER} == "3"
517 LIB_DEPENDS+=   libsqlite3.so:${PORTSDIR}/databases/sqlite${_SQLITE_VER}
518 SQLITE_VER=     ${_SQLITE_VER}
519 .elif ${_SQLITE_VER} == "2"
520 LIB_DEPENDS+=   libsqlite.so:${PORTSDIR}/databases/sqlite${_SQLITE_VER}
521 SQLITE_VER=     ${_SQLITE_VER}
522 .else
523 IGNORE=         cannot install: unknown SQLite version: ${_SQLITE_VER}
524 .endif
525
526 .endif # defined(USE_SQLITE)
527
528 .if defined(USE_FIREBIRD)
529
530 .if defined(WITH_FIREBIRD_VER)
531 USE_FIREBIRD=   ${WITH_FIREBIRD_VER}
532 .endif
533
534 .if ${USE_FIREBIRD:tl} == "yes"
535 FIREBIRD_VER=   25
536 .else
537 FIREBIRD_VER=   ${USE_FIREBIRD}
538 .endif
539
540 .if ${FIREBIRD_VER} == "2"
541 LIB_DEPENDS+=   fbclient.2:${PORTSDIR}/databases/firebird20-client
542 .elif ${FIREBIRD_VER} == "20"
543 LIB_DEPENDS+=   fbclient.2:${PORTSDIR}/databases/firebird20-client
544 .elif ${FIREBIRD_VER} == "21"
545 LIB_DEPENDS+=   fbclient.2:${PORTSDIR}/databases/firebird21-client
546 .elif ${FIREBIRD_VER} == "25"
547 LIB_DEPENDS+=   fbclient.2:${PORTSDIR}/databases/firebird25-client
548 .else
549 IGNORE=         cannot install: unknown Firebird version: ${FIREBIRD_VER}
550 .endif
551
552 .endif # defined(USE_FIREBIRD)
553
554 .endif # defined(_POSTMKINCLUDED) && !defined(Database_Post_Include)