summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbouyer <bouyer@pkgsrc.org>1999-07-07 15:14:25 +0000
committerbouyer <bouyer@pkgsrc.org>1999-07-07 15:14:25 +0000
commitc326c7bdf6e59d6666483032618dd0e5d6bf212b (patch)
tree7843b2ad64599225feea9b92e592524a47c95cca
parent2994c8a0a096c845f646dd3a3a17207df0d97f1e (diff)
downloadpkgsrc-c326c7bdf6e59d6666483032618dd0e5d6bf212b.tar.gz
tcl interface to gdbm.
-rw-r--r--databases/tcl-gdbm/Makefile16
-rw-r--r--databases/tcl-gdbm/files/md53
-rw-r--r--databases/tcl-gdbm/patches/patch-aa13
-rw-r--r--databases/tcl-gdbm/patches/patch-ab13
-rw-r--r--databases/tcl-gdbm/patches/patch-ac35
-rw-r--r--databases/tcl-gdbm/pkg/COMMENT1
-rw-r--r--databases/tcl-gdbm/pkg/DESCR190
-rw-r--r--databases/tcl-gdbm/pkg/PLIST5
8 files changed, 276 insertions, 0 deletions
diff --git a/databases/tcl-gdbm/Makefile b/databases/tcl-gdbm/Makefile
new file mode 100644
index 00000000000..d80ae5a0feb
--- /dev/null
+++ b/databases/tcl-gdbm/Makefile
@@ -0,0 +1,16 @@
+# $NetBSD: Makefile,v 1.1.1.1 1999/07/07 15:14:25 bouyer Exp $
+#
+
+DISTNAME= Tclgdbm0.6
+PKGNAME= tcl-gdbm-0.6
+CATEGORIES= databases
+MASTER_SITES= http://www.tcltk.com/ftp/ellson/
+EXTRACT_SUFX= .tar.gz
+
+MAINTAINER= bouyer@netbsd.org
+
+DEPENDS+= tcl-8.0.5:../../lang/tcl80 \
+ gdbm-1.7.3:../../databases/gdbm
+GNU_CONFIGURE= yes
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/databases/tcl-gdbm/files/md5 b/databases/tcl-gdbm/files/md5
new file mode 100644
index 00000000000..c6f781fb242
--- /dev/null
+++ b/databases/tcl-gdbm/files/md5
@@ -0,0 +1,3 @@
+$NetBSD: md5,v 1.1.1.1 1999/07/07 15:14:26 bouyer Exp $
+
+MD5 (Tclgdbm0.6.tar.gz) = 8af7b3056f4d93cdb921e3302461df75
diff --git a/databases/tcl-gdbm/patches/patch-aa b/databases/tcl-gdbm/patches/patch-aa
new file mode 100644
index 00000000000..3bc1b9bded4
--- /dev/null
+++ b/databases/tcl-gdbm/patches/patch-aa
@@ -0,0 +1,13 @@
+$NetBSD: patch-aa,v 1.1.1.1 1999/07/07 15:14:26 bouyer Exp $
+
+--- configure.orig Tue Jul 6 14:49:35 1999
++++ configure Tue Jul 6 14:52:54 1999
+@@ -624,7 +624,7 @@
+ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+
+-file=${exec_prefix}/lib/tclConfig.sh
++file=${exec_prefix}/lib/tcl8.0/tclConfig.sh
+ . $file
+
+ if test "${TCL_SUPPORTS_STUBS}" = "1"; then
diff --git a/databases/tcl-gdbm/patches/patch-ab b/databases/tcl-gdbm/patches/patch-ab
new file mode 100644
index 00000000000..0e644ac7f48
--- /dev/null
+++ b/databases/tcl-gdbm/patches/patch-ab
@@ -0,0 +1,13 @@
+$NetBSD: patch-ab,v 1.1.1.1 1999/07/07 15:14:26 bouyer Exp $
+
+--- tclgdbm.c.orig Tue Jul 6 14:55:30 1999
++++ tclgdbm.c Tue Jul 6 14:55:41 1999
+@@ -7,7 +7,7 @@
+ #endif
+
+ #include <stdio.h>
+-#include <tcl.h>
++#include <tcl8.0/tcl.h>
+ #include <gdbm.h>
+
+ /*
diff --git a/databases/tcl-gdbm/patches/patch-ac b/databases/tcl-gdbm/patches/patch-ac
new file mode 100644
index 00000000000..4e62a35ed3d
--- /dev/null
+++ b/databases/tcl-gdbm/patches/patch-ac
@@ -0,0 +1,35 @@
+$NetBSD: patch-ac,v 1.1.1.1 1999/07/07 15:14:26 bouyer Exp $
+
+--- Makefile.in.orig Fri Jun 4 14:41:18 1999
++++ Makefile.in Tue Jul 6 15:38:03 1999
+@@ -9,10 +9,10 @@
+ INSTALL = @INSTALL@
+ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+ INSTALL_DATA = @INSTALL_DATA@
+-CC = @CC@
++CC = @CC@ -fPIC -DPIC
+ SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@
+ SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@
+-SHLIB_LD = @TCL_SHLIB_LD@
++SHLIB_LD = ld -Bshareable
+ TCL_PREFIX = @TCL_PREFIX@
+ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@
+ TCL_CFLAGS = @TCL_CFLAGS@ @TCL_STUB_FLAGS@
+@@ -23,7 +23,7 @@
+ STATIC_LIB = lib$(PACKAGE).a
+ PACKAGEDIR = $(TCL_EXEC_PREFIX)/lib/$(PACKAGE)
+
+-CFLAGS = $(TCL_CFLAGS) $(SHLIB_CFLAGS) $(INCLUDES) \
++CFLAGS = $(TCL_CFLAGS) $(INCLUDES) \
+ -DVERSION=\"$(VERSION)\"
+
+ MAN_INSTALL_DIR = $(TCL_PREFIX)/man/mann
+@@ -31,7 +31,7 @@
+ all: $(DLL) pkgIndex.tcl
+
+ $(DLL): $(OBJS)
+- $(SHLIB_LD) -o $@ $(OBJS) $(LIBS)
++ $(SHLIB_LD) -o $@ $(OBJS) -L${PREFIX}/lib $(LIBS)
+
+ $(STATIC_LIB): $(OBJS)
+ ar cr $@ $(OBJS)
diff --git a/databases/tcl-gdbm/pkg/COMMENT b/databases/tcl-gdbm/pkg/COMMENT
new file mode 100644
index 00000000000..135b09fc432
--- /dev/null
+++ b/databases/tcl-gdbm/pkg/COMMENT
@@ -0,0 +1 @@
+tcl interface to gdbm - GNU database manager
diff --git a/databases/tcl-gdbm/pkg/DESCR b/databases/tcl-gdbm/pkg/DESCR
new file mode 100644
index 00000000000..92401ff2dd8
--- /dev/null
+++ b/databases/tcl-gdbm/pkg/DESCR
@@ -0,0 +1,190 @@
+Tclgdbm was hacked together by John Ellson (ellson@lucent.com)
+It was derived from tcl+gdbm by Christian Lindig <lindig@ips.cs.tu-bs.de>
+
+The latest version of Tclgdbm is kept at:
+
+ http://www.tcltk.com/ftp/ellson/
+
+
+tclgdbm 0.1.3 - JE - upgrade to tcl7.5 loadable library
+tclgdbm 0.2 - JE - upgrade to tcl7.6 package (loadable library)
+tclgdbm 0.3 - JE - fixes for tcl8.0
+tclgdbm 0.4 - JE - fix mem leak with patch from: t-tange@ats.nis.nec.co.jp
+tclgdbm 0.5 - JE - add gdbm error, and gdbm writemode
+ with patch from: Scott Beasley <jscottb@InfoAve.Com>
+tclgdbm 0.6 - JE - support for Stubs (8.0.6, 8.1.1, or later)
+
+NOTE: Dynamic loading requires that libgdbm.a be built with -fpic
+ otherwise you may get all kinds of relocation errors from ld.
+
+NOTE: This extension has not yet been converted to use Tcl_Obj
+so the database cannot yet be used to store strings containing NULLs.
+
+
+Tclgdbm
+-------
+
+This directory contains the source of tclgdbm, a dynamically loaded
+extension for accessing GNU gdbm files from tcl/tk. GNU gdbm files
+provide persistent mappings from arbitrary keys to values. tclgdbm
+uses these features to provide mappings from (short) key
+strings to (larger) data strings. The following example illustrates
+the basic new commands, see below for details:
+
+##
+## load dll
+##
+package require Tclgdbm
+
+##
+## open database "test.data" for read/write (create if not existent)
+##
+set db [gdbm open test.data rwc];
+foreach i {1 2 3 4 5 6} {
+ # key is $i, store string "This data for $i"
+ gdbm store $db $i "This data for $i" ;
+}
+
+##
+## gdbm list $db gives list of all keys in $db
+##
+foreach key [lsort [gdbm list $db]] {
+ # retrieve each content and display it
+ puts stdout "$key [gdbm fetch $db $key]" ;
+}
+
+gdbm close $db ;
+
+Commands
+--------
+
+gdbm open <file> [r|rw|rwc|rwn]
+
+Opens a gdbm database <file> with an optional mode. If the mode is not
+given it is opened for reading (r). The mode can be (r) (read only),
+(rw) (read,write), (rwc) (read,write and create if not already
+existent), and (rwn) (read,write and create a new database regardless
+if one exists). The command returns a handle <name> which is used to
+refer to the open database.
+
+gdbm close <name>
+
+Close a gdbm database with the name <name>.
+
+gdbm insert <name> <key> <content>
+
+<name> is the name of a gdbm database previously opened with gdbm
+open. Inserts the data <content> giving it the key <key>. If data
+with <key> is already in the database an error is generated. Nothing
+returned.
+
+gdbm store <name> <key> <content>
+
+<name> is the name of a gdbm database previously opened with gdbm
+open. Inserts <content> to the database. If <key> already exists
+the new <content> replaces the old. Nothing returned.
+
+gdbm fetch <name> <key>
+
+<name> is the name of a gdbm database previously opened with gdbm
+open. Searches for <key> in the database and returns the associated
+contents, or returns a tcl error if the key is not found.
+
+gdbm delete <name> <key>
+
+<name> is the name of a gdbm database previously opened with gdbm
+open. Searches for <key> and deletes it in the database. If <key> is
+not found an error is generated. Nothing returned.
+
+gdbm list <name>
+
+<name> is the name of a gdbm database previously opened with gdbm
+open. Returns a list of all keys in the database.
+
+gdbm reorganize <name>
+
+<name> is the name of a gdbm database previously opened with gdbm
+open. This routine can be used to shrink the size of the database
+file if there have been a lot of deletions. Nothing returned.
+
+gdbm exists <name> <key>
+
+Returns "0" if <key> is not found within the previously opened
+database <name>, "1" otherwise.
+
+gdbm firstkey <name>
+gdbm nextkey <name> <lastkey>
+
+A first/next scheme permits retrieving all keys from a database in
+sequential (but unsorted!) order. gdbm firstkey <name> returns a
+starting key, which may be used to retrieve the following key with
+nextkey. nextkey returns the next key to a given previous key. When no
+next key is available, the empty string is returned.
+
+
+Speed
+-----
+
+Here are some (real) execution times on a SparcStation 2 (SunOS
+4.1.1). The file was stored on a local and a remote filesystem.
+See torture.tcl for details.
+
+ local fs network fs
+
+create 1000 short entries 2.2 sec 50.0 sec
+read 1000 entries (first/next) 1.2 sec 1.5 sec
+read 1000 entries (list) 1.1 sec 1.3 sec
+delete 100 entries out of 1000 8.7 sec 23.2 sec
+lookup 1000 keys out of 900 0.63 sec 0.82 sec
+
+Summary: write access is expensive, especially on remote file
+systems.
+
+Copyright
+---------
+
+see the file COPYRIGHT
+
+History
+-------
+
+The first version was derived from tclgdbm1.0 by
+<tdoan@x400gate.bnr.ca> from the tcl distribution. The actual version
+is nearly totally rewritten and uses much more of the data structures
+provided by tcl.
+
+Future Plans
+------------
+
+The current version maps a key string to a data string. Future
+versions should map a key string to a list of datastrings i.e.:
+
+gdbm store <db> <key> <list of strings>
+gdbm fetch <db> <key> returns a list
+
+Credits
+-------
+
+Juergen Schoenwaelder <schoenw@ibr.cs.tu-bs.de> gave much hints that
+improved portability and elegance of the code.
+
+Bugs
+----
+
+- <key> strings are not allowed to be longer than 1023 Bytes.
+- No man page yet - any volunteers?
+- not extensively tested yet
+
+Report bugs, ports, improvements and successful compilation on
+platforms different from the ones mentioned above to the author.
+
+
+Author
+------
+
+Christian Lindig <lindig@ips.cs.tu-bs.de>
+TU Braunschweig
+Institut fuer Programmiersprachen
+Abteilung Softwaretechnologie
+D-38106 Braunschweig
+Germany
diff --git a/databases/tcl-gdbm/pkg/PLIST b/databases/tcl-gdbm/pkg/PLIST
new file mode 100644
index 00000000000..d5f78b8d3d1
--- /dev/null
+++ b/databases/tcl-gdbm/pkg/PLIST
@@ -0,0 +1,5 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 1999/07/07 15:14:25 bouyer Exp $
+lib/Tclgdbm/Tclgdbm0.6.so
+lib/Tclgdbm/pkgIndex.tcl
+man/mann/tclgdbm.n
+@dirrm lib/Tclgdbm