summaryrefslogtreecommitdiff
path: root/databases/yasql/Makefile
blob: a4759d92f1242b81403de1892ae27e68d6ba148d (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
# New ports collection makefile for:	yasql
# Date created:				22 February 2005
# Whom:	      				Thierry Thomas <thierry@pompo.net>
#
# $FreeBSD$
#

PORTNAME=		yasql
PORTVERSION=		1.83
PORTREVISION=		1
CATEGORIES=		databases
MASTER_SITES=		SF

MAINTAINER=		ports@FreeBSD.org
COMMENT=		Yet Another SQL*Plus Replacement

BUILD_DEPENDS=	p5-DBD-Oracle>=0:${PORTSDIR}/databases/p5-DBD-Oracle	\
		p5-ReadLine-Gnu>=0:${PORTSDIR}/devel/p5-ReadLine-Gnu
RUN_DEPENDS:=	${BUILD_DEPENDS}

LICENSE=	GPLv2

# Time::HiRes is used for high resolution benchmarking
.if !defined(WITHOUT_HIRES)
BUILD_DEPENDS+=	p5-Time-HiRes>=0:${PORTSDIR}/devel/p5-Time-HiRes
.endif

# Text::CSV_XS is required to output CSV or input from CSV files
.if !defined(WITHOUT_CSV)
BUILD_DEPENDS+=	p5-Text-CSV_XS>=0:${PORTSDIR}/textproc/p5-Text-CSV_XS
.endif

# Term::ReadKey is used for better input and output control
.if !defined(WITHOUT_READKEY)
BUILD_DEPENDS+=	p5-Term-ReadKey>=0:${PORTSDIR}/devel/p5-Term-ReadKey
.endif

HAS_CONFIGURE=	yes
CONFIGURE_ARGS=	--prefix=${PREFIX}
USE_PERL5=	yes
ALL_TARGET=	default

SUB_FILES=	pkg-message
PKGMESSAGE=	${WRKDIR}/pkg-message

PLIST_FILES=	bin/yasql etc/yasql.conf.sample

MAN1=		yasql.1

PORTDOCS=	README yasql.html

pre-everything::
	@${ECHO_MSG}
	@${ECHO_MSG} "You may use the following build options:"
	@${ECHO_MSG}
	@${ECHO_MSG} "WITHOUT_CSV	disable support for in/out CSV files"
	@${ECHO_MSG} "WITHOUT_HIRES	disable support for high resolution benchmarking"
	@${ECHO_MSG} "WITHOUT_READKEY	disable a better input and output control"
	@${ECHO_MSG}

pre-configure:
	${REINPLACE_CMD} 's,%%LOCALBASE%%,${LOCALBASE},g' ${WRKSRC}/yasql.in
	${PERL} -pi -e 's|/bin/more|/usr/bin/more|' ${WRKSRC}/yasql.conf

pre-install:
	if [ -f ${PREFIX}/etc/yasql.conf ] ; then \
		${MV} ${PREFIX}/etc/yasql.conf ${PREFIX}/etc/yasql.conf.precious ; \
	fi

post-install:
	${MV} ${PREFIX}/etc/yasql.conf ${PREFIX}/etc/yasql.conf.sample
.if !defined(NOPORTDOCS)
	${MKDIR} ${DOCSDIR}
	${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${DOCSDIR}
.endif
	@if [ -f ${PREFIX}/etc/yasql.conf.precious ] ; then \
		${MV} ${PREFIX}/etc/yasql.conf.precious ${PREFIX}/etc/yasql.conf ; \
	else \
		${ECHO_MSG} ; \
		${CAT} ${PKGMESSAGE} ; \
		${ECHO_MSG} ; \
	fi

.include <bsd.port.mk>