fix xpi extraction
[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+=   libmysqlclient.so.${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 94
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 PGSQL94_LIBVER=         5
211
212 # Setting/finding PostgreSQL version we want.
213 .  if exists(${LOCALBASE}/bin/pg_config)
214 _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'
215 WITH_PGSQL_VER?=        ${_PGSQL_VER}
216 .        if ${WITH_PGSQL_VER} != ${_PGSQL_VER}
217 IGNORE?=                cannot install: you have set WITH_PGSQL_VER=${WITH_PGSQL_VER} in make.conf, but you have postgresql${_PGSQL_VER}-client installed
218 .        endif
219 .  endif
220
221 .  if defined(WANT_PGSQL_VER)
222 .    if ${WANT_PGSQL_VER:M*+}
223 .      for version in ${VALID_PGSQL_VER}
224 .        if ${WANT_PGSQL_VER:S/+//} <= ${version}
225 _WANT_PGSQL_VER+=${version}
226 .        endif
227 .      endfor
228 .    elif ${WANT_PGSQL_VER:M*-}
229 .      for version in ${VALID_PGSQL_VER}
230 .        if ${WANT_PGSQL_VER:S/-//} >= ${version}
231 _WANT_PGSQL_VER+=${version}
232 .        endif
233 .      endfor
234 .    endif
235 _WANT_PGSQL_VER?=       ${WANT_PGSQL_VER}
236 .  endif
237
238 .  if !empty(_WANT_PGSQL_VER)
239 .    for version in ${_WANT_PGSQL_VER}
240 .      if defined(WITH_PGSQL_VER)
241 .        if ${WITH_PGSQL_VER} == ${version}
242 PGSQL_VER=      ${WITH_PGSQL_VER}
243 .        endif
244 .      elif ${DEFAULT_PGSQL_VER} == ${version}
245 PGSQL_VER=      ${version}
246 .      endif
247 PGSQL_VER?=     ${version}
248 .    endfor
249 .    if defined(WITH_PGSQL_VER) && ${WITH_PGSQL_VER} != ${PGSQL_VER}
250 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
251 .    endif
252 .  endif
253
254 .if !empty(WITH_PGSQL_VER)
255 PGSQL_VER?=     ${WITH_PGSQL_VER}
256 .else
257 PGSQL_VER?=     ${DEFAULT_PGSQL_VER}
258 .endif
259
260 # And now we are checking if we can use it
261 .if defined(PGSQL${PGSQL_VER}_LIBVER)
262 .if defined(IGNORE_WITH_PGSQL)
263 .       for ver in ${IGNORE_WITH_PGSQL}
264 .               if (${PGSQL_VER} == ${ver})
265 IGNORE?=                cannot install: does not work with postgresql${PGSQL_VER}-client (PostgresSQL ${IGNORE_WITH_PGSQL} not supported)
266 .               endif
267 .       endfor
268 .endif # IGNORE_WITH_PGSQL
269
270 LIB_DEPENDS+=   libpq.so.${PGSQL${PGSQL_VER}_LIBVER}:${PORTSDIR}/databases/postgresql${PGSQL_VER}-client
271
272 _USE_PGSQL_DEP=                 contrib docs pgtcl pltcl plperl server
273 _USE_PGSQL_DEP_contrib= pgbench
274 _USE_PGSQL_DEP_docs=    postgresql${PGSQL_VER}-docs>0
275 _USE_PGSQL_DEP_pgtcl=   ${LOCALBASE}/lib/pgtcl/pkgIndex.tcl
276 _USE_PGSQL_DEP_plperl=  postgresql${PGSQL_VER}-plperl>0
277 _USE_PGSQL_DEP_pltcl=   postgresql${PGSQL_VER}-pltcl>0
278 _USE_PGSQL_DEP_server=  postgres
279 .  for depend in ${_USE_PGSQL_DEP}
280 .    if ${USE_PGSQL:M${depend}}
281 BUILD_DEPENDS+= ${_USE_PGSQL_DEP_${depend}}:${PORTSDIR}/databases/postgresql${PGSQL_VER}-${depend}
282 RUN_DEPENDS+=   ${_USE_PGSQL_DEP_${depend}}:${PORTSDIR}/databases/postgresql${PGSQL_VER}-${depend}
283 .    elif ${USE_PGSQL:M${depend}\:*}
284 BUILD_DEPENDS+= ${NONEXISTENT}:${PORTSDIR}/databases/postgresql${PGSQL_VER}-${depend}:${USE_PGSQL:M${depend}\:*:C,^[^:]*\:,,}
285 .    endif
286 .  endfor
287
288 .else
289 IGNORE?=                cannot install: unknown PostgreSQL version: ${PGSQL_VER}
290 .endif # Check for correct version
291 CPPFLAGS+=              -I${LOCALBASE}/include
292 LDFLAGS+=               -L${LOCALBASE}/lib
293 .endif # USE_PGSQL
294
295 .if defined(USE_BDB)
296
297 _DB_PORTS=      40 41 42 43 44 46 47 48 5 6 40+ 41+ 42+ 43+ 44+ 46+ 47+ 48+ 5+ 6+
298 # Dependence lines for different db versions
299 db40_DEPENDS=   libdb4.so:${PORTSDIR}/databases/db4
300 db41_DEPENDS=   libdb41.so:${PORTSDIR}/databases/db41
301 db42_DEPENDS=   libdb-4.2.so:${PORTSDIR}/databases/db42
302 db43_DEPENDS=   libdb-4.3.so:${PORTSDIR}/databases/db43
303 db44_DEPENDS=   libdb-4.4.so:${PORTSDIR}/databases/db44
304 db46_DEPENDS=   libdb-4.6.so:${PORTSDIR}/databases/db46
305 db47_DEPENDS=   libdb-4.7.so:${PORTSDIR}/databases/db47
306 db48_DEPENDS=   libdb-4.8.so:${PORTSDIR}/databases/db48
307 db5_DEPENDS=    libdb-5.3.so:${PORTSDIR}/databases/db5
308 db6_DEPENDS=    libdb-6.0.so:${PORTSDIR}/databases/db6
309 # Detect db versions by finding some files
310 db40_FIND=      ${LOCALBASE}/include/db4/db.h
311 db41_FIND=      ${LOCALBASE}/include/db41/db.h
312 db42_FIND=      ${LOCALBASE}/include/db42/db.h
313 db43_FIND=      ${LOCALBASE}/include/db43/db.h
314 db44_FIND=      ${LOCALBASE}/include/db44/db.h
315 db46_FIND=      ${LOCALBASE}/include/db46/db.h
316 db47_FIND=      ${LOCALBASE}/include/db47/db.h
317 db48_FIND=      ${LOCALBASE}/include/db48/db.h
318 db5_FIND=       ${LOCALBASE}/include/db5/db.h
319 db6_FIND=       ${LOCALBASE}/include/db6/db.h
320
321 # For specifying [40, 41, ..]+
322 _DB_40P=        40 ${_DB_41P}
323 _DB_41P=        41 ${_DB_42P}
324 _DB_42P=        42 ${_DB_43P}
325 _DB_43P=        43 ${_DB_44P}
326 _DB_44P=        44 ${_DB_46P}
327 _DB_46P=        46 ${_DB_47P}
328 _DB_47P=        47 ${_DB_48P}
329 _DB_48P=        48 ${_DB_5P}
330 _DB_5P=         5 ${_DB_6P}
331 _DB_6P=         6
332
333 # Override the global WITH_BDB_VER with the
334 # port specific <UNIQUENAME>_WITH_BDB_VER
335 .if defined(${UNIQUENAME:tu:S,-,_,}_WITH_BDB_VER)
336 WITH_BDB_VER=   ${${UNIQUENAME:tu:S,-,_,}_WITH_BDB_VER}
337 .endif
338
339 .if defined(WITH_BDB_VER)
340 . if ${WITH_BDB_VER} == 4
341 USE_BDB=        40
342 . elif ${WITH_BDB_VER} != 1
343 USE_BDB=        ${WITH_BDB_VER}
344 . endif
345 .endif
346 _WANT_BDB_VER=  ${USE_BDB}
347
348 # Assume the default bdb version as 48
349 .if ${USE_BDB:tl} == "yes"
350 _WANT_BDB_VER=  48
351 .endif
352
353 # Detect bdb version
354 _BDB_VER=       no
355 _BDB_IGNORE=    no
356
357 # Override the user defined WITH_BDB_VER with the WANT_BDB_VER
358 .if defined(WANT_BDB_VER)
359 .for bdb in ${_DB_PORTS}
360 .if ${WANT_BDB_VER} == "${bdb}" && ${_BDB_VER} == "no"
361 _BDB_VER=       ${WANT_BDB_VER}
362 .endif
363 .endfor
364 USE_BDB=        ${WANT_BDB_VER}
365 .else
366 .for bdb in ${_DB_PORTS}
367 .if ${_WANT_BDB_VER} == "${bdb}" && ${_BDB_VER} == "no"
368 _MATCHED_DB_VER:=       ${bdb:S/+//}
369 . if ${_MATCHED_DB_VER} == "${bdb}"
370 # USE_BDB is exactly specified
371 _BDB_VER=       ${bdb}
372 .else
373 # USE_BDB is specified as VER+
374 .  for dbx in ${_DB_${_MATCHED_DB_VER}P}
375 .   if exists(${db${dbx}_FIND})
376 _BRKDB= no
377 # Skip versions we are incompatible with
378 .    if defined(INVALID_BDB_VER)
379 _CHK_BDB:=      ${dbx}
380 .     for BRKDB in ${INVALID_BDB_VER}
381 .      if ${_CHK_BDB} == "${BRKDB}"
382 _BRKDB= yes
383 .      endif
384 .     endfor
385 .    endif
386 .    if ${_BRKDB} == no
387 .     if defined(WITH_BDB_HIGHEST)
388 # Use the highest version of Berkeley DB found
389 _BDB_VER=       ${dbx}
390 .     elif ${_BDB_VER} == no
391 # Use the first Berkeley DB found
392 _BDB_VER=       ${dbx}
393 .     endif
394 .    endif
395 .   endif
396 .  endfor
397 .  if ${_BDB_VER} == "no"
398 # No existing db4 version is detected in system, use the default
399 _BDB_VER=       48
400 .  endif
401 . endif
402 .endif
403 .endfor
404 .endif
405
406 # USE_BDB is specified incorrectly, so mark this as IGNORE
407 .if ${_BDB_VER} == "no"
408 IGNORE=         cannot install: unknown Berkeley DB version: ${USE_BDB}
409 .else
410 # Now check if we can use it
411 . if defined(INVALID_BDB_VER)
412 .  for VER in ${INVALID_BDB_VER}
413 _CHK_PLUS:=     ${VER:S/+//}
414 # INVALID_BDB_VER is specified as VER+
415 .   if ${_CHK_PLUS}  != "${VER}"
416 .    if ${_BDB_VER} == "${_CHK_PLUS}"
417 _BDB_IGNORE=    yes
418 .    else
419 .     for VER_P in ${_DB_${_CHK_PLUS}P}
420 .      if ${_BDB_VER} == "${VER_P}"
421 _BDB_IGNORE=    yes
422 .      endif
423 .     endfor
424 .    endif
425 .   elif ${_BDB_VER} == "${VER}"
426 _BDB_IGNORE=    yes
427 .   endif
428 .  endfor
429 . endif
430 . if ${_BDB_IGNORE} == "yes"
431 IGNORE=         cannot install: does not work with Berkeley DB version ${_BDB_VER} (${INVALID_BDB_VER} not supported)
432 . else
433 # Now add the dependency on Berkeley DB ${_BDB_VER) version
434 # This is for ports that want to link Berkeley DB statically, such
435 # as devel/subversion, if the corresponding option is active:
436 .if defined(BDB_BUILD_DEPENDS)
437 BUILD_DEPENDS+= ${db${_BDB_VER}_FIND}:${db${_BDB_VER}_DEPENDS:C/^libdb.*://}
438 .else
439 LIB_DEPENDS+=   ${db${_BDB_VER}_DEPENDS}
440 .endif
441 .  if ${_BDB_VER} == 40
442 BDB_LIB_NAME=           db4
443 BDB_LIB_CXX_NAME=       db4_cxx
444 BDB_INCLUDE_DIR=        ${LOCALBASE}/include/db4
445 .  elif ${_BDB_VER} == 42
446 BDB_LIB_NAME=           db-4.2
447 BDB_LIB_CXX_NAME=       db_cxx-4.2
448 BDB_LIB_DIR=            ${LOCALBASE}/lib/db42
449 .  elif ${_BDB_VER} == 43
450 BDB_LIB_NAME=           db-4.3
451 BDB_LIB_CXX_NAME=       db_cxx-4.3
452 BDB_LIB_DIR=            ${LOCALBASE}/lib/db43
453 .  elif ${_BDB_VER} == 44
454 BDB_LIB_NAME=           db-4.4
455 BDB_LIB_CXX_NAME=       db_cxx-4.4
456 BDB_LIB_DIR=            ${LOCALBASE}/lib/db44
457 .  elif ${_BDB_VER} == 46
458 BDB_LIB_NAME=           db-4.6
459 BDB_LIB_CXX_NAME=       db_cxx-4.6
460 BDB_LIB_DIR=            ${LOCALBASE}/lib/db46
461 .  elif ${_BDB_VER} == 47
462 BDB_LIB_NAME=           db-4.7
463 BDB_LIB_CXX_NAME=       db_cxx-4.7
464 BDB_LIB_DIR=            ${LOCALBASE}/lib/db47
465 .  elif ${_BDB_VER} == 48
466 BDB_LIB_NAME=           db-4.8
467 BDB_LIB_CXX_NAME=       db_cxx-4.8
468 BDB_LIB_DIR=            ${LOCALBASE}/lib/db48
469 .  elif ${_BDB_VER} == 5
470 BDB_LIB_NAME=           db-5.3
471 BDB_LIB_CXX_NAME=       db_cxx-5.3
472 BDB_LIB_DIR=            ${LOCALBASE}/lib/db5
473 .  elif ${_BDB_VER} == 6
474 BDB_LIB_NAME=           db-6.0
475 BDB_LIB_CXX_NAME=       db_cxx-6.0
476 BDB_LIB_DIR=            ${LOCALBASE}/lib/db6
477 .  endif
478 BDB_LIB_NAME?=          db${_BDB_VER}
479 BDB_LIB_CXX_NAME?=      db${_BDB_VER}_cxx
480 BDB_INCLUDE_DIR?=       ${LOCALBASE}/include/db${_BDB_VER}
481 BDB_LIB_DIR?=           ${LOCALBASE}/lib
482 . endif
483 BDB_VER=        ${_BDB_VER}
484 .endif
485
486 # Obsolete variables - ports can define these to want users about
487 # variables that may be in /etc/make.conf but that are no longer
488 # effective:
489 .if defined(OBSOLETE_BDB_VAR)
490 . for var in ${OBSOLETE_BDB_VAR}
491 .  if defined(${var})
492 BAD_VAR+=       ${var},
493 .  endif
494 . endfor
495 . if defined(BAD_VAR)
496 _IGNORE_MSG=    Obsolete variable(s) ${BAD_VAR} use WITH_BDB_VER or ${UNIQUENAME:tu:S,-,_,}_WITH_BDB_VER to select Berkeley DB version
497 .  if defined(IGNORE)
498 IGNORE+= ${_IGNORE_MSG}
499 .  else
500 IGNORE= ${_IGNORE_MSG}
501 .  endif
502 . endif
503 .endif
504
505 .endif # USE_BDB
506
507 # Handling SQLite dependency
508 .if defined(USE_SQLITE)
509
510 .if ${USE_SQLITE:tl} == "yes"
511 _SQLITE_VER=    3
512 .else
513 _SQLITE_VER=     ${USE_SQLITE}
514 .endif
515
516 # USE_SQLITE is specified incorrectly, so mark this as IGNORE
517 .if ${_SQLITE_VER} == "3"
518 LIB_DEPENDS+=   libsqlite3.so:${PORTSDIR}/databases/sqlite${_SQLITE_VER}
519 SQLITE_VER=     ${_SQLITE_VER}
520 .elif ${_SQLITE_VER} == "2"
521 LIB_DEPENDS+=   libsqlite.so:${PORTSDIR}/databases/sqlite${_SQLITE_VER}
522 SQLITE_VER=     ${_SQLITE_VER}
523 .else
524 IGNORE=         cannot install: unknown SQLite version: ${_SQLITE_VER}
525 .endif
526
527 .endif # defined(USE_SQLITE)
528
529 .if defined(USE_FIREBIRD)
530
531 .if defined(WITH_FIREBIRD_VER)
532 USE_FIREBIRD=   ${WITH_FIREBIRD_VER}
533 .endif
534
535 .if ${USE_FIREBIRD:tl} == "yes"
536 FIREBIRD_VER=   ${FIREBIRD_DEFAULT:S/.//}
537 .else
538 FIREBIRD_VER=   ${USE_FIREBIRD}
539 .endif
540
541 .if ${FIREBIRD_VER} == "21"
542 LIB_DEPENDS+=   libfbclient.so:${PORTSDIR}/databases/firebird21-client
543 .elif ${FIREBIRD_VER} == "25"
544 LIB_DEPENDS+=   libfbclient.so:${PORTSDIR}/databases/firebird25-client
545 .else
546 IGNORE=         cannot install: unknown Firebird version: ${FIREBIRD_VER}
547 .endif
548
549 .endif # defined(USE_FIREBIRD)
550
551 .endif # defined(_POSTMKINCLUDED) && !defined(Database_Post_Include)