summaryrefslogtreecommitdiff
path: root/security/bearssl/Makefile
blob: b5ff332d025d36bfc4ddf8f8fdc41d5a900c3811 (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
# $NetBSD: Makefile,v 1.9 2020/11/27 19:52:11 schmonz Exp $

DISTNAME=		bearssl-0.6
PKGREVISION=		1
CATEGORIES=		security
MASTER_SITES=		${HOMEPAGE}

MAINTAINER=		pkgsrc-users@NetBSD.org
HOMEPAGE=		https://bearssl.org/
COMMENT=		Implementation of the SSL/TLS protocol (RFC 5246)
LICENSE=		mit

INSTALLATION_DIRS=	bin include lib

LDFLAGS.SunOS+=		-lsocket -lnsl

OPSYSVARS+=		SOEXT
SOEXT.Darwin=		dylib
SOEXT.*=		so
PLIST_SUBST+=		SOEXT=${SOEXT}

pre-build:
	${MKDIR} ${WRKSRC}/build/obj

do-install:
	cd ${WRKSRC}/build && \
		${INSTALL_PROGRAM} brssl ${DESTDIR}${PREFIX}/bin
	cd ${WRKSRC}/inc && \
		${INSTALL_DATA} *.h ${DESTDIR}${PREFIX}/include
	cd ${WRKSRC}/build && \
		${INSTALL_DATA} libbearssl.a ${DESTDIR}${PREFIX}/lib && \
		${INSTALL_LIB} libbearssl.${SOEXT} ${DESTDIR}${PREFIX}/lib

do-test:
	cd ${WRKSRC} && \
		./build/testcrypto all && \
		./build/testspeed all && \
		./build/testx509

.include "../../mk/bsd.prefs.mk"

.if ${OPSYS} == "Darwin"

SUBST_CLASSES+=		dylib
SUBST_STAGE.dylib=	pre-configure
SUBST_FILES.dylib=	conf/Unix.mk
SUBST_SED.dylib=	-e 's|\.so|.dylib|g'

.PHONY: fix-darwin-install-name
post-install: fix-darwin-install-name
fix-darwin-install-name:
	for f in ${DESTDIR}${PREFIX}/lib/lib*.dylib; do \
	    install_name_tool -id `${ECHO} $$f | ${SED} -e 's,${DESTDIR},,g'` $$f; \
	done

.endif

.include "../../mk/bsd.pkg.mk"