summaryrefslogtreecommitdiffstats
path: root/databases
diff options
context:
space:
mode:
authorsem <sem@FreeBSD.org>2005-12-11 10:33:44 +0000
committersem <sem@FreeBSD.org>2005-12-11 10:33:44 +0000
commit312317035fcb0dffc76e9888d3fca39831d73495 (patch)
tree4222ba98c287615d8e4503e639844d0425149a65 /databases
parent6136e22ff31ea7f3a74fba4fb65dd93b70e0af8f (diff)
downloadFreeBSD-ports-312317035fcb0dffc76e9888d3fca39831d73495.zip
FreeBSD-ports-312317035fcb0dffc76e9888d3fca39831d73495.tar.gz
pxlib is shared C library to read various Paradox files.
WWW: http://pxlib.sourceforge.net
Diffstat (limited to 'databases')
-rw-r--r--databases/Makefile1
-rw-r--r--databases/pxlib/Makefile61
-rw-r--r--databases/pxlib/distinfo3
-rw-r--r--databases/pxlib/files/patch-Makefile.in11
-rw-r--r--databases/pxlib/files/patch-src-px_io.c85
-rw-r--r--databases/pxlib/pkg-descr7
-rw-r--r--databases/pxlib/pkg-plist10
7 files changed, 178 insertions, 0 deletions
diff --git a/databases/Makefile b/databases/Makefile
index 96cc45f..64c9410 100644
--- a/databases/Makefile
+++ b/databases/Makefile
@@ -319,6 +319,7 @@
SUBDIR += postgresql81-server
SUBDIR += postgresql_autodoc
SUBDIR += puredb
+ SUBDIR += pxlib
SUBDIR += pxtools
SUBDIR += py-MySQL
SUBDIR += py-MySQLdb
diff --git a/databases/pxlib/Makefile b/databases/pxlib/Makefile
new file mode 100644
index 0000000..647ef33
--- /dev/null
+++ b/databases/pxlib/Makefile
@@ -0,0 +1,61 @@
+# New ports collection makefile for: pxlib
+# Date created: 10 December 2005
+# Whom: Sergey Matveychuk <sem@FreeBSD.org>
+#
+# $FreeBSD$
+#
+
+PORTNAME= pxlib
+PORTVERSION= 0.5.1
+CATEGORIES= databases
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
+MASTER_SITE_SUBDIR= ${PORTNAME}
+
+MAINTAINER= sem@FreeBSD.org
+COMMENT= C library to read various Paradox files
+
+BUILD_DEPENDS= ${SITE_PERL}/${PERL_ARCH}/XML/Parser.pm:${PORTSDIR}/textproc/p5-XML-Parser
+
+USE_GMAKE= yes
+USE_AUTOTOOLS= libtool:15
+INSTALLS_SHLIB= yes
+USE_ICONV= yes
+USE_GETTEXT= yes
+USE_REINPLACE= yes
+GNU_CONFIGURE= yes
+CONFIGURE_ENV= CPPFLAGS=-I${LOCALBASE}/include LDFLAGS=-L${LOCALBASE}/lib
+CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
+
+OPTIONS= DOCS "Build and install documentation" off
+
+.include <bsd.port.pre.mk>
+
+.if defined(WITH_DOCS)
+BUILD_DEPENDS= docbook-to-man:${PORTSDIR}/textproc/docbook-to-man \
+ docbook2man:${PORTSDIR}/textproc/docbook-utils
+
+MAN3= PX_add_primary_index.3 PX_close.3 PX_close_blob.3 \
+ PX_create_blob_file.3 PX_create_file.3 PX_create_fp.3 \
+ PX_delete.3 PX_get_data_alpha.3 PX_get_data_bcd.3 \
+ PX_get_data_blob.3 PX_get_data_byte.3 PX_get_data_bytes.3 \
+ PX_get_data_double.3 PX_get_data_graphic.3 PX_get_data_long.3 \
+ PX_get_data_short.3 PX_get_field.3 PX_get_fields.3 \
+ PX_get_majorversion.3 PX_get_minorversion.3 PX_get_num_fields.3 \
+ PX_get_num_records.3 PX_get_opaque.3 PX_get_parameter.3 \
+ PX_get_record.3 PX_get_record2.3 PX_get_recordsize.3 \
+ PX_get_subminorversion.3 PX_get_value.3 PX_new.3 \
+ PX_new2.3 PX_new3.3 PX_new_blob.3 PX_open_blob_file.3 \
+ PX_open_blob_fp.3 PX_open_file.3 PX_open_fp.3 PX_open_gsf.3 \
+ PX_put_data_alpha.3 PX_put_data_bcd.3 PX_put_data_byte.3 \
+ PX_put_data_bytes.3 PX_put_data_double.3 PX_put_data_long.3 \
+ PX_put_data_short.3 PX_put_record.3 PX_put_recordn.3 \
+ PX_read_blobdata.3 PX_read_primary_index.3 PX_set_blob_file.3 \
+ PX_set_inputencoding.3 PX_set_parameter.3 PX_set_tablename.3 \
+ PX_set_targetencoding.3 PX_set_value.3 PX_strdup.3 \
+ PX_timestamp2string.3 PX_write_primary_index.3 pxlib.3
+.else
+pre-build:
+ ${REINPLACE_CMD} -e 's/^DOCDIR =.*/DOCDIR =/' ${WRKSRC}/Makefile
+.endif
+
+.include <bsd.port.post.mk>
diff --git a/databases/pxlib/distinfo b/databases/pxlib/distinfo
new file mode 100644
index 0000000..f01decc
--- /dev/null
+++ b/databases/pxlib/distinfo
@@ -0,0 +1,3 @@
+MD5 (pxlib-0.5.1.tar.gz) = 38f049b2ffe9370f98e1cf755d18a3fb
+SHA256 (pxlib-0.5.1.tar.gz) = 21b6c7355fb4ba82a4f002b0f931d8798268932c44797216e5ec6dedbbf6f540
+SIZE (pxlib-0.5.1.tar.gz) = 463159
diff --git a/databases/pxlib/files/patch-Makefile.in b/databases/pxlib/files/patch-Makefile.in
new file mode 100644
index 0000000..eb7beda
--- /dev/null
+++ b/databases/pxlib/files/patch-Makefile.in
@@ -0,0 +1,11 @@
+--- Makefile.in.orig Sat Dec 10 22:27:50 2005
++++ Makefile.in Sat Dec 10 22:29:15 2005
+@@ -250,7 +250,7 @@
+ EXTRA_DIST = intltool-extract.in intltool-merge.in intltool-update.in $(spec) $(spec).in autogen.sh pxlib.pc.in
+
+ #all-local: $(spec)
+-pkgconfigdir = $(libdir)/pkgconfig
++pkgconfigdir = @prefix@/libdata/pkgconfig
+ pkgconfig_DATA = pxlib.pc
+ all: config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
diff --git a/databases/pxlib/files/patch-src-px_io.c b/databases/pxlib/files/patch-src-px_io.c
new file mode 100644
index 0000000..420df4a
--- /dev/null
+++ b/databases/pxlib/files/patch-src-px_io.c
@@ -0,0 +1,85 @@
+--- src/px_io.c.orig Sun Dec 11 13:12:58 2005
++++ src/px_io.c Sun Dec 11 13:13:26 2005
+@@ -346,82 +346,6 @@
+ */
+ size_t px_mb_write(pxblob_t *p, pxstream_t *dummy, size_t len, void *buffer) {
+ return(p->mb_stream->write(p->pxdoc, p->mb_stream, len, buffer));
+- pxdoc_t *pxdoc;
+- pxhead_t *pxh;
+- pxstream_t *pxs;
+- long pos;
+- int ret;
+- unsigned char *tmpbuf = NULL;
+- unsigned int blockslen, blockoffset;
+-
+- pxdoc = p->pxdoc;
+- pxh = pxdoc->px_head;
+- pxs = p->mb_stream;
+-
+- if (pxh->px_encryption == 0)
+- return pxs->write(pxdoc, pxs, len, buffer);
+-
+- pos = pxs->tell(pxdoc, pxs);
+- if (pos < 0) {
+- return pos;
+- }
+-
+- blockoffset = (pos >> BLOCKSIZEEXP) << BLOCKSIZEEXP;
+- /* We need to read at least chunk from the blockoffset till the
+- * desired postion and the data itself which has len bytes.
+- * e.g. if we want to read 20 bytes starting at position 300 in the
+- * file, we will need to read 44+20 bytes starting at position 256.
+- */
+- blockslen = len + pos - blockoffset;
+- /* Check if the end of the data is within a 2^BLOCKSIZEEXP bytes block.
+- * If that is the case, we will need to read the remainder of the
+- * 2^BLOCKSIZEEXP bytes block as well. In the above example, we
+- * will have to read 256 bytes instead of just 64.
+- */
+- if(blockslen & 0xff)
+- blockslen = ((blockslen >> BLOCKSIZEEXP) + 1) << BLOCKSIZEEXP;
+-
+- assert(blockslen >= len);
+- assert(blockoffset <= (unsigned long)pos);
+- assert((blockoffset+blockslen) >= (pos+len));
+-
+- ret = pxs->seek(pxdoc, pxs, blockoffset, SEEK_SET);
+- if (ret < 0) {
+- return ret;
+- }
+-
+- tmpbuf = (unsigned char *) malloc(blockslen);
+- if (tmpbuf == NULL) {
+- return -ENOMEM;
+- }
+-
+- ret = pxs->read(pxdoc, pxs, blockslen, tmpbuf);
+- if (ret < 0) {
+- goto end;
+- }
+-
+- px_decrypt_mb_block(tmpbuf, tmpbuf, pxh->px_encryption, blockslen);
+- memcpy(tmpbuf + (pos - blockoffset), buffer, len);
+- px_encrypt_mb_block(tmpbuf, tmpbuf, pxh->px_encryption, blockslen);
+-
+- ret = pxs->seek(pxdoc, pxs, blockoffset, SEEK_SET);
+- if (ret < 0) {
+- return ret;
+- }
+- ret = pxs->write(pxdoc, pxs, blockslen, tmpbuf);
+- if (ret < 0) {
+- goto end;
+- }
+-
+- ret = pxs->seek(pxdoc, pxs, pos + len, SEEK_SET);
+- if (ret < 0) {
+- goto end;
+- }
+-
+- ret = len;
+-end:
+- free(tmpbuf);
+- return ret;
+ }
+ /* }}} */
+
diff --git a/databases/pxlib/pkg-descr b/databases/pxlib/pkg-descr
new file mode 100644
index 0000000..93d1806
--- /dev/null
+++ b/databases/pxlib/pkg-descr
@@ -0,0 +1,7 @@
+pxlib is shared C library to read various Paradox files. Currently .DB
+files are best supported. pxlib provides a very simple api to read the
+header and the data records of Paradox files. I also provides functions
+to convert the data into the hosts data format (little or big endian).
+
+WWW: http://pxlib.sourceforge.net
+Author: Uwe Steinmann <uwe@steinmann.cx>
diff --git a/databases/pxlib/pkg-plist b/databases/pxlib/pkg-plist
new file mode 100644
index 0000000..17ba732
--- /dev/null
+++ b/databases/pxlib/pkg-plist
@@ -0,0 +1,10 @@
+include/paradox-gsf.h
+include/paradox-mp.h
+include/paradox.h
+include/pxversion.h
+lib/libpx.a
+lib/libpx.so
+lib/libpx.so.5
+libdata/pkgconfig/pxlib.pc
+share/locale/de/LC_MESSAGES/pxlib.mo
+share/locale/es/LC_MESSAGES/pxlib.mo
OpenPOWER on IntegriCloud