aboutsummaryrefslogtreecommitdiffstats
path: root/databases/freetds/Makefile
blob: 4655a92207e1d633ffc9a64ed9ebd9b451b2a5c0 (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
# Created by: Domas Mituzas <midom@dammit.lt>
# $FreeBSD$

PORTNAME=   freetds
PORTVERSION=    0.91.103
PORTEPOCH=  1
CATEGORIES= databases
MASTER_SITES=   ftp://ftp.freetds.org/pub/freetds/stable/

MAINTAINER= 5u623l20@gmail.com
COMMENT=    Sybase/Microsoft TDS protocol library

LICENSE=    GPLv2

LIB_DEPENDS=    libgcrypt.so:${PORTSDIR}/security/libgcrypt

TDS_VER?=   5.0

USES=       iconv gmake pkgconfig libtool:keepla
GNU_CONFIGURE=  yes
USE_AUTOTOOLS=  autoconf:env
CPPFLAGS+=  -I${LOCALBASE}/include
LDFLAGS+=   -L${LOCALBASE}/lib
LIBS+=      -lgcrypt
CONFIGURE_ARGS= --with-tdsver=${TDS_VER} --sysconfdir=${ETCDIR}
USE_LDCONFIG=   yes
INSTALL_TARGET= install-strip

PORTDOCS=   *

OPTIONS_DEFINE=     OPENSSL GNUTLS MSDBLIB DOCS
OPTIONS_RADIO=      ODBC
OPTIONS_RADIO_ODBC= IODBC UNIXODBC
MSDBLIB_DESC=       MS SQL Server support (breaks databases/sybtcl)
OPENSSL_USE=        OPENSSL=yes
OPENSSL_CONFIGURE_ON=   --with-openssl=${OPENSSLBASE}
GNUTLS_LIB_DEPENDS= libgnutls.so:${PORTSDIR}/security/gnutls
GNUTLS_CONFIGURE_ON=    --with-gnutls
IODBC_LIB_DEPENDS=  libiodbc.so:${PORTSDIR}/databases/libiodbc
IODBC_CONFIGURE_ON= --with-iodbc=${LOCALBASE}
IODBC_CPPFLAGS=     -I${LOCALBASE}/include/libiodbc
UNIXODBC_LIB_DEPENDS=   libodbc.so:${PORTSDIR}/databases/unixODBC
UNIXODBC_CONFIGURE_ON=  --with-unixodbc=${LOCALBASE}
# We cannot use msdblib-style by default, because port databases/sybtcl
# relies on sybase-style dblib
MSDBLIB_CONFIGURE_ON=   --enable-msdblib

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MIODBC} || ${PORT_OPTIONS:MUNIXODBC}
PLIST_SUB+= ODBC=""
.else
PLIST_SUB+= ODBC="@comment "
.endif

post-extract:
    @cd ${WRKSRC} && ${LN} -s freetds.conf freetds.conf.sample
    @cd ${WRKSRC} && ${LN} -s locales.conf locales.conf.sample
    @cd ${WRKSRC}/src/pool && ${LN} -s pool.conf pool.conf.sample

post-patch:
    @${FIND} ${WRKSRC} -name "Makefile.in" | ${XARGS} ${REINPLACE_CMD} -e \
        's|<malloc.h>|<stdlib.h>| ; \
         s|/freetds.conf|/freetds.conf.sample|g ; \
         s|/locales.conf|/locales.conf.sample|g ; \
         s|/pool.conf|/pool.conf.sample|g ; \
         s| common.h||g'
    @${REINPLACE_CMD} -e 's|$$ODBC_INC/isql.h|$$ODBC_INC/libiodbc/isql.h|g ; \
         s|$$ODBC_INC/isqlext.h|$$ODBC_INC/libiodbc/isqlext.h|g' ${WRKSRC}/configure

post-install:
    @${INSTALL_DATA} ${WRKSRC}/interfaces ${STAGEDIR}${ETCDIR}/interfaces.sample
.if ${PORT_OPTIONS:MDOCS}
    @${MKDIR} ${STAGEDIR}${DOCSDIR}
    @(cd ${WRKSRC}/doc/doc/${PORTNAME}-${PORTVERSION} && \
        ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR})
.endif

.include <bsd.port.mk>