summaryrefslogtreecommitdiff
path: root/databases/freetds/Makefile
blob: e8ac1cdc423a4a7ddc47a326b9fc5aa753be93e6 (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
# $NetBSD: Makefile,v 1.39 2009/06/14 22:57:58 joerg Exp $

DISTNAME=	freetds-0.82
PKGREVISION=	2
CATEGORIES=	databases
MASTER_SITES=	ftp://ftp.ibiblio.org/pub/Linux/ALPHA/freetds/stable/ \
		ftp://ftp.ibiblio.org/pub/Linux/ALPHA/freetds/old/ \
		ftp://ftp.ibiblio.org/pub/Linux/ALPHA/freetds/current/

MAINTAINER=	tsarna@NetBSD.org
HOMEPAGE=	http://www.freetds.org/
COMMENT=	Implementation of TDS protocol used by Sybase and MS-SQL servers

PKG_DESTDIR_SUPPORT=	user-destdir

.include "options.mk"

USE_LIBTOOL=		yes
USE_GNU_READLINE=	yes	# rl_on_new_line, rl_reset_line_state
GNU_CONFIGURE=		yes
CONFIGURE_ARGS+=	--sysconfdir=${PKG_SYSCONFDIR:Q}
CONFIGURE_ARGS+=	--datadir=${PREFIX}/share
CONFIGURE_ARGS+=	--with-libiconv-prefix=${BUILDLINK_PREFIX.iconv:Q}
CONFIGURE_ARGS+=	--with-tdsver=7.0

# no thread-safe resolver functions on NetBSD
CONFIGURE_ARGS+=	--disable-threadsafe

DOCDIR=		${PREFIX}/share/doc/freetds
EGDIR=		${PREFIX}/share/examples/freetds
CONF_FILES+=	${EGDIR}/freetds.conf ${PKG_SYSCONFDIR}/freetds.conf
CONF_FILES+=	${EGDIR}/locales.conf ${PKG_SYSCONFDIR}/locales.conf
CONF_FILES+=	${EGDIR}/pool.conf ${PKG_SYSCONFDIR}/pool.conf

# doc/Makefile ignores TARGET_DOCDIR for the files listed in
# nobase_data_DATA.  Make the Makefiles think the documentation is
# in doc/freetds through symlinks and by overriding DOCDIR.
#
MAKE_FLAGS+=		DOCDIR=doc/freetds
INSTALL_MAKE_FLAGS+=	${MAKE_FLAGS} ETC=${DESTDIR}${EGDIR:Q}

pre-build:
	cd ${WRKSRC}/doc/doc && ln -s ${DISTNAME:Q} freetds

# The FreeTDS documentation is generated by doxygen and the file names
# change from release to release.  Rather than having the PLIST change
# radically between releases, just generate the documentation entries
# dynamically for the PLIST.
#
GENERATE_PLIST+=	\
	${ECHO} "@comment The following lines are automatically generated." && \
	( cd ${WRKSRC}/doc/doc/${DISTNAME} &&				\
	  ${FIND} reference userguide \! -type d -print &&		\
	  cd ${WRKSRC}/doc && ${FIND} images -name "*.gif" -print ) |	\
	${SED} -e "s,^,"${DOCDIR:S|${PREFIX}/||:Q}"/," | ${SORT} &&	\
	( cd ${WRKSRC}/doc/doc/${DISTNAME} &&				\
	  ${FIND} reference userguide -type d -print &&			\
	  cd ${WRKSRC}/doc && ${FIND} images -type d -print ) |		\

.include "../../converters/libiconv/buildlink3.mk"
.include "../../devel/readline/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"