pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/createbuildlink Update createbuildlink to 3.0...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/c0b545bbb0ee
branches:  trunk
changeset: 466261:c0b545bbb0ee
user:      rh <rh%pkgsrc.org@localhost>
date:      Wed Jan 14 08:53:57 2004 +0000

description:
Update createbuildlink to 3.0.  This now adds -2 and -3 options to create
either buildlink2.mk or buildlink3.mk files.

diffstat:

 pkgtools/createbuildlink/Makefile                |   4 +-
 pkgtools/createbuildlink/files/createbuildlink   |  90 ++++++++++++++++++++---
 pkgtools/createbuildlink/files/createbuildlink.8 |  21 ++--
 3 files changed, 89 insertions(+), 26 deletions(-)

diffs (256 lines):

diff -r cbb1cf6f2bb2 -r c0b545bbb0ee pkgtools/createbuildlink/Makefile
--- a/pkgtools/createbuildlink/Makefile Wed Jan 14 08:23:07 2004 +0000
+++ b/pkgtools/createbuildlink/Makefile Wed Jan 14 08:53:57 2004 +0000
@@ -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 -r cbb1cf6f2bb2 -r c0b545bbb0ee pkgtools/createbuildlink/files/createbuildlink
--- a/pkgtools/createbuildlink/files/createbuildlink    Wed Jan 14 08:23:07 2004 +0000
+++ b/pkgtools/createbuildlink/files/createbuildlink    Wed Jan 14 08:53:57 2004 +0000
@@ -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 @@
        -j)
                join=YES
                ;;
+       -2)
+               blver=2
+               otherver=3
+               ;;
+       -3)
+               blver=3
+               otherver=2
+               ;;
        --)
                shift; break
                ;;
@@ -67,14 +79,14 @@
 ## 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 @@
 #
 # This Makefile fragment is included by packages that use $PKGNOVER.
 #
-# This file was created automatically using createbuildlink @PKGVERSION@.
+# This file was created automatically using createbuildlink-@PKGVERSION@.
 #
 
+EOF
+
+##
+## buildlink 2
+##
+if [ $blver = 2 ]; then
+
+sed -f $sedrules <<EOF
 .if !defined(${PKGUPPER}_BUILDLINK2_MK)
 ${PKGUPPER}_BUILDLINK2_MK=     # defined
 
+EOF
+
+else   # buildlink 3
+
+sed -f $sedrules <<EOF
+BUILDLINK_DEPTH:=      \${BUILDLINK_DEPTH}+
+${PKGUPPER}_BUILDLINK3_MK:=    \${${PKGUPPER}_BUILDLINK3_MK}+
+
+.if !empty(BUILDLINK_DEPTH:M+)
+BUILDLINK_DEPENDS+=    ${PKGNOVER}
+.endif
+
+.if !empty(${PKGUPPER}_BUILDLINK3_MK:M+)
+EOF
+
+fi     # buildlink 2/3
+
+sed -f $sedrules <<EOF
 BUILDLINK_PACKAGES+=                   $PKGNOVER
 BUILDLINK_DEPENDS.$PKGNOVER?=          $PKGNOVER>=$PKGVER
 BUILDLINK_PKGSRCDIR.$PKGNOVER?=                ../../$CURDIR
 
+EOF
+
+##
+## buildlink2-only part
+##
+if [ $blver = 2 ]; then
+sed -f $sedrules <<EOF
 EVAL_PREFIX+=  BUILDLINK_PREFIX.$PKGNOVER=$PKGNOVER
 BUILDLINK_PREFIX.${PKGNOVER}_DEFAULT=  \${$PREFIX}
 EOF
 
 ##
-## buildlinked includes
+## buildlinked includes (buildlink2 only)
 ##
 if [ "$join" = "YES" ]; then
        for i in `egrep "^include/|/Headers/.*\.h" $PLIST \
@@ -150,7 +195,7 @@
 fi
 
 ##
-## buildlinked libraries
+## buildlinked libraries (buildlink2 only)
 ##
 for i in \
 `egrep '^lib/|/Libraries/.*/lib[^\.]*\.a$|/Libraries/.*/lib[^\.]*\.so' $PLIST \
