aboutsummaryrefslogtreecommitdiffstats
path: root/security/botan2/Makefile
blob: 02e65ad5a31c23590ff549a69b26a11092dc832c (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
# $FreeBSD$

PORTNAME=   botan
DISTVERSION=    2.4.0
PORTREVISION=   1
CATEGORIES= security
MASTER_SITES=   http://botan.randombit.net/releases/
PKGNAMESUFFIX=  2
DISTNAME=   Botan-${PORTVERSION}

MAINTAINER= tremere@cainites.net
COMMENT=    Portable, easy to use and efficient C++ crypto library

LICENSE=    BSD2CLAUSE
LICENSE_FILE=   ${WRKSRC}/license.txt

LIB_DEPENDS=    libboost_filesystem.so:devel/boost-libs

OPTIONS_DEFINE=     SQLITE3 SSL DOCS
OPTIONS_DEFAULT=    SSL
OPTIONS_SUB=        yes

USES=       compiler:c++11-lang gmake python:build shebangfix tar:tgz
HAS_CONFIGURE=  yes
USE_LDCONFIG=   yes

CONFIGURE_SCRIPT=   configure.py
CONFIGURE_ARGS= --with-external-includedir=${PREFIX}/include \
        --with-external-libdir=${PREFIX}/lib \
        --with-boost --with-bzip2 --with-lzma --with-zlib
LDFLAGS+=   -pthread
SHEBANG_FILES=  configure.py src/scripts/install.py

DOCSDIR=    ${PREFIX}/share/doc/${PORTNAME}-${PORTVERSION}
PORTDOCS=   *

SQLITE3_USES=       sqlite
SQLITE3_CONFIGURE_WITH= sqlite3

SSL_USES=       ssl
SSL_CONFIGURE_WITH= openssl
SSL_VARS=       BROKEN_SSL= openssl-devel

.include <bsd.port.options.mk>

.if ${ARCH} == aarch64
CONFIGURE_ARGS+=    --cc-abi="-march=armv8-a+crypto"
.endif

.if ${ARCH} == i386 || ${ARCH} == amd64
PLIST_SUB+= HAS_RDRAND_RNG=""
.else
PLIST_SUB+= HAS_RDRAND_RNG="@comment "
.endif

post-patch:
    @${REINPLACE_CMD} -e 's|^optimization_flags .*|optimization_flags "${CXXFLAGS}"|' \
        ${WRKSRC}/src/build-data/cc/clang.txt

post-install:
.for i in bin/botan lib/libbotan-2.so.4.4.0
    ${STRIP_CMD} ${STAGEDIR}${PREFIX}/${i}
.endfor

.include <bsd.port.mk>