aboutsummaryrefslogtreecommitdiffstats
path: root/testing/libdwarf/APKBUILD
blob: d53591cc36612d0fe9951f4a26f8ef9b9e226040 (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
72
73
# Contributor: David Huffman <storedbox@outlook.com>
# Maintainer: David Huffman <storedbox@outlook.com>
pkgname=libdwarf
pkgver=20160507
pkgrel=0
pkgdesc="Parsing library for DWARF2 and later debugging file format"
url="http://www.prevanders.net/dwarf.html"
arch="all"
license="LGPL2+"
depends="libelf"
depends_dev="$pkgname libelf-dev"
makedepends="$depends_dev"
install=""
subpackages="$pkgname-dev dwarf-tools dwarf-tools-doc"
source="http://www.prevanders.net/$pkgname-$pkgver.tar.gz"

_builddir="$srcdir/dwarf-$pkgver"
prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	cd "$_builddir"
	./configure --prefix=/usr --enable-shared || return 1
	make && make -C dwarfgen || return 1
}

package() {
	local bindir="$pkgdir/usr/bin"
	local docdir="$pkgdir/usr/share/doc/dwarf-tools"
	local incdir="$pkgdir/usr/include/libdwarf"
	local libdir="$pkgdir/usr/lib"
	local man1dir="$pkgdir/usr/share/man/man1"
	mkdir -p "$bindir" "$docdir" "$incdir" "$libdir" "$man1dir"

	cd "$_builddir/libdwarf"
	cp dwarf.h libdwarf.h "$incdir"
	cp libdwarf.a libdwarf.so "$libdir"

	cd "$_builddir/dwarfdump"
	cp dwarfdump "$bindir"
	cp COPYING "$docdir/dwarfdump.COPYING"
	cp DWARFDUMPCOPYRIGHT GPL.txt "$docdir"
	cp dwarfdump.conf "$libdir"
	cp dwarfdump.1 "$man1dir"

	cd "$_builddir/dwarfgen"
	cp dwarfgen "$bindir"
	cp COPYING "$docdir/dwarfgen.COPYING"
	cp dwarfgen.1 "$man1dir"
}

tools() {
	license="GPL2 BSD"
	pkgdesc="Tools for interacting with DWARF2 and later debugging files"

	local bin="usr/bin"
	local lib="usr/lib"

	mkdir -p "$subpkgdir/$lib"
	mv "$pkgdir/$bin" "$subpkgdir/$bin"
	mv "$pkgdir/$lib/dwarfdump.conf" "$subpkgdir/$lib"
}

md5sums="ae32d6f9ece5daf05e2d4b14822ea811  libdwarf-20160507.tar.gz"
sha256sums="12ae39376e3915bf8fa92555989f3ad5f2f4f332b590a628541ce68987b337af  libdwarf-20160507.tar.gz"
sha512sums="8a4d3721390d4d79fbf8d01fb27995ac9871f1d3e19d85aa25c108ee4cc45968a5331e2b477f559168c4597513235fb508bfe4ee1664c6dfbede3a47d48490b5  libdwarf-20160507.tar.gz"