aboutsummaryrefslogtreecommitdiffstats
path: root/security/opensc/Makefile
blob: 8e935825b506a38823fb83acdbbd848b68189a09 (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
# 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

USES=       libtool:keepla pkgconfig gmake
USE_OPENSSL=    yes
GNU_CONFIGURE=  yes
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=   *

.include <bsd.port.options.mk>

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

.if ${PORT_OPTIONS:MPCSC}
LIB_DEPENDS+=   libpcsclite.so:${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

.include <bsd.port.mk>