1SUMMARY="A cryptography library"
2DESCRIPTION="Botan is a cryptography library written in C++. \
3Its goal is to offer the tools necessary to implement a range of practical \
4systems, such as TLS/DTLS, PKIX certificate handling, PKCS#11 and TPM \
5hardware support, password hashing, and post quantum crypto schemes. \
6Botan also has a C89 API specifically designed to be easy to call from other \
7languages."
8HOMEPAGE="https://botan.randombit.net/"
9COPYRIGHT="1999-2024 The Botan Authors"
10LICENSE="BSD (2-clause)"
11REVISION="1"
12SOURCE_URI="https://botan.randombit.net/releases/Botan-$portVersion.tar.xz"
13CHECKSUM_SHA256="368f11f426f1205aedb9e9e32368a16535dc11bd60351066e6f6664ec36b85b9"
14SOURCE_DIR="Botan-$portVersion"
15PATCHES="botan-$portVersion.patchset"
16
17ARCHITECTURES="all !x86_gcc2"
18SECONDARY_ARCHITECTURES="x86"
19
20commandSuffix=$secondaryArchSuffix
21commandBinDir=$binDir
22if [ "$targetArchitecture" = x86_gcc2 ]; then
23	commandSuffix=
24	commandBinDir=$prefix/bin
25fi
26
27libVersion="$portVersion"
28libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
29
30PROVIDES="
31	botan3$secondaryArchSuffix = $portVersion
32	cmd:botan$commandSuffix = $portVersion
33	lib:libbotan_3$secondaryArchSuffix = $libVersionCompat
34	"
35REQUIRES="
36	haiku$secondaryArchSuffix
37	lib:libbz2$secondaryArchSuffix
38	lib:liblzma$secondaryArchSuffix
39	lib:libsqlite3$secondaryArchSuffix
40	lib:libz$secondaryArchSuffix
41	"
42
43PROVIDES_devel="
44	botan3${secondaryArchSuffix}_devel = $portVersion
45	devel:libbotan_3$secondaryArchSuffix = $libVersionCompat
46	"
47REQUIRES_devel="
48	botan3$secondaryArchSuffix == $portVersion base
49	"
50
51BUILD_REQUIRES="
52	haiku${secondaryArchSuffix}_devel
53	gcc${secondaryArchSuffix}_syslibs_devel
54	devel:libbz2$secondaryArchSuffix
55	devel:liblzma$secondaryArchSuffix
56	devel:libsqlite3$secondaryArchSuffix
57	devel:libz$secondaryArchSuffix
58	"
59BUILD_PREREQUIRES="
60	cmd:awk
61	cmd:cmake
62	cmd:gcc$secondaryArchSuffix
63	cmd:g++$secondaryArchSuffix
64	cmd:ld$secondaryArchSuffix
65	cmd:make
66	cmd:pkg_config$secondaryArchSuffix
67	cmd:python3
68	"
69
70BUILD()
71{
72	runConfigure --omit-buildspec --omit-dirs binDir ./configure.py \
73		--bindir="$commandBinDir" \
74		--enable-shared-library \
75		--disable-static \
76		--with-bzip2 --with-lzma --with-zlib \
77		--with-sqlite3 \
78		--no-install-python-module
79	make $jobArgs
80}
81
82INSTALL()
83{
84	make install
85
86	prepareInstalledDevelLib libbotan-3
87	fixPkgconfig
88
89	packageEntries devel \
90		"$developDir" \
91		"$documentationDir" \
92		"$libDir/cmake"
93
94	# install botan3.py to the wright place
95	local installDir="$prefix/lib/python3.10/vendor-packages"
96	mkdir -p $installDir
97	cp src/python/botan3.py $installDir
98}
99
100TEST()
101{
102	LIBRARY_PATH="$sourceDir${LIBRARY_PATH:+:$LIBRARY_PATH}" \
103	./botan-test
104}
105