aboutsummaryrefslogtreecommitdiffstats
path: root/main/botan/APKBUILD
blob: 3332e06e3e9072a77e4715156c8f1ccbf36a9336 (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
# Contributor: tcely <tcely@users.noreply.github.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=botan
pkgver=2.18.1
pkgrel=4
pkgdesc="Crypto and TLS for C++11"
url="https://botan.randombit.net/"
arch="all"
license="BSD-2-Clause"
depends_dev="boost-dev bzip2-dev openssl1.1-compat-dev sqlite-dev xz-dev zlib-dev"
makedepends="$depends_dev python3"
subpackages="$pkgname-dev $pkgname-doc $pkgname-libs"
source="https://botan.randombit.net/releases/Botan-$pkgver.tar.xz
	dl-exponents.patch
	CVE-2021-40529.patch"
builddir="$srcdir/Botan-$pkgver"

# secfixes:
#   2.18.1-r3:
#     - CVE-2021-40529
#   2.17.3-r0:
#     - CVE-2021-24115
#   2.9.0-r0:
#     - CVE-2018-20187
#   2.7.0-r0:
#     - CVE-2018-12435
#   2.6.0-r0:
#     - CVE-2018-9860
#   2.5.0-r0:
#     - CVE-2018-9127

case $CARCH in
	ppc64le|aarch64|armhf|armv7) options="$options !check" ;; # 3 tests timeout
esac

build() {
	# botan benefits from -O3. Upstream is using it when testing.
	CXXFLAGS="$CXXFLAGS -O3" \
	python3 ./configure.py \
		--prefix=/usr \
		--mandir=/usr/share/man \
		--with-boost \
		--with-bzip2 \
		--with-lzma \
		--with-openmp \
		--with-openssl \
		--with-sqlite3 \
		--with-zlib \
		--with-os-feature=getrandom \
		--disable-static

	make
}

check() {
	LD_LIBRARY_PATH="$builddir" ./botan-test
}

package() {
	make DESTDIR="$pkgdir" install
	rm -rf "$pkgdir"/usr/lib/python*
}

sha512sums="
2f11d1ab703d977a2d64504d2a2489ce56109a2a6c46c0dc7c8db428470ce511bcc0160f70baedad29237abd5e1622f2c155ea58c4dec4d3ae57ee7b350415c3  Botan-2.18.1.tar.xz
e0d5e2c07d1ea66def33cbf8d64ba87eeb46c10ff0c14a54bc518b87a668a74a184e18b89440a2ef4b78ddf97cb4e2b02f1a70b4bbf705170715e353b2abbddb  dl-exponents.patch
fd5d29ea98de0f0ddc63340270f118a2a633e740d604cf030780fdca46a87733654c38c01f933bb607f92cbb3750250a1af6ef9fe26fec601bbe8c9f079a6660  CVE-2021-40529.patch
"