summaryrefslogtreecommitdiffstats
path: root/databases
diff options
context:
space:
mode:
authormat <mat@FreeBSD.org>2004-08-23 15:07:03 +0000
committermat <mat@FreeBSD.org>2004-08-23 15:07:03 +0000
commitee0ab9689189ce0a3adcab2d9fda54f2ce034e94 (patch)
tree8d9ada96e1453837761c4f8e5aa385e66ee69ba4 /databases
parent1141e95b1039062a76099ec572d6561cef7c9c5e (diff)
downloadFreeBSD-ports-ee0ab9689189ce0a3adcab2d9fda54f2ce034e94.zip
FreeBSD-ports-ee0ab9689189ce0a3adcab2d9fda54f2ce034e94.tar.gz
Add unixODBC support for 5.x+
Asked by: Justin England <jengland@enetis.net>
Diffstat (limited to 'databases')
-rw-r--r--databases/p5-DBD-ODBC/Makefile32
1 files changed, 28 insertions, 4 deletions
diff --git a/databases/p5-DBD-ODBC/Makefile b/databases/p5-DBD-ODBC/Makefile
index 0e3ccbc..1e7d5a1 100644
--- a/databases/p5-DBD-ODBC/Makefile
+++ b/databases/p5-DBD-ODBC/Makefile
@@ -7,6 +7,7 @@
PORTNAME= DBD-ODBC
PORTVERSION= 1.09
+PORTREVISION= 1
CATEGORIES= databases perl5
MASTER_SITES= ${MASTER_SITE_PERL_CPAN}
MASTER_SITE_SUBDIR= DBD
@@ -15,19 +16,42 @@ PKGNAMEPREFIX= p5-
MAINTAINER= mat@FreeBSD.org
COMMENT= DBD module interfacing the ODBC databases
-LIB_DEPENDS= iodbc.3:${PORTSDIR}/databases/libiodbc
-
PERL_CONFIGURE= yes
CONFIGURE_ARGS+= -o ${LOCALBASE}
USE_REINPLACE= yes
MAN3= DBD::ODBC.3
+OPTIONS= IODBC "Link with libiodbc" on \
+ ODBC "Link with unixODBC (Only with 5.x+)" off
+
+.include <bsd.port.pre.mk>
+
+.if defined(WITH_IODBC) && defined(WITH_ODBC)
+BROKEN= "Should only select one of ODBC and IODBC"
+.endif
+.if defined(WITH_ODBC) && ${OSVERSION} < 500016
+IGNORE= "Due to some obscure -pthread things, you can't have this work"
+.endif
+
+.if !defined(WITHOUT_IODBC)
+LIB_DEPENDS+= iodbc.3:${PORTSDIR}/databases/libiodbc
+MYODBC= iodbc
+.endif
+.if defined(WITH_ODBC)
+LIB_DEPENDS+= odbc.1:${PORTSDIR}/databases/unixODBC
+MYODBC= unixodbc
+post-configure:
+ @${PERL} -pi -e 's/-lodbc/-lodbc ${PTHREAD_LIBS}/g;' \
+ -e 's/$$/ ${PTHREAD_CFLAGS}/ if (/^CCFLAGS/);' \
+ ${WRKSRC}/Makefile
+.endif
+
post-patch:
@${REINPLACE_CMD} -e 's/[[:<:]]our[[:>:]]/my/g' \
-e 's/^ @$$(NOOP)/ @$$(NOOP)/g' ${WRKSRC}/Makefile.PL
-
-.include <bsd.port.pre.mk>
+ @${PERL} -pi -e '$$_ .= "\$$myodbc = \"${MYODBC}\";" if ($$. == 204);' \
+ ${WRKSRC}/Makefile.PL
.if ${PERL_LEVEL} < 500600
BUILD_DEPENDS+= ${SITE_PERL}/${PERL_ARCH}/DBI.pm:${PORTSDIR}/databases/p5-DBI-137
OpenPOWER on IntegriCloud