From owner-freebsd-ports Mon Oct 9 19: 0:19 2000 Delivered-To: freebsd-ports@freebsd.org Received: from hyde.ssec.wisc.edu (hyde.ssec.wisc.edu [144.92.108.217]) by hub.freebsd.org (Postfix) with ESMTP id 3DE3E37B503 for ; Mon, 9 Oct 2000 19:00:16 -0700 (PDT) Received: from hyde.ssec.wisc.edu (dglo@localhost [127.0.0.1]) by hyde.ssec.wisc.edu (8.9.3/8.9.3) with ESMTP id UAA16944 for ; Mon, 9 Oct 2000 20:59:59 -0500 (CDT) Message-Id: <200010100159.UAA16944@hyde.ssec.wisc.edu> To: freebsd-ports@freebsd.org Subject: Help with Makefile for new mysql-jdbc-mm port X-image-url: http://www.ssec.wisc.edu/~dglo/headshot.jpg Date: Mon, 09 Oct 2000 20:59:59 -0500 From: Dave Glowacki Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org I'm trying to update the mysql-jdbc-mm Makefile and I have a couple of questions about the proper way to do this. First, the sources and documentation are distributed in a .jar file (which, for those who don't know, is basically a zip file with some standard files added.) The appended Makefile has my hacks to extract everything from this. Can someone tell me if this is the right way to do things, please? Second, the sources will work with either JDK 1.1 or Java2, but the Java2 sources should only be built by a Java2 compiler. I'm trying to check for the existence of a Java2 compiler by doing: JAVA2C= ${LOCALBASE}/jdk1.2.2/bin/javac .if exists(${JAVA2C}) ALL_TARGET= jar .else ALL_TARGET= jdbc1-jar .endif but ${LOCALBASE} isn't set when this is evaluated, so 'make' ends up checking for "/jdk1.2.2/bin/javac". What's the right way to do this? Here's my Makefile: # New ports collection makefile for: The mm MySql JDBC interface # Date created: 2 January 2000 # Whom: Dave Glowacki # # $FreeBSD: ports/databases/mysql-jdbc-mm/Makefile,v 1.6 2000/09/05 02:09:25 steve Exp $ # PORTNAME= mysql-jdbc-mm PORTVERSION= 2.0.2 CATEGORIES= databases java MASTER_SITES= http://www.worldserver.com/mm.mysql/dist/ DISTNAME= mm.mysql-${PORTVERSION} EXTRACT_SUFX= -src.jar MAINTAINER= dglo@SSEC.WISC.EDU JAVA_HOME?= ${LOCALBASE}/jdk1.1.8 BUILD_DEPENDS= ${JAVA_HOME}/bin/javac:${PORTSDIR}/java/jdk RUN_DEPENDS= ${JAVA_HOME}/bin/java:${PORTSDIR}/java/jdk EXTRACT_CMD= ${JAVA_HOME}/bin/jar EXTRACT_BEFORE_ARGS= -xf USE_GMAKE= yes JAVA2C= ${LOCALBASE}/jdk1.2.2/bin/javac .if exists(${JAVA2C}) ALL_TARGET= jar .else ALL_TARGET= jdbc1-jar .endif foo: echo LB=${LOCALBASE} J2C=${JAVA2C} AT=${ALL_TARGET} do-install: @${MKDIR} ${PREFIX}/share/java/classes @${INSTALL_DATA} ${WRKSRC}/mysql_1_uncomp.jar ${LOCALBASE}/share/java/classes @${INSTALL_DATA} ${WRKSRC}/mysql_1_comp.jar ${LOCALBASE}/share/java/classes .if exists(${JAVA2C}) @${INSTALL_DATA} ${WRKSRC}/mysql_2_uncomp.jar ${LOCALBASE}/share/java/classes @${INSTALL_DATA} ${WRKSRC}/mysql_2_comp.jar ${LOCALBASE}/share/java/classes @${INSTALL_DATA} ${WRKSRC}/mysql_both_uncomp.jar ${LOCALBASE}/share/java/classes @${INSTALL_DATA} ${WRKSRC}/mysql_both_comp.jar ${LOCALBASE}/share/java/classes .endif post-install: .if !defined(NOPORTDOCS) @${MKDIR} ${PREFIX}/share/doc/mysql-jdbc @(cd ${WRKSRC}/doc && ${TAR} -c -f - .) \ | (cd ${PREFIX}/share/doc/mysql-jdbc && ${TAR} --unlink -x -f -) @(cd ${PREFIX} \ && find share/doc/mysql-jdbc -type f -print >> ${TMPPLIST}) .endif .include To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message