aboutsummaryrefslogtreecommitdiffstats
path: root/community/libdwarf/APKBUILD
blob: ff298897e0cbd0955af824232996321589cb4b6a (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
# Contributor: David Huffman <storedbox@outlook.com>
# Maintainer:
pkgname=libdwarf
pkgver=20201020
pkgrel=1
pkgdesc="Parsing library for DWARF2 and later debugging file format"
url="https://www.prevanders.net/dwarf.html"
arch="all"
license="LGPL-2.1-or-later"
makedepends="elfutils-dev zlib-dev"
subpackages="$pkgname-static $pkgname-dev dwarf-tools dwarf-tools-doc"
source="http://www.prevanders.net/libdwarf-$pkgver.tar.gz"

build() {
	[ "$CARCH" != "s390x" ] && _enable_dwarfgen="--enable-dwarfgen"
	./configure --prefix=/usr --enable-shared $_enable_dwarfgen
	make
}

check() {
	make check
}

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"
	cd "$builddir/libdwarf/.libs"
	cp libdwarf.a libdwarf.so libdwarf.so.1 "$libdir"

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

	case "$CARCH" in
		s390x) ;;
		*)
		cd "$builddir/dwarfgen"
		cp .libs/dwarfgen "$bindir"
		cp COPYING "$docdir/dwarfgen.COPYING"
		cp dwarfgen.1 "$man1dir"
		;;
	esac
}

tools() {
	license="GPL-2.0-only AND BSD-3-Clause"
	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"
}

static() {
	depends=""
	pkgdesc="$pkgdesc (static library)"
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/*.a "$subpkgdir"/usr/lib
}

sha512sums="5c1078440c4afc255ce9597e1fca96615b9b41c88fe33c18a1fdc140ec1dee835bd926473535fcacb2f8d3c8fd63349c24e89e71a2d1a2319408a970f7bfa320  libdwarf-20201020.tar.gz"