aboutsummaryrefslogtreecommitdiff
path: root/databases/pxlib
diff options
context:
space:
mode:
authorSergey Matveychuk <sem@FreeBSD.org>2005-12-11 10:33:44 +0000
committerSergey Matveychuk <sem@FreeBSD.org>2005-12-11 10:33:44 +0000
commit29a419d4a6376367f52d41b3373a7f5febf9ebf0 (patch)
tree4d68e2f22b7630d94c01c06f31d53b7b09f2e1e1 /databases/pxlib
parent37079e6393e885a1bbfb5741f81ba307c887539f (diff)
downloadports-29a419d4a6376367f52d41b3373a7f5febf9ebf0.tar.gz
ports-29a419d4a6376367f52d41b3373a7f5febf9ebf0.zip
pxlib is shared C library to read various Paradox files.
Notes
Notes: svn path=/head/; revision=150863
Diffstat (limited to 'databases/pxlib')
-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
6 files changed, 177 insertions, 0 deletions
diff --git a/databases/pxlib/Makefile b/databases/pxlib/Makefile
new file mode 100644
index 000000000000..647ef33eaac8
--- /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 000000000000..f01deccc382d
--- /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 000000000000..eb7bedabe07b
--- /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 000000000000..420df4a2f7ec
--- /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 000000000000..93d1806948b2
--- /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 000000000000..17ba732385ed
--- /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