Merge pull request #612 from suvari/master

add mdbtools
This commit is contained in:
Ertuğrul Erata
2015-10-14 17:28:11 +03:00
17 changed files with 508 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/licenses/gpl.txt
from pisi.actionsapi import autotools
from pisi.actionsapi import pisitools
from pisi.actionsapi import shelltools
from pisi.actionsapi import get
WorkDir = "%s-%s" % (get.srcNAME(), get.srcVERSION().replace("_", ""))
def setup():
#shelltools.unlink("acinclude.m4")
autotools.autoreconf("-fi")
autotools.configure("--disable-gtk-doc \
--disable-static \
--disable-man \
--disable-gmdb2 \
--with-unixodbc=/usr")
pisitools.dosed("libtool", " -shared ", " -Wl,-O1,--as-needed -shared ")
def check():
autotools.make("check")
def build():
autotools.make("-j1")
def install():
autotools.rawInstall("DESTDIR=%s" % get.installDIR())
pisitools.dodoc("AUTHORS", "ChangeLog", "COPYING*", "NEWS", "README", "TODO")
+11
View File
@@ -0,0 +1,11 @@
[Desktop Entry]
Encoding=UTF-8
Name=MDB Database Explorer
Name[tr]=MDB Veritabanı Görüntüleyici
Comment=Explorer for your MDB database files
Comment[tr]=MDB veritabanı dosyalarınız için görüntüleyici
Icon=server-database.png
Exec=gmdb2
Terminal=false
Type=Application
Categories=Development;
@@ -0,0 +1,11 @@
--- src/odbc/Makefile.am.orig 2006-07-26 14:05:55.000000000 +0200
+++ src/odbc/Makefile.am 2006-07-26 14:06:02.000000000 +0200
@@ -15,7 +15,7 @@
$(patsubst %.c, %.lo, $(SQLSOURCES))) \
$(patsubst %, $(MDBDIR)/%, \
$(patsubst %.c, %.lo, $(MDBSOURCES)))
-LIBS = @LEXLIB@ $(GLIB_LIBS) $(ODBC_LIBS)
+LIBS = @LEXLIB@ $(GLIB_LIBS) $(ODBC_LIBS) -lm
unittest_LDADD = libmdbodbc.la ../libmdb/libmdb.la ../sql/libmdbsql.la
## Need blank statement to avoid compiling odbc.c
@@ -0,0 +1,13 @@
diff -ur mdbtools-0.6pre1-orig/include/mdbtools.h mdbtools-0.6pre1/include/mdbtools.h
--- mdbtools-0.6pre1-orig/include/mdbtools.h 2006-05-28 18:01:32.000000000 -0400
+++ mdbtools-0.6pre1/include/mdbtools.h 2006-05-28 18:04:33.000000000 -0400
@@ -147,7 +147,7 @@
#define IS_JET3(mdb) (mdb->f->jet_version==MDB_VER_JET3)
/* hash to store registered backends */
-extern GHashTable *mdb_backends;
+static GHashTable *mdb_backends;
/* forward declarations */
typedef struct mdbindex MdbIndex;
@@ -0,0 +1,10 @@
--- src/extras/mdbsupport.c.orig 2007-05-13 11:55:43.000000000 +0200
+++ src/extras/mdbsupport.c 2007-05-13 11:55:57.000000000 +0200
@@ -1,6 +1,7 @@
/* support routines for code generated by the util programs */
#include <stdio.h>
+#include <string.h>
void dump_int (int i)
{
@@ -0,0 +1,146 @@
--- mdbtools-cvs-20050624/src/odbc/odbc.c.orig 2010-05-24 10:20:59.000000000 -0400
+++ mdbtools-cvs-20050624/src/odbc/odbc.c 2010-05-25 17:28:05.000000000 -0400
@@ -210,7 +210,7 @@
SQLHSTMT hstmt,
SQLUSMALLINT ipar,
SQLSMALLINT FAR *pfSqlType,
- SQLUINTEGER FAR *pcbParamDef,
+ SQLULEN FAR *pcbParamDef,
SQLSMALLINT FAR *pibScale,
SQLSMALLINT FAR *pfNullable)
{
@@ -221,8 +221,8 @@
SQLRETURN SQL_API SQLExtendedFetch(
SQLHSTMT hstmt,
SQLUSMALLINT fFetchType,
- SQLINTEGER irow,
- SQLUINTEGER FAR *pcrow,
+ SQLLEN irow,
+ SQLULEN FAR *pcrow,
SQLUSMALLINT FAR *rgfRowStatus)
{
struct _hstmt *stmt = (struct _hstmt *) hstmt;
@@ -297,8 +297,8 @@
SQLRETURN SQL_API SQLParamOptions(
SQLHSTMT hstmt,
- SQLUINTEGER crow,
- SQLUINTEGER FAR *pirow)
+ SQLULEN crow,
+ SQLULEN FAR *pirow)
{
TRACE("SQLParamOptions");
return SQL_SUCCESS;
@@ -347,7 +347,7 @@
SQLRETURN SQL_API SQLSetPos(
SQLHSTMT hstmt,
- SQLUSMALLINT irow,
+ SQLSETPOSIROW irow,
SQLUSMALLINT fOption,
SQLUSMALLINT fLock)
{
@@ -398,11 +398,11 @@
SQLSMALLINT fParamType,
SQLSMALLINT fCType,
SQLSMALLINT fSqlType,
- SQLUINTEGER cbColDef,
+ SQLULEN cbColDef,
SQLSMALLINT ibScale,
SQLPOINTER rgbValue,
- SQLINTEGER cbValueMax,
- SQLINTEGER FAR *pcbValue)
+ SQLLEN cbValueMax,
+ SQLLEN FAR *pcbValue)
{
struct _hstmt *stmt;
@@ -502,8 +502,8 @@
SQLUSMALLINT icol,
SQLSMALLINT fCType,
SQLPOINTER rgbValue,
- SQLINTEGER cbValueMax,
- SQLINTEGER FAR *pcbValue)
+ SQLLEN cbValueMax,
+ SQLLEN FAR *pcbValue)
{
struct _hstmt *stmt = (struct _hstmt *) hstmt;
struct _sql_bind_info *cur, *newitem;
@@ -594,7 +594,7 @@
SQLSMALLINT cbColNameMax,
SQLSMALLINT FAR *pcbColName,
SQLSMALLINT FAR *pfSqlType,
- SQLUINTEGER FAR *pcbColDef, /* precision */
+ SQLULEN FAR *pcbColDef, /* precision */
SQLSMALLINT FAR *pibScale,
SQLSMALLINT FAR *pfNullable)
{
@@ -649,7 +649,7 @@
SQLPOINTER rgbDesc,
SQLSMALLINT cbDescMax,
SQLSMALLINT FAR *pcbDesc,
- SQLINTEGER FAR *pfDesc)
+ SQLLEN FAR *pfDesc)
{
int namelen, i;
struct _hstmt *stmt;
@@ -969,7 +969,7 @@
SQLRETURN SQL_API SQLRowCount(
SQLHSTMT hstmt,
- SQLINTEGER FAR *pcrow)
+ SQLLEN FAR *pcrow)
{
struct _hstmt *stmt=(struct _hstmt *)hstmt;
@@ -1002,10 +1002,10 @@
SQLUSMALLINT ipar,
SQLSMALLINT fCType,
SQLSMALLINT fSqlType,
- SQLUINTEGER cbParamDef,
+ SQLULEN cbParamDef,
SQLSMALLINT ibScale,
SQLPOINTER rgbValue,
- SQLINTEGER FAR *pcbValue)
+ SQLLEN FAR *pcbValue)
{
TRACE("SQLSetParam");
return SQL_SUCCESS;
@@ -1125,8 +1125,8 @@
SQLUSMALLINT icol,
SQLSMALLINT fCType,
SQLPOINTER rgbValue,
- SQLINTEGER cbValueMax,
- SQLINTEGER FAR *pcbValue)
+ SQLLEN cbValueMax,
+ SQLLEN FAR *pcbValue)
{
struct _hstmt *stmt;
struct _hdbc *dbc;
@@ -1457,7 +1457,7 @@
SQLRETURN SQL_API SQLPutData(
SQLHSTMT hstmt,
SQLPOINTER rgbValue,
- SQLINTEGER cbValue)
+ SQLLEN cbValue)
{
TRACE("SQLPutData");
return SQL_SUCCESS;
@@ -1466,7 +1466,7 @@
SQLRETURN SQL_API SQLSetConnectOption(
SQLHDBC hdbc,
SQLUSMALLINT fOption,
- SQLUINTEGER vParam)
+ SQLULEN vParam)
{
TRACE("SQLSetConnectOption");
return SQL_SUCCESS;
@@ -1475,7 +1475,7 @@
SQLRETURN SQL_API SQLSetStmtOption(
SQLHSTMT hstmt,
SQLUSMALLINT fOption,
- SQLUINTEGER vParam)
+ SQLULEN vParam)
{
TRACE("SQLSetStmtOption");
return SQL_SUCCESS;
@@ -0,0 +1,11 @@
Index: src/sql/Makefile.am
===================================================================
--- src/sql/Makefile.am.orig
+++ src/sql/Makefile.am
@@ -1,5 +1,6 @@
lib_LTLIBRARIES = libmdbsql.la
libmdbsql_la_SOURCES= mdbsql.c parser.y lexer.l
+libmdbsql_la_LIBADD = ../libmdb/libmdb.la
EXTRA_DIST = main.c
DISTCLEANFILES = parser.c parser.h lexer.c
AM_CPPFLAGS = -I$(top_srcdir)/include $(GLIB_CFLAGS)
@@ -0,0 +1,48 @@
Index: configure.in
===================================================================
--- configure.in.orig
+++ configure.in
@@ -106,6 +106,7 @@ PKG_CHECK_MODULES(GNOME,libglade-2.0 lib
if test "x$HAVE_GNOME" = "xtrue"; then
AC_SUBST(GNOME_CFLAGS)
AC_SUBST(GNOME_LIBS)
+ AC_SUBST(GNOME_PREFIX)
OPTDIRS="$OPTDIRS gmdb2"
fi
Index: src/gmdb2/Makefile.am
===================================================================
--- src/gmdb2/Makefile.am.orig
+++ src/gmdb2/Makefile.am
@@ -1,3 +1,4 @@
+prefix = @GNOME_PREFIX@
SUBDIRS = help gladefiles pixmaps
bin_PROGRAMS = gmdb2
include_HEADERS = gmdb.h
Index: src/gmdb2/gladefiles/Makefile.am
===================================================================
--- src/gmdb2/gladefiles/Makefile.am.orig
+++ src/gmdb2/gladefiles/Makefile.am
@@ -1,3 +1,4 @@
+prefix = @GNOME_PREFIX@
gladedir = $(datadir)/gmdb/glade/
glade_DATA = \
Index: src/gmdb2/help/C/Makefile.am
===================================================================
--- src/gmdb2/help/C/Makefile.am.orig
+++ src/gmdb2/help/C/Makefile.am
@@ -1,3 +1,4 @@
+prefix = @GNOME_PREFIX@
figs = \
figures/gmdb2_window.png \
figures/gmdb2_sql_window.png
Index: src/gmdb2/pixmaps/Makefile.am
===================================================================
--- src/gmdb2/pixmaps/Makefile.am.orig
+++ src/gmdb2/pixmaps/Makefile.am
@@ -1,3 +1,4 @@
+prefix = @GNOME_PREFIX@
appicondir = $(datadir)/gmdb/glade
@@ -0,0 +1,13 @@
Index: src/gmdb2/Makefile.am
===================================================================
--- src/gmdb2/Makefile.am.orig 2009-12-02 19:57:27.000000000 +0100
+++ src/gmdb2/Makefile.am 2009-12-02 19:57:27.000000000 +0100
@@ -1,7 +1,7 @@
prefix = @GNOME_PREFIX@
SUBDIRS = help gladefiles pixmaps
bin_PROGRAMS = gmdb2
-include_HEADERS = gmdb.h
+noinst_HEADERS = gmdb.h
gmdb2_SOURCES = main2.c file.c util.c table.c query.c module.c macro.c report.c form.c info.c table_def.c table_data.c table_export.c debug.c sql.c schema.c prefs.c
LIBS = -rdynamic $(GNOME_LIBS) @LIBS@ @LEXLIB@
AM_CPPFLAGS = -I$(top_srcdir)/include \
@@ -0,0 +1,19 @@
Index: src/libmdb/data.c
===================================================================
--- src/libmdb/data.c.orig
+++ src/libmdb/data.c
@@ -581,10 +581,13 @@ mdb_fetch_row(MdbTableDef *table)
do {
if (table->strategy==MDB_INDEX_SCAN) {
- if (!mdb_index_find_next(table->mdbidx, table->scan_idx, table->chain, &pg, (guint16 *) &(table->cur_row))) {
+ guint16 tmp = (guint16)table->cur_row;
+ if (!mdb_index_find_next(table->mdbidx, table->scan_idx, table->chain, &pg, &tmp)) {
+ table->cur_row = tmp;
mdb_index_scan_free(table);
return 0;
}
+ table->cur_row = tmp;
mdb_read_pg(mdb, pg);
} else {
rows = mdb_pg_get_int16(mdb,fmt->row_count_offset);
@@ -0,0 +1,10 @@
--- src/sql/lexer.l
+++ src/sql/lexer.l
@@ -21,6 +21,7 @@
#include "mdbsql.h"
#include "parser.h"
+extern int mdb_sql_yyinput(char *buf, int need);
%}
%%
@@ -0,0 +1,13 @@
basename is char[33]
--- src/gmdb2/file.c
+++ src/gmdb2/file.c
@@ -99,7 +99,7 @@
} else {
strncpy(basename,file_path,32);
}
- basename[33]='\0';
+ basename[32]='\0';
gnome_config_set_string("/gmdb/RecentFiles/menu_recent1.basename", basename);
gnome_config_set_string("/gmdb/RecentFiles/menu_recent1.filepath", file_path);
gnome_config_sync();
@@ -0,0 +1,9 @@
--- src/gmdb2/info.c
+++ src/gmdb2/info.c
@@ -71,4 +71,6 @@
gtk_label_set_text(GTK_LABEL(label), tmpstr);
g_free(filepath);
+
+ return NULL;
}
@@ -0,0 +1,11 @@
--- src/util/prindex.c
+++ src/util/prindex.c
@@ -115,7 +115,7 @@
void
walk_index(MdbHandle *mdb, MdbIndex *idx)
{
- int start, len;
+ int start = 0, len = 0; // I seriously doubt this function does anything useful.
guint32 pg;
guint16 row;
MdbHandle *mdbidx;
@@ -0,0 +1,11 @@
Index: mdbtools-0.6pre1/src/sql/Makefile.am
===================================================================
--- mdbtools-0.6pre1.orig/src/sql/Makefile.am 2005-01-15 06:02:06.000000000 +0100
+++ mdbtools-0.6pre1/src/sql/Makefile.am 2010-06-07 08:05:16.652462537 +0200
@@ -9,3 +9,6 @@ YACC = @YACC@ -d
dist-hook:
rm -f $(distdir)/parser.c $(distdir)/parser.h $(distdir)/lexer.c
+
+lexer.o: parser.h
+
+118
View File
@@ -0,0 +1,118 @@
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
<Source>
<Name>mdbtools</Name>
<Homepage>https://github.com/brianb/mdbtools</Homepage>
<Packager>
<Name>PisiLinux Community</Name>
<Email>admins@pisilinux.org</Email>
</Packager>
<License>GPLv2</License>
<License>LGPLv2</License>
<IsA>library</IsA>
<IsA>app:console</IsA>
<Summary>MDB Tools is a suite of programs for accessing data stored in Microsoft Access databases</Summary>
<Description>mdbtools contains set of libraries and utilities for reading Microsoft Access database (MDB) files.</Description>
<Archive sha1sum="33b746f29c1308909a1e82546ec24e8f835d461a" type="targz">https://github.com/brianb/mdbtools/archive/0.7.1.tar.gz</Archive>
<BuildDependencies>
<Dependency>unixODBC-devel</Dependency>
<!--<Dependency>libglade-devel</Dependency>
<Dependency>libgnomeui-devel</Dependency>-->
<Dependency>glib2-devel</Dependency>
<Dependency>readline-devel</Dependency>
</BuildDependencies>
</Source>
<Package>
<Name>mdbtools</Name>
<RuntimeDependencies>
<Dependency>unixODBC</Dependency>
<Dependency>glib2</Dependency>
<Dependency>readline</Dependency>
</RuntimeDependencies>
<Conflicts>
<Package releaseTo="4">mdbtools-gui</Package>
</Conflicts>
<Files>
<Path fileType="executable">/usr/bin</Path>
<Path fileType="library">/usr/lib</Path>
<Path fileType="man">/usr/share/man</Path>
<Path fileType="doc">/usr/share/doc</Path>
</Files>
</Package>
<Package>
<Name>mdbtools-devel</Name>
<Summary>Development files for mdbtools</Summary>
<RuntimeDependencies>
<Dependency release="current">mdbtools</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="header">/usr/include</Path>
<Path fileType="data">/usr/lib/pkgconfig</Path>
</Files>
</Package>
<!-- need scrollkeeper disabled build gui -->
<!--<Package>
<Name>mdbtools-gui</Name>
<Summary>MDB database explorer</Summary>
<Description>mdbtools-gui package contains the gmdb2 graphical user interface for MDB Tools</Description>
<RuntimeDependencies>
<Dependency release="current">mdbtools</Dependency>
<Dependency>libgnomeui</Dependency>
<Dependency>libglade</Dependency>
<Dependency>gtk2</Dependency>
<Dependency>pango</Dependency>
<Dependency>gdk-pixbuf</Dependency>
<Dependency>libgnome</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="executable">/bin/gmdb2</Path>
<Path fileType="data">/usr/share/gmdb</Path>
<Path fileType="data">/usr/share/applications/gmdb2.desktop</Path>
<Path fileType="data">/usr/share/gnome/help/gmdb</Path>
</Files>
<AdditionalFiles>
<AdditionalFile target="/usr/share/applications/gmdb2.desktop" permission="0644" owner="root">gmdb2.desktop</AdditionalFile>
</AdditionalFiles>
</Package>-->
<History>
<Update release="5">
<Date>2015-04-20</Date>
<Version>0.7.1</Version>
<Comment>Version bump, gui build disabled.</Comment>
<Name>Ertuğrul Erata</Name>
<Email>ertugrulerata@gmail.com</Email>
</Update>
<Update release="4">
<Date>2014-02-19</Date>
<Version>0.6_pre1</Version>
<Comment>Rebuild Unused</Comment>
<Name>Varol Maksutoğlu</Name>
<Email>waroi@pisilinux.org</Email>
</Update>
<Update release="3">
<Date>2013-07-28</Date>
<Version>0.6_pre1</Version>
<Comment>Dep Fixed</Comment>
<Name>PisiLinux Community</Name>
<Email>admins@pisilinux.org</Email>
</Update>
<Update release="2">
<Date>2013-05-02</Date>
<Version>0.6_pre1</Version>
<Comment>Fixed build dep</Comment>
<Name>Ayhan YALÇINSOY</Name>
<Email>ayhanyalcinsoy@pisilinux.org</Email>
</Update>
<Update release="1">
<Date>2010-10-13</Date>
<Version>0.6_pre1</Version>
<Comment>First release</Comment>
<Name>Pisi Linux Admins</Name>
<Email>admins@pisilinux.org</Email>
</Update>
</History>
</PISI>
+19
View File
@@ -0,0 +1,19 @@
<?xml version="1.0" ?>
<PISI>
<Source>
<Name>mdbtools</Name>
<Summary xml:lang="tr">Microsoft Access veritabanı dosyalarında tutulan verilere erişmek için kullanılan araç ve kitaplıklar</Summary>
<Description xml:lang="tr">mdbtools Microsoft Access veritabanı dosyalarını (MDB) okumak için gereken araçları ve kütüphaneleri içermektedir.</Description>
</Source>
<Package>
<Name>mdbtools-devel</Name>
<Summary xml:lang="tr">mdbtools için geliştirme dosyaları</Summary>
</Package>
<Package>
<Name>mdbtools-gui</Name>
<Summary xml:lang="tr">mdbtools veritabanı görüntüleyici</Summary>
<Description xml:lang="tr">mdbtools-gui paketi MDB Tools için gmdb2 isimli görsel arayüz içermektedir.</Description>
</Package>
</PISI>