aboutsummaryrefslogtreecommitdiff
path: root/security/gnutls3/Makefile
blob: 0e4d6d7072599631ee6397244f3fec90d8a2553a (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Created by: William Grzybowski <wg@FreeBSD.org>
# $FreeBSD$

PORTNAME=	gnutls
PORTVERSION=	3.1.25
PORTREVISION=	2
CATEGORIES=	security net
MASTER_SITES=	ftp://ftp.gnutls.org/gcrypt/gnutls/v3.1/
PKGNAMESUFFIX=	${GNUTLS_SUFFIX}

MAINTAINER=	bdrewery@FreeBSD.org
COMMENT=	GNU Transport Layer Security library

LIB_DEPENDS=	libgpg-error.so:${PORTSDIR}/security/libgpg-error \
		libnettle.so:${PORTSDIR}/security/nettle \
		libp11-kit.so:${PORTSDIR}/security/p11-kit \
		libidn.so:${PORTSDIR}/dns/libidn \
		libtspi.so:${PORTSDIR}/security/trousers

GNUTLS_SUFFIX=	3

USES=		gmake iconv libtool:keepla pkgconfig tar:xz
USE_LDCONFIG=	${PREFIX}/lib/gnutls3
CPPFLAGS+=	-I${LOCALBASE}/include -fPIC
LDFLAGS=	-L${LOCALBASE}/lib
GNU_CONFIGURE=	yes
CONFIGURE_ENV=		MAKEINFO="/usr/bin/makeinfo --no-split"
CONFIGURE_ARGS=	--program-suffix=${GNUTLS_SUFFIX} \
			--includedir="${PREFIX}/include/gnutls${GNUTLS_SUFFIX}" \
			--libdir="${PREFIX}/lib/gnutls${GNUTLS_SUFFIX}" \
			--disable-guile \
			--disable-nls \
			--disable-silent-rules \
			--disable-hardware-acceleration \
			--enable-local-libopts

DOCSDIR=	${PREFIX}/share/doc/${PORTNAME}${GNUTLS_SUFFIX}
EXAMPLESDIR=	${PREFIX}/share/examples/${PORTNAME}${GNUTLS_SUFFIX}
INFO_SUBDIR=	gnutls${GNUTLS_SUFFIX}

OPTIONS_DEFINE=		CXX DOCS EXAMPLES LIBTASN1 LIBDANE
OPTIONS_DEFAULT=	CXX
OPTIONS_SUB=		yes

LIBTASN1_DESC=	Use libtasn1 from ports
LIBDANE_DESC=	DNSSEC support for DANE (danetool3 --check)
LIBDANE_LIB_DEPENDS=	libunbound.so:${PORTSDIR}/dns/unbound
LIBDANE_CONFIGURE_OFF=	--disable-libdane

CXX_CONFIGURE_ENABLE=	cxx

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MLIBTASN1} || exists(${LOCALBASE}/lib/libtasn1.so.7)
LIB_DEPENDS+=	libtasn1.so:${PORTSDIR}/security/libtasn1
.else
CONFIGURE_ARGS+=	--with-included-libtasn1
.endif

PORTDOCS=		AUTHORS NEWS README THANKS
EXAMPLES=	doc/examples/*.c

#INFO=	gnutls

post-patch:
	@${MV} ${WRKSRC}/libdane/gnutls-dane.pc.in \
		${WRKSRC}/libdane/gnutls${GNUTLS_SUFFIX}-dane.pc.in
	# Force regenerating as the dist has info-5, but sometimes when
	# regnerating it will decide to only create up to info-4, thus
	# causing plist discrepency. So just rebuild and use --no-split
	@${RM} ${WRKSRC}/doc/gnutls.info*

pre-configure:
	@${CP} ${WRKSRC}/lib/gnutls.pc.in ${WRKSRC}/lib/gnutls${GNUTLS_SUFFIX}.pc.in
	@${REINPLACE_CMD} \
		-e 's,(libdir)/pkgconfig,(prefix)/libdata/pkgconfig,' \
		-e 's,gnutls\.pc,gnutls${GNUTLS_SUFFIX}\.pc,g' \
		-e 's,gnutls-dane\.pc,gnutls${GNUTLS_SUFFIX}-dane\.pc,g' \
		${WRKSRC}/lib/Makefile.in \
		${WRKSRC}/libdane/Makefile.in \
		${WRKSRC}/configure
	@${REINPLACE_CMD} -e 's,(top_builddir)$$,(top_builddir) -I$$(top_builddir)/lib/includes -I$$(top_builddir)/libextra/includes,' \
		${WRKSRC}/doc/Makefile.in

post-install:
	@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
	cd ${WRKSRC} && ${INSTALL_DATA} ${EXAMPLES} ${STAGEDIR}${EXAMPLESDIR}
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
.for i in ${PORTDOCS}
	${INSTALL_DATA} ${WRKSRC}/${i} ${STAGEDIR}${DOCSDIR}
.endfor

.include <bsd.port.mk>