From 6978c69a8a3d1ea9c582d33f48f24cbabfb0825b Mon Sep 17 00:00:00 2001 From: rh Date: Wed, 14 Jan 2004 08:53:57 +0000 Subject: Update createbuildlink to 3.0. This now adds -2 and -3 options to create either buildlink2.mk or buildlink3.mk files. --- pkgtools/createbuildlink/Makefile | 4 +- pkgtools/createbuildlink/files/createbuildlink | 90 ++++++++++++++++++++---- pkgtools/createbuildlink/files/createbuildlink.8 | 21 +++--- 3 files changed, 89 insertions(+), 26 deletions(-) diff --git a/pkgtools/createbuildlink/Makefile b/pkgtools/createbuildlink/Makefile index 342de2a57af..6f34267c968 100644 --- a/pkgtools/createbuildlink/Makefile +++ b/pkgtools/createbuildlink/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.20 2003/12/22 01:15:49 uebayasi Exp $ +# $NetBSD: Makefile,v 1.21 2004/01/14 08:53:57 rh Exp $ # -DISTNAME= createbuildlink-2.9 +DISTNAME= createbuildlink-3.0 WRKSRC= ${WRKDIR} CATEGORIES= pkgtools sysutils MASTER_SITES= # Nothing diff --git a/pkgtools/createbuildlink/files/createbuildlink b/pkgtools/createbuildlink/files/createbuildlink index 57d1f0cc146..e9774ba8094 100755 --- a/pkgtools/createbuildlink/files/createbuildlink +++ b/pkgtools/createbuildlink/files/createbuildlink @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: createbuildlink,v 1.16 2003/12/22 01:15:50 uebayasi Exp $ +# $NetBSD: createbuildlink,v 1.17 2004/01/14 08:53:57 rh Exp $ # # Copyright (c) 2002 The NetBSD Foundation, Inc. # All rights reserved. @@ -36,18 +36,22 @@ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -# Create an initial buildlink2.mk from a package's Makefile and PLIST +# Create an initial buildlink2.mk or buildlink3.mk from a package's Makefile +# and PLIST # -REV=`echo '$Revision: 1.16 $' | sed 's/\\$//g'` +REV=`echo '$Revision: 1.17 $' | sed 's/\\$//g'` tmpdir=/tmp makefile=Makefile sedrules=$tmpdir/sedrules.buildlink.$$ PLIST=PLIST +blver=2 +otherver=3 -args=`getopt j $*` +args=`getopt j23 $*` if [ $? != 0 ]; then - echo "Usage: $0 [-j] > buildlink2.mk" + echo "Usage: $0 -2 [-j] > buildlink2.mk" + echo " or: $0 -3 > buildlink3.mk" exit 2 fi set -- $args @@ -56,6 +60,14 @@ while [ $# -gt 0 ]; do -j) join=YES ;; + -2) + blver=2 + otherver=3 + ;; + -3) + blver=3 + otherver=2 + ;; --) shift; break ;; @@ -67,14 +79,14 @@ done ## some simple integrity checking ## if [ ! -f $makefile ]; then - echo "===> Incomplete package! To create a buildlink2.mk <===" - echo "===> a working $makefile is required! <===" + echo "===> Incomplete package! To create a buildlink file <===" + echo "===> a working $makefile is required! <===" exit 1 fi if [ ! -f "$PLIST" ]; then - echo "===> Incomplete package! To create a buildlink2.mk <===" - echo "===> a working PLIST is required! <===" + echo "===> Incomplete package! To create a buildlink file <===" + echo "===> a working PLIST is required! <===" exit 1 fi @@ -121,22 +133,55 @@ sed -f $sedrules <=$PKGVER BUILDLINK_PKGSRCDIR.$PKGNOVER?= ../../$CURDIR +EOF + +## +## buildlink2-only part +## +if [ $blver = 2 ]; then +sed -f $sedrules </dev/null 2>&1 && echo "" # Be careful not to print duplicate \n +## +## buildlink2-only part +## +if [ $blver = 2 ]; then ## ## main buildlink target for this package ## @@ -185,4 +237,14 @@ echo "" echo ".endif # ${PKGUPPER}_BUILDLINK2_MK" +else # buildlink 3 + +sed -f $sedrules <