summaryrefslogtreecommitdiff
path: root/databases/sqsh/Makefile
blob: 83bab46afaad5fbd15308f4565005dfe25291ad6 (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
# $NetBSD: Makefile,v 1.21 2004/03/29 02:44:30 grant Exp $

DISTNAME=	sqsh-1.7-src
PKGNAME=	sqsh-1.7
PKGREVISION=	3
CATEGORIES=	databases
MASTER_SITES=	${HOMEPAGE}

MAINTAINER=	tsarna@NetBSD.org
HOMEPAGE=	http://www.sqsh.org/
COMMENT=	Sybase SQL shell

ALL_TARGET=		sqsh
INSTALL_TARGET=		install install.man

WRKSRC=			${WRKDIR}/${PKGNAME_NOREV}
USE_BUILDLINK2=		yes
GNU_CONFIGURE=		yes
CONFIGURE_ARGS+=	--with-readline

# 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
MAKE_FLAGS+=		SYBASE_LIBS=-lct
.endif

LDFLAGS+=		-Wl,${RPATH_FLAG}${_SYBASE}/lib

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

do-install:
	${INSTALL_PROGRAM} ${WRKSRC}/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 ${OPSYS} == "Darwin"
.  include "../../devel/dlcompat/buildlink2.mk"
.endif

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

.include "../../devel/readline/buildlink2.mk"
.include "../../mk/bsd.pkg.mk"