@@ -161,17 +206,24 @@
 
 echo ""
 
+fi     ## end of buildlink2-only part
+
 ##
 ## buildlinked dependencies
 ##
 for i in $makefile $commons ; do
-       [ ! -f $i ] || grep '^.include.*\.\.\/.*\/.*/buildlink2.mk\"' $i |
+       [ ! -f $i ] || grep '^.include.*\.\.\/.*\/.*/buildlink[23].mk\"' $i |
+               sed "s/buildlink$otherver/buildlink$blver/"             |
                egrep -v '/devel/pkgconfig/|/textproc/intltool/'
 done
-grep -l '^.include.*\.\.\/.*\/.*/buildlink2.mk\"' $makefile $commons \
+grep -l '^.include.*\.\.\/.*\/.*/buildlink[23].mk\"' $makefile $commons \
        >/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
 ##
 echo "BUILDLINK_TARGETS+=      ${PKGNOVER}-buildlink"
@@ -185,4 +237,14 @@
 
 echo ".endif   # ${PKGUPPER}_BUILDLINK2_MK"
 
+else   # buildlink 3
+
+sed -f $sedrules <<EOF
+.endif # ${PKGUPPER}_BUILDLINK3_MK
+
+BUILDLINK_DEPTH:=     \${BUILDLINK_DEPTH:S/+\$//}
+EOF
+
+fi     # buildlink 2/3
+
 rm -f $sedrules
diff -r cbb1cf6f2bb2 -r c0b545bbb0ee pkgtools/createbuildlink/files/createbuildlink.8
--- a/pkgtools/createbuildlink/files/createbuildlink.8  Wed Jan 14 08:23:07 2004 +0000
+++ b/pkgtools/createbuildlink/files/createbuildlink.8  Wed Jan 14 08:53:57 2004 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: createbuildlink.8,v 1.5 2003/04/29 01:36:08 rh Exp $
+.\"    $NetBSD: createbuildlink.8,v 1.6 2004/01/14 08:53:57 rh Exp $
 .\"
 .\" Copyright (c) 2002 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -34,15 +34,15 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd April 29, 2003
+.Dd January 14, 2004
 .Dt CREATEBUILDLINK 8
 .Os
 .Sh NAME
 .Nm createbuildlink
-.Nd automatic pkgsrc buildlink2.mk generator
+.Nd automatic pkgsrc buildlink2.mk and buildlink3.mk generator
 .Sh SYNOPSIS
 .Nm
-.Op Fl j
+.Op Fl j23
 .Sh DESCRIPTION
 .Nm
 reads in the
@@ -61,12 +61,15 @@
 Be careful with this option and only use it if you are sure that the
 package in question is the only one providing header files in the PLISTed
 directory.
+.It Fl 2
+Create buildlink2.mk style output (the default).
+.It Fl 3
+Create buildlink3.mk style output.
 .El
 .Pp
 While
 .Nm
-is supposed to help starting create a
-.Pa buildlink2.mk
+is supposed to help starting create a buildlink file
 for a package, it is not intended to fly on autopilot.
 That means that while the script makes some simplistic attempts
 to interpret some elements of the
@@ -79,13 +82,11 @@
 .Pp
 Using
 .Nm
-helps maneuver through the initial process of creating a
-.Pa buildlink2.mk
+helps maneuver through the initial process of creating a buildlink
 file for a package to be included by depending packages.
 Using
 .Nm
-is less error-prone than copying an existing
-.Pa buildlink2.mk
+is less error-prone than copying an existing buildlink file
 as a template and renaming the entries in there.
 .Sh SEE ALSO
 .Xr packages 7 ,



Home | Main Index | Thread Index | Old Index