aboutsummaryrefslogtreecommitdiffstats
path: root/testing/mdbtools/APKBUILD
blob: 8ac025b99e2c94a1f2016fc96f4d00fd769a2f8d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Contributor: Holger Jaekel <holger.jaekel@gmx.de>
# Maintainer: Holger Jaekel <holger.jaekel@gmx.de>
pkgname=mdbtools
pkgver=1.0.0
pkgrel=0
pkgdesc="library for reading MS Access database files"
url="https://github.com/mdbtools/mdbtools"
arch="all !s390x !mips64"  # no support for big-endian
license="GPL-2.0-or-later"
makedepends="
	autoconf
	automake
	bison
	flex
	gawk
	gettext-dev
	gnu-libiconv-dev
	libtool
	unixodbc-dev
	"
subpackages="
	$pkgname-dev
	$pkgname-doc
	$pkgname-bash-completion
	$pkgname-utils
	$pkgname-odbc
	"
_testdata=e649f792cb8f966d404e052d1523e93de0192d50
source="
	https://github.com/mdbtools/mdbtools/releases/download/v$pkgver/mdbtools-$pkgver.tar.gz
	mdbtestdata-$_testdata.tar.gz::https://github.com/mdbtools/mdbtestdata/archive/$_testdata.tar.gz
	10-Werror.patch
	"

prepare() {
	default_prepare

	mv "$srcdir"/mdbtestdata-$_testdata "$builddir"/test

	autoreconf -i -f
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--enable-static=no \
		--with-unixodbc=/usr/include \
		--with-libiconv-prefix=/usr/include
	make
}

check() {
	# taken from https://github.com/mdbtools/mdbtools/blob/master/test_script.sh
	./src/util/mdb-json test/data/ASampleDatabase.accdb "Asset Items"
    ./src/util/mdb-json test/data/nwind.mdb "Umsätze"
    ./src/util/mdb-count test/data/ASampleDatabase.accdb "Asset Items"
    ./src/util/mdb-count test/data/nwind.mdb "Umsätze"
    ./src/util/mdb-prop test/data/ASampleDatabase.accdb "Asset Items"
    ./src/util/mdb-prop test/data/nwind.mdb "Umsätze"
    ./src/util/mdb-schema test/data/ASampleDatabase.accdb
    ./src/util/mdb-schema test/data/nwind.mdb
    ./src/util/mdb-schema test/data/nwind.mdb -T "Umsätze" postgres
    ./src/util/mdb-tables test/data/ASampleDatabase.accdb
    ./src/util/mdb-tables test/data/nwind.mdb
    ./src/util/mdb-ver test/data/ASampleDatabase.accdb
    ./src/util/mdb-ver test/data/nwind.mdb
    ./src/util/mdb-queries test/data/ASampleDatabase.accdb qryCostsSummedByOwner
}

package() {
	make DESTDIR="$pkgdir" install
}

utils() {
	pkgdesc="library for reading MS Access database files (command line utilities)"
	amove /usr/bin
}

odbc() {
	pkgdesc="library for reading MS Access database files (ODBC driver for use with unixODBC)"
	amove /usr/lib/odbc/libmdbodbc*
}

sha512sums="
146606d1c26c939cef5d4e153f312c24858e0a2eeaad9260c3bdd5eea9f5b58f5fd06ccad72323aa18db5fe197b4c50167b3ca9e112f1a8200ea5b69e1b16ccd  mdbtools-1.0.0.tar.gz
e7bee8761ff20e231ccf50fe5b4eb917c774a8c60fab4769f39bac024c5a507537db407ac616930203222e5965e0a7556a87d39555e3c4e2a543f6a49e890aea  mdbtestdata-e649f792cb8f966d404e052d1523e93de0192d50.tar.gz
c3ab42c277546d74760be28592ec4a15194c0df837f3043b3d66918658c35100def729b50222e9f3f9f301a2c49a6aeb6b7b810afbacc9f636f12934aa1a3cb9  10-Werror.patch
"