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

PORTNAME=   freetds
PORTVERSION=    0.64
PORTREVISION=   9
PORTEPOCH=  1
CATEGORIES= databases
MASTER_SITES=   ${MASTER_SITE_SUNSITE}
MASTER_SITE_SUBDIR= ALPHA/${PORTNAME}/stable

MAINTAINER?=    cowbert@gmail.com
COMMENT=    Sybase/Microsoft TDS protocol library

TDS_VER?=   5.0

USES=       iconv
USE_GMAKE=  yes
GNU_GONFIGURE=  yes
USE_AUTOTOOLS=  autoconf:env libtool
CPPFLAGS+=  -I${LOCALBASE}/include
LDFLAGS+=   -L${LOCALBASE}/lib
CONFIGURE_ARGS= --with-tdsver=${TDS_VER}
USE_LDCONFIG=   yes

PORTDOCS=   *

OPTIONS_DEFINE= OPENSSL GNUTLS MSDBLIB DOCS
OPTIONS_RADIO=  ODBC
OPTIONS_RADIO_ODBC= IODBC UNIXODBC
MSDBLIB_DESC=   MS SQL Server support (breaks databases/sybtcl)

NO_STAGE=   yes
.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MOPENSSL}
USE_OPENSSL=    yes
CONFIGURE_ARGS+=--with-openssl=${OPENSSLBASE}
.endif

.if ${PORT_OPTIONS:MGNUTLS}
LIB_DEPENDS+=   libgnutls.so:${PORTSDIR}/security/gnutls
CONFIGURE_ARGS+=--with-gnutls
.endif

.if ${PORT_OPTIONS:MIODBC}
LIB_DEPENDS+=   libiodbc.so:${PORTSDIR}/databases/libiodbc
CONFIGURE_ARGS+=    --with-iodbc=${LOCALBASE}
.endif

.if ${PORT_OPTIONS:MUNIXODBC}
LIB_DEPENDS+=   libodbc.so:${PORTSDIR}/databases/unixODBC
CONFIGURE_ARGS+=    --with-unixodbc=${LOCALBASE}
.endif

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

# We cannot use msdblib-style by default, because port databases/sybtcl
# relies on sybase-style dblib
.if ${PORT_OPTIONS:MMSDBLIB}
CONFIGURE_ARGS+=    --enable-msdblib
.endif

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

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

post-install:
    @cd ${WRKSRC}/doc && ${COPYTREE_SHARE} images ${STAGEDIR}${DOCSDIR}
    @cd ${WRKSRC}/doc && ${COPYTREE_SHARE} doc ${STAGEDIR}${DOCSDIR}
    @${MKDIR} ${STAGEDIR}${PREFIX}/etc/freetds
    @${INSTALL_DATA} ${WRKSRC}/interfaces ${STAGEDIR}${PREFIX}/etc/freetds/interfaces.dist
    @${ECHO_CMD} "Sample configuration files have been installed in ${PREFIX}/etc"
    @${ECHO_CMD} "You should edit them and remove the .dist-suffix from their names"

.include <bsd.port.mk>