summaryrefslogtreecommitdiff
path: root/databases/rubygem-dbm
diff options
context:
space:
mode:
authorKoichiro Iwao <meta@FreeBSD.org>2019-04-30 11:22:58 +0000
committerKoichiro Iwao <meta@FreeBSD.org>2019-04-30 11:22:58 +0000
commitfcf98f7079e6bb94af367ffadbdba9591b0726ab (patch)
tree7e9498f9cbd2b59fe843e123d4ad3839746aef3c /databases/rubygem-dbm
parentsecurity/libssh2: Update to 1.8.2 (diff)
lang/ruby2[45]: Remove dbm library and replace it with databases/rubygem-dbm
PR: 230289 Submitted by: Yasuhiro KIMURA <yasu@utahime.org> (initial revision) meta (myself) Reviewed by: sunpoet, ruby Approved by: sunpoet Differential Revision: https://reviews.freebsd.org/D20000
Diffstat (limited to 'databases/rubygem-dbm')
-rw-r--r--databases/rubygem-dbm/Makefile33
-rw-r--r--databases/rubygem-dbm/distinfo3
-rw-r--r--databases/rubygem-dbm/files/patch-ext_dbm_extconf.rb59
-rw-r--r--databases/rubygem-dbm/pkg-descr24
4 files changed, 119 insertions, 0 deletions
diff --git a/databases/rubygem-dbm/Makefile b/databases/rubygem-dbm/Makefile
new file mode 100644
index 000000000000..fd990c6ff0bd
--- /dev/null
+++ b/databases/rubygem-dbm/Makefile
@@ -0,0 +1,33 @@
+# $FreeBSD$
+
+PORTNAME= dbm
+PORTVERSION= 1.0.0
+CATEGORIES= databases rubygems
+MASTER_SITES= RG
+
+MAINTAINER= yasu@utahime.org
+COMMENT= Wrapper for the UNIX-style Database Manager Library
+
+LICENSE= BSD2CLAUSE
+
+USES= gem
+USE_RUBY= yes
+
+OPTIONS_SINGLE= BACKEND
+OPTIONS_SINGLE_BACKEND= BDB GDBM LIBC QDBM
+OPTIONS_DEFAULT= BDB
+BACKEND_DESC= Select backend dbm library
+BDB_USES= bdb
+BDB_CONFIGURE_ON= --with-dbm-type=db${BDB_VER}
+GDBM_CONFIGURE_ON= --with-dbm-type=gdbm_compat
+GDBM_LIB_DEPENDS= libgdbm.so:databases/gdbm
+LIBC_DESC= libc ndbm support
+LIBC_CONFIGURE_ON= --with-dbm-type=libc
+QDBM_DESC= QDBM support
+QDBM_CONFIGURE_ON= --with-dbm-type=qdbm
+QDBM_LIB_DEPENDS= libqdbm.so:databases/qdbm
+
+pre-configure-GDBM-on:
+ @if [ ! -f ${LOCALBASE}/lib/libgdbm_compat.a ]; then ${ECHO_CMD} You need to reinstall database/gdbm with COMPAT option ON.; exit 1; fi
+
+.include <bsd.port.mk>
diff --git a/databases/rubygem-dbm/distinfo b/databases/rubygem-dbm/distinfo
new file mode 100644
index 000000000000..fcc132f7ae83
--- /dev/null
+++ b/databases/rubygem-dbm/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1533121221
+SHA256 (rubygem/dbm-1.0.0.gem) = 68d75998920c92bd81dc9f26e53fb821fa647ba74864cf99ed05fb7afd36317f
+SIZE (rubygem/dbm-1.0.0.gem) = 14336
diff --git a/databases/rubygem-dbm/files/patch-ext_dbm_extconf.rb b/databases/rubygem-dbm/files/patch-ext_dbm_extconf.rb
new file mode 100644
index 000000000000..18086d74c57b
--- /dev/null
+++ b/databases/rubygem-dbm/files/patch-ext_dbm_extconf.rb
@@ -0,0 +1,59 @@
+--- ext/dbm/extconf.rb.orig 2018-08-01 14:46:21 UTC
++++ ext/dbm/extconf.rb
+@@ -23,7 +23,7 @@ dir_config("dbm")
+ if dblib = with_config("dbm-type", nil)
+ dblib = dblib.split(/[ ,]+/)
+ else
+- dblib = %w(libc db db2 db1 db5 db4 db3 gdbm_compat gdbm qdbm)
++ dblib = %w(libc db db2 db1 db6 db5 db48 db3 gdbm_compat gdbm qdbm)
+ end
+
+ headers = {
+@@ -32,8 +32,9 @@ headers = {
+ "db1" => ["db1/ndbm.h", "db1.h", "ndbm.h"],
+ "db2" => ["db2/db.h", "db2.h", "db.h"],
+ "db3" => ["db3/db.h", "db3.h", "db.h"],
+- "db4" => ["db4/db.h", "db4.h", "db.h"],
++ "db48" => ["db48/db.h", "db4.h", "db.h"],
+ "db5" => ["db5/db.h", "db5.h", "db.h"],
++ "db6" => ["db6/db.h", "db6.h", "db.h"],
+ "gdbm_compat" => ["gdbm-ndbm.h", "gdbm/ndbm.h", "ndbm.h"], # GDBM since 1.8.1
+ "gdbm" => ["gdbm-ndbm.h", "gdbm/ndbm.h", "ndbm.h"], # GDBM until 1.8.0
+ "qdbm" => ["qdbm/relic.h", "relic.h"],
+@@ -125,13 +126,26 @@ end
+
+
+ def headers.db_check2(db, hdr)
++ libraries = {
++ "db" => "db",
++ "db1" => "db1",
++ "db2" => "db2",
++ "db3" => "db3",
++ "db48" => "db-4.8",
++ "db5" => "db-5",
++ "db6" => "db-6",
++ "gdbm_compat" => "gdbm_compat",
++ "gdbm" => "gdbm",
++ "qdbm" => "qdbm",
++ }
++
+ $defs.push(%{-DRUBYDBM_DBM_HEADER='"#{hdr}"'})
+ $defs.push(%{-DRUBYDBM_DBM_TYPE='"#{db}"'})
+
+ hsearch = nil
+
+ case db
+- when /^db[2-5]?$/
++ when /^db[2-6].*$/
+ hsearch = "-DDB_DBM_HSEARCH"
+ when "gdbm_compat"
+ have_library("gdbm") or return false
+@@ -145,7 +159,7 @@ def headers.db_check2(db, hdr)
+ # 4.3BSD original ndbm is contained in libc.
+ # 4.4BSD (and its derivatives such as NetBSD) contains Berkeley DB 1 in libc.
+ if !(db == 'libc' ? have_func('dbm_open("", 0, 0)', hdr, hsearch) :
+- have_library(db, 'dbm_open("", 0, 0)', hdr, hsearch))
++ have_library(libraries[db], 'dbm_open("", 0, 0)', hdr, hsearch))
+ return false
+ end
+
diff --git a/databases/rubygem-dbm/pkg-descr b/databases/rubygem-dbm/pkg-descr
new file mode 100644
index 000000000000..81308c194112
--- /dev/null
+++ b/databases/rubygem-dbm/pkg-descr
@@ -0,0 +1,24 @@
+The DBM class provides a wrapper to a Unix-style Database Manager
+library.
+
+Dbm databases do not have tables or columns; they are simple key-value
+data stores, like a Ruby Hash except not resident in RAM. Keys and
+values must be strings.
+
+The exact library used depends on how Ruby was compiled. It could be
+any of the following:
+
+* The original ndbm library is released in 4.3BSD. It is based on dbm
+ library in Unix Version 7 but has different API to support multiple
+ databases in a process.
+* Berkeley DB versions 1 thru 6, also known as BDB and Sleepycat DB,
+ now owned by Oracle Corporation.
+* Berkeley DB 1.x, still found in 4.4BSD derivatives (FreeBSD,
+ OpenBSD, etc).
+* GDBM, the GNU implementation of dbm.
+* QDBM, another open source reimplementation of dbm.
+
+All of these dbm implementations have their own Ruby interfaces
+available, which provide richer (but varying) APIs.
+
+WWW: https://github.com/ruby/dbm