summaryrefslogtreecommitdiff
path: root/databases/pgbash/Makefile
blob: 13dad1f835fde11ff2da7539bf555666c6af912a (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
# New ports collection makefile for: pgbash
# Date created:		6 July 2003
# Whom:			Sascha Holzleiter <sascha@root-login.org>
#
# $FreeBSD$
#

PORTNAME=	pgbash
PORTVERSION=	7.3
PORTREVISION=	2
CATEGORIES=	databases
MASTER_SITES=	http://www.psn.co.jp/PostgreSQL/pgbash/:pgsource \
		${MASTER_SITE_GNU:S/$/:bashsrc/}
MASTER_SITE_SUBDIR=	bash/:bashsrc
DISTFILES=	pgbash-7.3.tar.gz:pgsource \
	        bash-2.05a.tar.gz:bashsrc
EXTRACT_ONLY=	pgbash-7.3.tar.gz

MAINTAINER=	sascha@root-login.org
COMMENT=	SQL Bash Shell for PostgreSQL

USE_PGSQL=	yes

WRKSRC=		${WRKDIR}/pgbash-7.3/src/bash-2.05a

GNU_CONFIGURE=	yes
USE_GMAKE=	yes
USE_REINPLACE=	yes

CONFIGURE_ARGS=	--pginc-prefix=${LOCALBASE}/include --pglib-prefix=${LOCALBASE}/lib

post-extract:
	@${ECHO_MSG} ">>> extracting bash"
	@${TAR} -C ${WRKDIR}/pgbash-7.3/src -xzf ${DISTDIR}/bash-2.05a.tar.gz

pre-configure:
	@${REINPLACE_CMD} -e 's|/etc/pgbashrc|${PREFIX}/etc/pgbashrc|g' \
	${WRKDIR}/pgbash-7.3/src/bash-2.05a-patch/shell.c.patch
.for i in Makefile.in.patch builtins-Makefile.in.patch \
	builtins-declare.def.patch builtins-mkbuilrins.c.patch \
	builtins-set.def.patch builtins-setattr.def.patch configure.in.patch \
	configure.patch parse.y.patch shell.c.patch variables.c.patch
	@${ECHO_MSG} ">>> applying pg patches"
	@${PATCH} -d ${WRKSRC} -p1 < ${WRKDIR}/pgbash-7.3/src/bash-2.05a-patch/${i}
.endfor

do-install:
	${INSTALL_PROGRAM} ${WRKSRC}/pgbash ${PREFIX}/bin
	${INSTALL_DATA} ${WRKDIR}/pgbash-7.3/rc/pgbashrc ${PREFIX}/etc/pgbashrc-dist

.include <bsd.port.mk>