summaryrefslogtreecommitdiffstats
path: root/security/opensc/Makefile
blob: 3d29ef21824d48d10bec6859fcddc9ef9a138c3a (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
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
# Created by: Bruce M Simpson
# $FreeBSD$

PORTNAME=	opensc
PORTVERSION=	0.13.0
CATEGORIES=	security devel
MASTER_SITES=	SF/${PORTNAME}/OpenSC/${DISTNAME}

MAINTAINER=	ale@FreeBSD.org
COMMENT=	Libraries and utilities to access smart cards

LICENSE=	LGPL21

BUILD_DEPENDS=	xsltproc:${PORTSDIR}/textproc/libxslt \
		${LOCALBASE}/share/xsl/docbook/html/docbook.xsl:${PORTSDIR}/textproc/docbook-xsl

OPTIONS_SINGLE=	BACKEND
OPTIONS_SINGLE_BACKEND=PCSC OPENCT CTAPI
OPTIONS_DEFINE=	SM DOCS
OPTIONS_DEFAULT=PCSC

PCSC_DESC=	Use PC/SC backend
OPENCT_DESC=	Use OpenCT backend
CTAPI_DESC=	Use CT-API backend
SM_DESC=	Enable secure messaging support

USE_OPENSSL=	yes
USE_GMAKE=	yes
GNU_CONFIGURE=	yes
USE_PKGCONFIG=	build
USE_LDCONFIG=	yes

CONFIGURE_ENV=	\
		OPENSSL_CFLAGS="-I${OPENSSLINC}" \
		OPENSSL_LIBS="-L${OPENSSLLIB} -lssl" \
		XSLTPROC="${LOCALBASE}/bin/xsltproc"

CONFIGURE_ARGS=	--with-xsl-stylesheetsdir=${LOCALBASE}/share/xsl/docbook

PORTDOCS=	*

MANCOMPRESSED=	no
MAN1=		cardos-tool.1 cryptoflex-tool.1 eidenv.1 iasecc-tool.1 \
		netkey-tool.1 openpgp-tool.1 \
		opensc-explorer.1 opensc-tool.1 piv-tool.1 \
		pkcs11-tool.1 pkcs15-crypt.1 pkcs15-init.1 pkcs15-tool.1 \
		sc-hsm-tool.1 westcos-tool.1
MAN5=		pkcs15-profile.5

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MOPENCT}
LIB_DEPENDS+=	openct:${PORTSDIR}/security/openct
CONFIGURE_ARGS+=--enable-openct
.endif

.if ${PORT_OPTIONS:MPCSC}
LIB_DEPENDS+=	pcsclite:${PORTSDIR}/devel/pcsc-lite
.else
CONFIGURE_ARGS+=--disable-pcsc
.endif

.if ${PORT_OPTIONS:MCTAPI}
CONFIGURE_ARGS+=--enable-ctapi
.endif

.if ${PORT_OPTIONS:MSM}
CONFIGURE_ARGS+=--enable-sm
PLIST_SUB+=	SM=""
.else
PLIST_SUB+=	SM="@comment "
.endif

.if ${PORT_OPTIONS:MDOCS}
CONFIGURE_ARGS+=--enable-doc
.endif

post-patch:
	@${REINPLACE_CMD} 's|(libdir)/pkgconfig|(prefix)/libdata/pkgconfig|' \
		${WRKSRC}/configure
.if ! ${PORT_OPTIONS:MDOCS}
	@${REINPLACE_CMD} 's|install-data-am: install-dist_docDATA|install-data-am:|' \
		${WRKSRC}/Makefile.in
	@${REINPLACE_CMD} 's|install-data-am: install-htmlDATA install-man|install-data-am: install-man|' \
		${WRKSRC}/doc/Makefile.in ${WRKSRC}/doc/tools/Makefile.in
.endif

post-install:
	@${CAT} ${PKGMESSAGE}

.include <bsd.port.mk>
OpenPOWER on IntegriCloud