From dc05a454cdb0c888dbb78273dae11cbe8847945f Mon Sep 17 00:00:00 2001 From: sakamoto Date: Fri, 3 Sep 1999 04:37:36 +0000 Subject: Update to 1.2 Support FreeBSD RCS Id. Get HOMEPAGE value from pkg/DESCR. s/PLIST_SUB/PLIST_SUBST/ s/%%(^%)%%/\${$1}/ in PLIST. --- pkgtools/port2pkg/Makefile | 4 ++-- pkgtools/port2pkg/files/port2pkg.pl | 20 +++++++++++++++++--- 2 files changed, 19 insertions(+), 5 deletions(-) (limited to 'pkgtools/port2pkg') diff --git a/pkgtools/port2pkg/Makefile b/pkgtools/port2pkg/Makefile index 80d9f6b970b..bca401105f0 100644 --- a/pkgtools/port2pkg/Makefile +++ b/pkgtools/port2pkg/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.2 1999/08/10 00:36:18 sakamoto Exp $ +# $NetBSD: Makefile,v 1.3 1999/09/03 04:37:36 sakamoto Exp $ # -DISTNAME= port2pkg-1.1 +DISTNAME= port2pkg-1.2 CATEGORIES= pkgtools MASTER_SITES= # empty DISTFILES= # empty diff --git a/pkgtools/port2pkg/files/port2pkg.pl b/pkgtools/port2pkg/files/port2pkg.pl index 91fcb61a9c4..47f9590e4ea 100755 --- a/pkgtools/port2pkg/files/port2pkg.pl +++ b/pkgtools/port2pkg/files/port2pkg.pl @@ -1,6 +1,6 @@ #!/usr/bin/env perl # -# $NetBSD: port2pkg.pl,v 1.1.1.1 1999/07/27 11:33:06 sakamoto Exp $ +# $NetBSD: port2pkg.pl,v 1.2 1999/09/03 04:37:36 sakamoto Exp $ # require 'getopts.pl'; @@ -99,8 +99,8 @@ sub conv_Makefile { while () { if (! /^\#/) {last;} - if (/\$(Id: .*)/) { - print PKG "\# FreeBSD $1\n"; + if (/\$FreeBSD:( .*) \$/ || /\$Id: port2pkg.pl,v 1.2 1999/09/03 04:37:36 sakamoto Exp $/) { + print PKG "\# FreeBSD Id:$1\n"; } else { print; } @@ -123,10 +123,12 @@ sub conv_Makefile { } } + s|^\.include |.include \"../../mk/bsd.prefs.mk\"|; s|^\.include |.include \"../../mk/bsd.pkg.mk\"|; s|^FETCH_(DEPENDS)|BUILD_$1|; s|^LIB_(DEPENDS)|$1|; s|\$\{PORTSDIR\}|../..|g; + s|PLIST_SUB|PLIST_SUBST|; if (defined($master_site_subdir) && $master_site_subdir ne "" && @@ -141,6 +143,7 @@ sub conv_Makefile { } if (/(\/usr\/local)/ || + /(\/usr\/X11R6)/ || /(ldconfig)/i || /(MASTERDIR)/ || /(.*cat.*MESSAGE.*)/i) { @@ -165,6 +168,16 @@ sub conv_Makefile { if ($nextline) { $remove = 1; } + + open(DESCR, "$pkgdir/pkg/DESCR") + || die "$pkgdir/pkg/DESCR: $!\n"; + while () { + chop; + if (/^WWW:[\s]*(.*)/) { + print PKG "HOMEPAGE=\t$1\n"; + } + } + close(DESCR); } elsif ($noportdocs || /^\.if.*NOPORTDOCS/) { if (/^\.if/) { $noportdocs++; @@ -210,6 +223,7 @@ sub conv_PLIST { print PKG "\@comment \$NetBSD\$\n"; my ($cat_added, $man_added); while () { + s|\%\%([^\%]+)\%\%|\${$1}|g; if (/^\@.*ldconfig/) {next;} if (defined($cat_added) && $cat_added == 0 && /^[d-z]/){ &add_manual(*PKG, "cat"); -- cgit v1.2.3