summaryrefslogtreecommitdiff
path: root/databases/sqsh/Makefile.common
blob: 0dc949c9a9e279475f85206b7ae16048d0ef5ffb (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
# $NetBSD: Makefile.common,v 1.9 2005/06/16 06:57:44 jlam Exp $

DISTNAME=	sqsh-2.1-src
CATEGORIES=	databases
MASTER_SITES=	${HOMEPAGE}

MAINTAINER=	tsarna@NetBSD.org
HOMEPAGE=	http://www.sqsh.org/
COMMENT?=	SQL shell for Sybase and MS-SQL servers

BUILD_TARGET=		build

WRKSRC=			${WRKDIR}/${DISTNAME:C|-src||}
USE_PKGINSTALL=		yes
GNU_CONFIGURE=		yes
CONFIGURE_ARGS+=	--with-readline

CONF_FILES+=		${PREFIX}/share/examples/sqsh/sample.sqshrc ${PKG_SYSCONFDIR}/sqshrc

# support for the native Sybase Open Client
BUILD_DEFS+=		USE_SYBASE_OPENCLIENT
BUILD_DEFS+=		SYBASE
.if defined(USE_SYBASE_OPENCLIENT) && empty(USE_SYBASE_OPENCLIENT:M[Nn][Oo])
.  if defined(SYBASE) && exists(${SYBASE}/lib/libct.so)
BUILDLINK_PASSTHRU_DIRS=${SYBASE}
_SYBASE=		${SYBASE}
.  else
PKG_FAIL_REASON+=	"You must define SYBASE to the base directory of Open Client."
.  endif
.else
_SYBASE=		${BUILDLINK_PREFIX.freetds}/freetds
CONFIGURE_ENV+=		SYBASE_LIBS=-lct
MAKE_FLAGS+=		SYBASE_LIBS=-lct
.endif

LDFLAGS+=		${COMPILER_RPATH_FLAG}${_SYBASE}/lib
CONFIGURE_ENV+=		SYBASE="${_SYBASE}"
CONFIGURE_ENV+=		INCDIRS="${BUILDLINK_PREFIX.readline}/include"
CONFIGURE_ENV+=		LIBDIRS="${BUILDLINK_PREFIX.readline}/lib"

INSTALLATION_DIRS=	bin man/man1

do-install:
	${INSTALL_PROGRAM} ${WRKSRC}/src/sqsh ${PREFIX}/bin
	${INSTALL_MAN} ${WRKSRC}/doc/sqsh.1 ${PREFIX}/man/man1/sqsh.1
	${INSTALL_DATA_DIR} ${PREFIX}/share/examples/sqsh
	${INSTALL_DATA} ${WRKSRC}/doc/sample.sqshrc ${PREFIX}/share/examples/sqsh

.include "../../mk/bsd.prefs.mk"

.if !defined(USE_SYBASE_OPENCLIENT)
.  include "../../databases/freetds/buildlink3.mk"
.endif

.include "../../devel/readline/buildlink3.mk"
.include "../../mk/dlopen.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"