From owner-cvs-all Tue Apr 11 1:35:48 2000 Delivered-To: cvs-all@freebsd.org Received: from smtp6.mindspring.com (smtp6.mindspring.com [207.69.200.110]) by hub.freebsd.org (Postfix) with ESMTP id DD7EB37B897; Tue, 11 Apr 2000 01:35:38 -0700 (PDT) (envelope-from asami@cs.berkeley.edu) Received: from silvia.hip.berkeley.edu (sji-ca5-83.ix.netcom.com [209.109.234.83]) by smtp6.mindspring.com (8.9.3/8.8.5) with ESMTP id EAA10546; Tue, 11 Apr 2000 04:35:35 -0400 (EDT) Received: (from asami@localhost) by silvia.hip.berkeley.edu (8.9.3/8.6.9) id BAA19051; Tue, 11 Apr 2000 01:35:01 -0700 (PDT) To: "Akinori -Aki- MUSHA" Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: ports/chinese Makefile.inc ports/german Makefile.inc ports/japanese Makefile.inc ports/korean Makefile.inc ports/russian Makefile.inc ports/vietnamese Makefile.inc References: <200004101634.JAA94507@freefall.freebsd.org> <86hfd9rzkz.wl@archon.local.idaemons.org> <86d7nxrtbj.wl@archon.local.idaemons.org> From: asami@FreeBSD.org (Satoshi - Ports Wraith - Asami) Date: 11 Apr 2000 01:34:45 -0700 In-Reply-To: "Akinori -Aki- MUSHA"'s message of "Tue, 11 Apr 2000 16:27:12 +0900" Message-ID: Lines: 155 X-Mailer: Gnus v5.7/Emacs 20.6 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * From: "Akinori -Aki- MUSHA" * Unfortunately, I found bsd.port.mk does not include * `${MASTERDIR}/../Makefile.inc' automatically while it includes * `${.CURDIR}/../Makefile.inc'. Yes, I have been thinking about that too. :) * I think it'd be bad if every slave port were to be forced to include * `${.CURDIR}/../Makefile.inc' for itself before including * `${MASTERDIR}/Makefile', so I'd suggest we prepare some files as * follows: I don't think you need to go that far. How about the following? Basically it includes ${.CURDIR}/../Makefile.inc iff ${.CURDIR} is different from ${MASTERDIR} (i.e., this is a slave port). === Index: Mk/bsd.port.mk =================================================================== RCS file: /usr/cvs/ports/Mk/bsd.port.mk,v retrieving revision 1.334 diff -u -r1.334 bsd.port.mk --- bsd.port.mk 2000/04/10 12:31:02 1.334 +++ bsd.port.mk 2000/04/11 08:26:03 @@ -491,6 +491,10 @@ # If they exist, include Makefile.inc, then architecture/operating # system specific Makefiles, then local Makefile.local. +.if ${MASTERDIR} != ${.CURDIR} && exists(${.CURDIR}/../Makefile.inc) +.include "${.CURDIR}/../Makefile.inc" +.endif + .if exists(${MASTERDIR}/../Makefile.inc) .include "${MASTERDIR}/../Makefile.inc" .endif @@ -507,6 +511,25 @@ .include "${MASTERDIR}/Makefile.local" .endif +.if defined(REQUIRE_PORTNAME) && !defined(PORTNAME) +.BEGIN: + @${ECHO} "${PKGNAME}: You need to define PORTNAME and PORTVERSION instead of PKGNAME." + @${ECHO} "(This port is too old for your bsd.port.mk.)" + @${FALSE} +.endif +.if defined(PORTNAME) +.if defined(PKGNAME) || !defined(PORTVERSION) +.BEGIN: + @${ECHO} "${PKGNAME}: You need to define PORTNAME and PORTVERSION instead of PKGNAME." + @${FALSE} +.endif +PKGNAME= ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}-${PORTVERSION} +DISTNAME?= ${PORTNAME}-${PORTVERSION} +.else +# old style +PKGNAME?= ${DISTNAME} +.endif + # These need to be absolute since we don't know how deep in the ports # tree we are and thus can't go relative. They can, of course, be overridden # by individual Makefiles or local system make configuration. @@ -1102,25 +1125,6 @@ .if defined(FETCH_SYMLINK_DISTFILES) FETCH_BEFORE_ARGS+= -l .endif -.endif - -.if defined(REQUIRE_PORTNAME) && !defined(PORTNAME) -.BEGIN: - @${ECHO} "${PKGNAME}: You need to define PORTNAME and PORTVERSION instead of PKGNAME." - @${ECHO} "(This port is too old for your bsd.port.mk.)" - @${FALSE} -.endif -.if defined(PORTNAME) -.if defined(PKGNAME) || !defined(PORTVERSION) -.BEGIN: - @${ECHO} "${PKGNAME}: You need to define PORTNAME and PORTVERSION instead of PKGNAME." - @${FALSE} -.endif -PKGNAME= ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}-${PORTVERSION} -DISTNAME?= ${PORTNAME}-${PORTVERSION} -.else -# old style -PKGNAME?= ${DISTNAME} .endif DISTFILES?= ${DISTNAME}${EXTRACT_SUFX} === I also moved the PKGNAME/DISTNAME setting up to within the pre.mk section, otherwise a port that tests on the value of PKGNAME will be dead. With this, {japanese,korean}/Wnn (thanks for the example), for instance, can be modified this way (I haven't fixed variable ordering to keep the diff small): === Index: japanese/Wnn/Makefile =================================================================== RCS file: /usr/cvs/ports/japanese/Wnn/Makefile,v retrieving revision 1.28 diff -u -r1.28 Makefile --- Makefile 2000/03/09 03:14:34 1.28 +++ Makefile 2000/04/11 08:24:43 @@ -7,7 +7,8 @@ # DISTNAME= Wnn4.2 -PKGNAME?= ja-Wnn-4.2 +PORTNAME= Wnn +PORTVERSION= 4.2 CATEGORIES?= japanese MASTER_SITES= ftp://ftp.u-tokyo.ac.jp/pub/Japanese/Wnn/ \ ftp://ftp.wg.omron.co.jp/pub/Wnn/dic/pubdic+/ \ @@ -30,6 +31,8 @@ BATCH= yes # make sure it's not empty .endif +.include + .if (${PKGNAME} == ja-Wnn-4.2) DISTFILES+= pubdic+.tar.gz pubdic+-fix01.gz pubdic+.diff pubdic+.special.diff PORT_DOCDIR= ${PREFIX}/share/doc/ja-Wnn @@ -167,4 +170,4 @@ fi ${SETENV} OBJFORMAT=${PORTOBJFORMAT} ${LDCONFIG} -m ${PREFIX}/lib -.include +.include Index: korean/Wnn/Makefile =================================================================== RCS file: /usr/cvs/ports/korean/Wnn/Makefile,v retrieving revision 1.8 diff -u -r1.8 Makefile --- Makefile 1999/08/30 12:08:35 1.8 +++ Makefile 2000/04/11 08:31:47 @@ -6,7 +6,6 @@ # $FreeBSD: ports/korean/Wnn/Makefile,v 1.8 1999/08/30 12:08:35 peter Exp $ # -PKGNAME= ko-Wnn-4.2 CATEGORIES= korean ## COMMENT, DESCR, PLIST is used in a local 'pkg' directory === (I only tested "make package-name", but since everything is conditionalized on ${PKGNAME}, I think it will work.) Note that you don't even have to set PORTNAME/PORTVERSION in ko-Wnn anymore! Satoshi To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message