1SUMMARY="A free C++ class library of cryptographic schemes"
2DESCRIPTION="Crypto++ is a C++ Class Library of Cryptographic Schemes \
3The library contains the following algorithms:
4* Authenticated encryption schemes: (GCM, CCM, EAX)
5* High speed stream ciphers: ChaCha (ChaCha8/12/20), Panama
6* AES and AES candidates: AES (Rijndael), RC6, MARS, Twofish, Serpent
7* Other block ciphers: IDEA, DES, Camellia, SEED, RC5, Blowfish,
8* Block cipher modes of operation: ECB, CBC, CBC (CTS), CFB, OFB
9* Message authentication codes: VMAC, HMAC, GMAC, CMAC, CBC-MAC, DMAC
10* Hash functions: BLAKE2 (BLAKE2b, BLAKE2s), SHA-1, SHA-2, SHA-3
11* Public-key cryptography: RSA, DSA, ElGamal, Nyberg-Rueppel (NR)
12* Padding schemes for public-key systems: PKCS#1 v2.0, OAEP, PSS,
13* Key agreement schemes: Diffie-Hellman (DH), Unified Diffie-Hellman (DH2),
14* Elliptic curve cryptography: ECDSA, ECNR, ECIES, ECDH, ECMQV
15* Insecure or obsolescent algorithms: MD2, MD4, MD5
16* And many more other algorithms."
17HOMEPAGE="https://cryptopp.com/"
18COPYRIGHT="2015-2019 Wei Dai"
19LICENSE="Boost v1.0"
20REVISION="1"
21SOURCE_URI="https://github.com/weidai11/cryptopp/archive/CRYPTOPP_${portVersion//./_}.tar.gz"
22CHECKSUM_SHA256="f8b8f632533b279ee297694e651e9204824bba6022ce66e60ebebb08b551fe7a"
23SOURCE_DIR="cryptopp-CRYPTOPP_${portVersion//./_}"
24PATCHES="crypto++-$portVersion.patchset"
25
26ARCHITECTURES="all !x86_gcc2"
27SECONDARY_ARCHITECTURES="x86"
28
29libVersion=$portVersion
30libVersionCompat="$libVersion compat >= ${libVersion%.*}"
31
32PROVIDES="
33	crypto++$secondaryArchSuffix = $portVersion
34	lib:libcryptopp$secondaryArchSuffix = $libVersionCompat
35	"
36REQUIRES="
37	haiku$secondaryArchSuffix
38	"
39
40PROVIDES_devel="
41	crypto++${secondaryArchSuffix}_devel = $portVersion
42	devel:libcryptopp$secondaryArchSuffix = $libVersionCompat
43	"
44REQUIRES_devel="
45	crypto++$secondaryArchSuffix == $portVersion base
46	"
47
48BUILD_REQUIRES="
49	haiku${secondaryArchSuffix}_devel
50	"
51BUILD_PREREQUIRES="
52	cmd:gcc$secondaryArchSuffix
53	cmd:ld
54	cmd:make
55	cmd:nasm
56	cmd:pkg_config$secondaryArchSuffix
57	"
58
59defineDebugInfoPackage crypto++$secondaryArchSuffix \
60	$libDir/libcryptopp.so.$libVersion
61
62BUILD()
63{
64	make $jobArgs dynamic cryptest.exe libcryptopp.pc
65}
66
67INSTALL()
68{
69	make \
70		LDCONF=true \
71		BINDIR=$binDir \
72		LIBDIR=$libDir \
73		DATADIR=$dataDir \
74		INCLUDEDIR=$includeDir \
75		install
76
77	rm -f $libDir/lib*.a
78
79	prepareInstalledDevelLib libcryptopp
80	fixPkgconfig
81
82	packageEntries devel $developDir
83
84	# remove binary and testdata, only needed for running TEST()
85	rm -rf "$binDir" "$dataDir/cryptopp"
86}
87
88TEST()
89{
90	make test
91}
92