aboutsummaryrefslogtreecommitdiffstats
path: root/main/db/APKBUILD
blob: 725aff033b7e7c0e1dc490addf70a9f1118c9615 (plain)
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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=db
pkgver=5.3.21
_ver=${pkgver}
pkgrel=0
pkgdesc="The Berkeley DB embedded database system"
url="http://www.oracle.com/technology/software/products/berkeley-db/index.html"
arch="all"
license="custom"
depends=
makedepends=
subpackages="$pkgname-dev $pkgname-doc $pkgname-utils $pkgname-c++:cxx"
# Patches were found here:
# http://www.oracle.com/technology/products/berkeley-db/db/update/4.7.25/patch.4.7.25.html
source="http://download.oracle.com/berkeley-db/db-$pkgver.tar.gz
	"

_builddir="$srcdir/db-$_ver"
prepare() {
	cd "$_builddir"
	update_config_sub || return 1
}

build () { 
	cd "$_builddir"
	for i in ../patch.*; do
		[ -r "$i" ] || continue
		msg "Applying $i..."
		patch -p0 < $i || return 1
	done

	cd build_unix
	../dist/configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--mandir=/usr/share/man \
		--enable-compat185 \
		--enable-shared \
		--enable-cxx \
		--disable-static \
		|| return 1
	make LIBSO_LIBS=-lpthread || return 1
}

package() {
	cd "$srcdir"/db-$_ver/build_unix
	make DESTDIR="$pkgdir" install || return 1
	rm "$pkgdir"/usr/lib/*.la || return 1

	mkdir -p "$pkgdir"/usr/share/doc
	mv "$pkgdir"/usr/docs "$pkgdir"/usr/share/doc/$pkgname

	install -D -m644 "$srcdir"/db-$_ver/LICENSE \
		"$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

utils() {
	pkgdesc="Utils for The Berkeley DB embedded database system"
	replaces="db"
	mkdir -p "$subpkgdir"/usr/
	mv "$pkgdir"/usr/bin "$subpkgdir"/usr/
}

cxx() {
	pkgdesc="C++ binding for libdb"
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/libdb_cxx*.so "$subpkgdir"/usr/lib/
}

md5sums="3fda0b004acdaa6fa350bfc41a3b95ca  db-5.3.21.tar.gz"