diff --git Makefile Makefile index 6a59cb2..32fb2b4 100644 --- Makefile +++ Makefile @@ -18,8 +18,13 @@ COMMENT= FreeBSD ports/packages administration and management tool suite LICENSE= BSD -OPTIONS= BDB4 "Use Berkeley DB >=2 as backend" on \ - BDB1 "Use Berkeley DB 1.85 as backend" off +OPTIONS_DEFINE= DB_OVERRIDE +OPTIONS_SINGLE= DB_OVERRIDE +OPTIONS_SINGLE_DB_OVERRIDE= BDB4 BDB1 +OPTIONS_DEFAULT= DB_OVERRIDE BDB4 +DB_OVERRIDE_DESC= Override DB backend instead of default DBM +BDB1_DESC= Use Berkeley DB 1 +BDB4_DESC= Use Berkeley DB >=2 CONFLICTS_INSTALL= portupgrade-devel-* @@ -50,18 +55,17 @@ MANCOMPRESSED= maybe EXAMPLESDIR= ${PREFIX}/share/examples/pkgtools DOCSDIR= ${PREFIX}/share/doc/pkgtools +.include + INSTALL_TARGET= install -.if !defined(NOPORTDOCS) +.if ${PORT_OPTIONS:MDOCS} INSTALL_TARGET+= install-doc .endif -.include - -.if defined(WITH_BDB4) +.if ${PORT_OPTIONS:MBDB4} # For PKG_DBDRIVER={bdb_btree,bdb_hash} RUN_DEPENDS+= ${RUBY_SITEARCHLIBDIR}/bdb.so:${PORTSDIR}/databases/ruby-bdb -.endif -.if defined(WITH_BDB1) && !defined(WITH_BDB4) +.elif ${PORT_OPTIONS:MBDB1} # For PKG_DBDRIVER={bdb1_btree,bdb1_hash} RUN_DEPENDS+= ${RUBY_SITEARCHLIBDIR}/bdb1.so:${PORTSDIR}/databases/ruby-bdb1 .endif @@ -72,18 +76,9 @@ RUN_DEPENDS+= ${RUBY_SITELIBDIR}/parsedate.rb:${PORTSDIR}/devel/ruby-date2 .endif pre-extract: -.if !defined(WITH_BDB4) && !defined(WITH_BDB1) - @${ECHO_MSG} "=================================================================" - @${ECHO_MSG} "Neither WITH_BDB4 nor WITH_BDB1 are defined. Will use DBD driver." - @${ECHO_MSG} "=================================================================" -.endif -.if defined(WITH_BDB4) && defined(WITH_BDB1) - @${ECHO_MSG} "=================================================================" - @${ECHO_MSG} "Both WITH_BDB4 and WITH_BDB1 are defined. Will use BDB4 driver." - @${ECHO_MSG} "=================================================================" -.elif defined(WITH_BDB1) && exists(${RUBY_SITEARCHLIBDIR}/bdb.so) +.if exists(${RUBY_SITEARCHLIBDIR}/bdb.so) && ${PORT_OPTIONS:MBDB1} @${ECHO_MSG} "=================================================================" - @${ECHO_MSG} "WITH_BDB1 is defined but ruby-bdb port installed." + @${ECHO_MSG} "BDB1 is defined but databases/ruby-bdb port installed." @${ECHO_MSG} "Remove ruby-bdb or redefine options." @${ECHO_MSG} "=================================================================" @exit 1