[Midnightbsd-cvs] mports: mports/Mk: Add mport.inc directory.

ctriv at midnightbsd.org ctriv at midnightbsd.org
Fri May 16 15:08:44 EDT 2008


Log Message:
-----------
Add mport.inc directory.  This directory contains logical units that
together form the bsd.mport.* makefiles.  metadata.mk and commands.mk have
been created so far.

In the furture there will be a ext directory for things like the xorg or
perl extensions.

Modified Files:
--------------
    mports/Mk:
        bsd.mport.mk (r1.102 -> r1.103)

Added Files:
-----------
    mports/Mk/mport.inc:
        commands.mk (r1.1)
        metadata.mk (r1.1)

Removed Files:
-------------
    mports/Mk:
        bsd.commands.mk

-------------- next part --------------
Index: bsd.mport.mk
===================================================================
RCS file: /home/cvs/mports/Mk/bsd.mport.mk,v
retrieving revision 1.102
retrieving revision 1.103
diff -L Mk/bsd.mport.mk -L Mk/bsd.mport.mk -u -r1.102 -r1.103
--- Mk/bsd.mport.mk
+++ Mk/bsd.mport.mk
@@ -1053,7 +1053,7 @@
 
 TARGETDIR:=		${DESTDIR}${PREFIX}
 
-.include "${PORTSDIR}/Mk/bsd.commands.mk"
+.include "${PORTSDIR}/Mk/mport.inc/commands.mk"
 
 # Look for ${WRKSRC}/.../*.orig files, and (re-)create
 # ${FILEDIR}/patch-* files from them.
@@ -1504,8 +1504,14 @@
 	@${FALSE}
 .endif
 
+
 _POSTMKINCLUDED=	yes
 
+#
+# Pull in our mixins.
+#
+.include "${PORTSDIR}/Mk/mport.inc/metadata.mk"
+
 WRKDIR?=		${WRKDIRPREFIX}${.CURDIR}/work
 .if defined(NO_WRKSUBDIR)
 WRKSRC?=		${WRKDIR}
@@ -3099,12 +3105,6 @@
 .endif
 .endif
 
-# Disable describe
-.if defined(NO_DESCRIBE) && !target(describe)
-describe:
-	@${DO_NADA}
-.endif
-
 ################################################################
 # More standard targets start here.
 #
@@ -4984,194 +4984,6 @@
 # shouldn't be touched by anybody but the release engineers.
 ################################################################
 
-# This target generates an index entry suitable for aggregation into
-# a large index.  Format is:
-#
-# distribution-name|port-path|installation-prefix|comment| \
-#  description-file|maintainer|categories|extract-depends| \
-#  patch-depends|fetch-depends|build-depends|run-depends|www site
-#
-# If this ever changes, portmgr should contact the portsnap maintainer
-# first to avoid gratuitous breakage.
-
-.if !target(describe)
-describe:
-	@${ECHO_CMD} -n "${PKGNAME}|${.CURDIR}|${PREFIX}|"
-.if defined(COMMENT)
-	@${ECHO_CMD} -n ${COMMENT:Q}
-.else
-	@${ECHO_CMD} -n '** No Description'
-.endif
-	@perl -e ' \
-		if ( -f q{${DESCR}} ) { \
-			print q{|${DESCR}}; \
-		} else { \
-			print q{|/dev/null}; \
-		} \
-		print q{|${MAINTAINER}|${CATEGORIES}|}; \
-		@edirs = map((split /:/)[1], split(q{ }, q{${EXTRACT_DEPENDS}})); \
-		@pdirs = map((split /:/)[1], split(q{ }, q{${PATCH_DEPENDS}})); \
-		@fdirs = map((split /:/)[1], split(q{ }, q{${FETCH_DEPENDS}})); \
-		@bdirs = map((split /:/)[1], split(q{ }, q{${BUILD_DEPENDS}})); \
-		@rdirs = map((split /:/)[1], split(q{ }, q{${RUN_DEPENDS}})); \
-		@ddirs = map((split /:/)[0], split(q{ }, q{${DEPENDS}})); \
-		@ldirs = map((split /:/)[1], split(q{ }, q{${LIB_DEPENDS}})); \
-		for my $$i (\@edirs, \@pdirs, \@fdirs, \@bdirs, \@rdirs, \@ddirs, \@ldirs) { \
-			my @dirs = @$$i; \
-			@$$i = (); \
-			for (@dirs) { \
-				if (-d $$_) { \
-					push @$$i, $$_; \
-				} else { \
-					print STDERR qq{${PKGNAME}: \"$$_\" non-existent -- dependency list incomplete\n}; \
-					exit(1); \
-				} \
-			} \
-		} \
-		for (@edirs, @ddirs) { \
-			$$xe{$$_} = 1; \
-		} \
-		print join(q{ }, sort keys %xe), q{|}; \
-		for (@pdirs, @ddirs) { \
-			$$xp{$$_} = 1; \
-		} \
-		print join(q{ }, sort keys %xp), q{|}; \
-		for (@fdirs, @ddirs) { \
-			$$xf{$$_} = 1; \
-		} \
-		print join(q{ }, sort keys %xf), q{|}; \
-		for (@bdirs, @ddirs, @ldirs) { \
-			$$xb{$$_} = 1; \
-		} \
-		print join(q{ }, sort keys %xb), q{|}; \
-		for (@rdirs, @ddirs, @ldirs) { \
-			$$xr{$$_} = 1; \
-		} \
-		print join(q{ }, sort keys %xr), q{|}; \
-		if (open(DESCR, q{${DESCR}})) { \
-			while (<DESCR>) { \
-				if (/^WWW:\s+(\S+)/) { \
-					print $$1; \
-					last; \
-				} \
-			} \
-		} \
-		print qq{\n};'
-.endif
-
-
-#
-# describe-yaml
-#
-# Prints the port's description in YAML markup.  YAML is very human readable, and 
-# there are libraries in many languages for conversion to native data structures.
-#
-# This target requires perl.
-.if !target(describe-yaml)
-describe-yaml:
-	@perl -MYAML -e ' \
-		sub uniq (@) {  my %saw;  return grep(!$$saw{$$_}++, @_); } \
-		my %port = ( \
-			pkgname        => q(${PKGSUBNAME}), \
-			name           => q(${PKGORIGIN}), \
-			version        => q(${PKGVERSION}), \
-			description    => qq(${COMMENT:S/'/\x27/g}), \
-			license        => q(${LICENSE}), \
-			categories     => [qw(${CATEGORIES})], \
-			is_interactive => q(${IS_INTERACTIVE}) ? 1 : 0, \
-		); \
-		$$port{license} ||= undef; \
-		my %depends; \
-		$$depends{extract} = [ uniq map((split /:/)[1], qw{${EXTRACT_DEPENDS:S|${PORTSDIR}/||g}}) ]; \
-		$$depends{patch}   = [ uniq map((split /:/)[1], qw{${PATCH_DEPENDS:S|${PORTSDIR}/||}})   ]; \
-		$$depends{fetch}   = [ uniq map((split /:/)[1], qw{${FETCH_DEPENDS:S|${PORTSDIR}/||}})   ]; \
-		$$depends{build}   = [ uniq map((split /:/)[1], qw{${BUILD_DEPENDS:S|${PORTSDIR}/||}})   ]; \
-		$$depends{run}     = [ uniq map((split /:/)[1], qw{${RUN_DEPENDS:S|${PORTSDIR}/||}})     ]; \
-		$$depends{misc}	   = [ uniq map((split /:/)[0], qw{${DEPENDS:S|${PORTSDIR}/||}})         ]; \
-		$$depends{lib}     = [ uniq map((split /:/)[1], qw{${LIB_DEPENDS:S|${PORTSDIR}/||}})     ]; \
-		$$port{depends}  = \%depends; \
-		open(my $$desc, q(<), q(${DESCR})) || die qq(Could not open ${DESCR}: $$!\n); \
-		while (<$$desc>) { \
-			if (m/^WWW:\s+(\S+)/) { \
-				$$port{www} = $$1; \
-				last; \
-			} \
-		} \
-		$$port{www} ||= undef; \
-		print Dump(\%port);  '
-.endif
-
-www-site:
-.if exists(${DESCR})
-	@${AWK} '$$1 ~ /^WWW:/ {print $$2}' ${DESCR} | ${HEAD} -1
-.else
-	@${ECHO_CMD}
-.endif
-
-.if !target(readmes)
-readmes:	readme
-.endif
-
-.if !target(readme)
-readme:
-	@${RM} -f ${.CURDIR}/README.html
-	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} ${.CURDIR}/README.html
-.endif
-
-${.CURDIR}/README.html:
-	@${ECHO_MSG} "===>   Creating README.html for ${PKGNAME}"
-	@__softMAKEFLAGS='${__softMAKEFLAGS:S/'/'\''/g}'; \
-	${SED} -e 's|%%PORT%%|'$$(${ECHO_CMD} ${.CURDIR} | \
-							  ${SED} -e 's|.*/\([^/]*/[^/]*\)$$|\1|')'|g' \
-			-e 's|%%PKG%%|${PKGNAME}|g' \
-			-e 's|%%LICENSE%%|${LICENSE}|g' \
-			-e 's|%%COMMENT%%|'"$$(${ECHO_CMD} ${COMMENT:Q})"'|' \
-			-e '/%%COMMENT%%/d' \
-			-e 's|%%DESCR%%|'"$$(${ECHO_CMD} ${DESCR} | \
-								 ${SED} -e 's|${.CURDIR}/||')"'|' \
-			-e 's|%%EMAIL%%|'"$$(${ECHO_CMD} "${MAINTAINER}" | \
-								 ${SED} -e 's/([^)]*)//;s/.*<//;s/>.*//')"'|g' \
-			-e 's|%%MAINTAINER%%|${MAINTAINER}|g' \
-			-e 's|%%WEBSITE%%|'"$$(cd ${.CURDIR} && eval ${MAKE} \
-					$${__softMAKEFLAGS} pretty-print-www-site)"'|' \
-			-e 's|%%BUILD_DEPENDS%%|'"$$(cd ${.CURDIR} && eval ${MAKE} \
-					$${__softMAKEFLAGS} pretty-print-build-depends-list)"'|' \
-			-e 's|%%RUN_DEPENDS%%|'"$$(cd ${.CURDIR} && eval ${MAKE} \
-					$${__softMAKEFLAGS} pretty-print-run-depends-list)"'|' \
-			-e 's|%%TOP%%|'"$$(${ECHO_CMD} ${CATEGORIES} | \
-							   ${SED} -e 's| .*||' -e 's|[^/]*|..|g')"'/..|' \
-		${TEMPLATES}/README.port >> ${.TARGET}
-
-# The following two targets require an up-to-date INDEX in ${PORTSDIR}
-
-_PRETTY_PRINT_DEPENDS_LIST=\
-	if [ ! -r ${INDEXDIR}/${INDEXFILE} ] ; then \
-		${ECHO_MSG} "${.TARGET} requires an INDEX file (${INDEXFILE}). Please run make index or make fetchindex."; \
-	else \
-		target=${.TARGET:C/pretty-print-(.*)-depends-list/\1/} ; \
-		if [ "$$target" = "build" ] ; then fldnum=8 ; else fldnum=9 ; fi ; \
-		${ECHO_MSG} -n 'This port requires package(s) "' ; \
-		${ECHO_MSG} -n `${AWK} -F\| "\\$$1 ~ /^${PKGNAME}/ {print \\$$$${fldnum};}" ${INDEXDIR}/${INDEXFILE}` ; \
-		${ECHO_MSG} "\" to $$target."; \
-	fi;
-
-
-.if !target(pretty-print-build-depends-list)
-pretty-print-build-depends-list:
-.if defined(EXTRACT_DEPENDS) || defined(PATCH_DEPENDS) || \
-	defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || \
-	defined(LIB_DEPENDS) || defined(DEPENDS)
-	@${_PRETTY_PRINT_DEPENDS_LIST}
-.endif
-.endif
-
-.if !target(pretty-print-run-depends-list)
-pretty-print-run-depends-list:
-.if defined(RUN_DEPENDS) || defined(LIB_DEPENDS) || \
-	defined(DEPENDS)
-	@${_PRETTY_PRINT_DEPENDS_LIST}
-.endif
-.endif
 
 _SUB_LIST_TEMP=	${SUB_LIST:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/}
 .if !target(apply-slist)
--- Mk/bsd.commands.mk
+++ /dev/null
@@ -1,91 +0,0 @@
-#-*- mode: Fundamental; tab-width: 4; -*-
-# ex:ts=4
-#
-# bsd.commands.mk - Common commands used within the ports infrastructure
-#
-# $FreeBSD: ports/Mk/bsd.commands.mk,v 1.1 2007/08/04 11:37:23 gabor Exp $
-# $MidnightBSD: mports/Mk/bsd.commands.mk,v 1.2 2008/01/05 22:22:50 ctriv Exp $
-#
-
-COMMANDS_Include_MAINTAINER=		ctriv at MidnightBSD.org
-
-.if !defined(_COMMANDSMKINCLUDED)
-
-_COMMANDSMKINCLUDED=     yes
-
-_MAKE_CMD=	/usr/bin/make
-
-AWK?=		/usr/bin/awk
-BASENAME?=	/usr/bin/basename
-BRANDELF?=	/usr/bin/brandelf
-BZCAT?=		/usr/bin/bzcat
-BZIP2_CMD?=	/usr/bin/bzip2
-CAT?=		/bin/cat
-CHGRP?=		/usr/bin/chgrp
-CHMOD?=		/bin/chmod
-CHOWN?=		/usr/sbin/chown
-CHROOT?=	/usr/sbin/chroot
-COMM?=		/usr/bin/comm
-CP?=		/bin/cp
-GCPIO?=		${LOCALBASE}/bin/gcpio
-CPIO?=		/usr/bin/cpio
-CUT?=		/usr/bin/cut
-DC?=		/usr/bin/dc
-DIALOG?=	/usr/bin/dialog
-DIFF?=		/usr/bin/diff
-DIRNAME?=	/usr/bin/dirname
-EGREP?=		/usr/bin/egrep
-EXPR?=		/bin/expr
-FALSE?=		false				# Shell builtin
-FILE?=		/usr/bin/file
-FIND?=		/usr/bin/find
-FMT?=		/usr/bin/fmt
-GREP?=		/usr/bin/grep
-GUNZIP_CMD?=	/usr/bin/gunzip -f
-GZCAT?=		/usr/bin/gzcat
-GZIP?=		-9
-GZIP_CMD?=	/usr/bin/gzip -nf ${GZIP}
-HEAD?=		/usr/bin/head
-ID?=		/usr/bin/id
-IDENT?=		/usr/bin/ident
-LDCONFIG?=	/sbin/ldconfig
-LN?=		/bin/ln
-LS?=		/bin/ls
-MKDIR?=		/bin/mkdir -p
-MKTEMP?=	/usr/bin/mktemp
-MV?=		/bin/mv
-OBJCOPY?=	/usr/bin/objcopy
-OBJDUMP?=	/usr/bin/objdump
-PASTE?=		/usr/bin/paste
-PAX?=		/bin/pax
-PRINTF?=	/usr/bin/printf
-REALPATH?=	/bin/realpath
-RM?=		/bin/rm
-RMDIR?=		/bin/rmdir
-SED?=		/usr/bin/sed
-SETENV?=	/usr/bin/env
-SH?=		/bin/sh
-SORT?=		/usr/bin/sort
-STRIP_CMD?=	/usr/bin/strip
-SU_CMD?=	/usr/bin/su root -c
-SUDO?=		/usr/bin/sudo
-SYSCTL?=	/sbin/sysctl
-TAIL?=		/usr/bin/tail
-TEST?=		test				# Shell builtin
-TR?=		LANG=C /usr/bin/tr
-TRUE?=		true				# Shell builtin
-UNAME?=		/usr/bin/uname
-UNZIP_CMD?=	${LOCALBASE}/bin/unzip
-WHICH?=		/usr/bin/which
-XARGS?=		/usr/bin/xargs
-YACC?=		/usr/bin/yacc
-
-# ECHO is defined in /usr/share/mk/sys.mk, which can either be "echo",
-# or "true" if the make flag -s is given.  Use ECHO_CMD where you mean
-# the echo command.
-ECHO_CMD?=	echo				# Shell builtin
-
-# Used to print all the '===>' style prompts - override this to turn them off.
-ECHO_MSG?=		${ECHO_CMD}
-
-.endif
--- /dev/null
+++ Mk/mport.inc/metadata.mk
@@ -0,0 +1,195 @@
+# Metadata support for mports.  This file has the targets for displaying bits 
+# of metadata, such as `describe` and `describe-yaml`
+#
+#
+# $MidnightBSD
+#
+
+# This target generates an index entry suitable for aggregation into
+# a large index.  Format is:
+#
+# distribution-name|port-path|installation-prefix|comment| \
+#  description-file|maintainer|categories|extract-depends| \
+#  patch-depends|fetch-depends|build-depends|run-depends|www site
+#
+# If this ever changes, portmgr should contact the portsnap maintainer
+# first to avoid gratuitous breakage.
+
+.if !target(describe)
+describe:
+	@${ECHO_CMD} -n "${PKGNAME}|${.CURDIR}|${PREFIX}|"
+.if defined(COMMENT)
+	@${ECHO_CMD} -n ${COMMENT:Q}
+.else
+	@${ECHO_CMD} -n '** No Description'
+.endif
+	@perl -e ' \
+		if ( -f q{${DESCR}} ) { \
+			print q{|${DESCR}}; \
+		} else { \
+			print q{|/dev/null}; \
+		} \
+		print q{|${MAINTAINER}|${CATEGORIES}|}; \
+		@edirs = map((split /:/)[1], split(q{ }, q{${EXTRACT_DEPENDS}})); \
+		@pdirs = map((split /:/)[1], split(q{ }, q{${PATCH_DEPENDS}})); \
+		@fdirs = map((split /:/)[1], split(q{ }, q{${FETCH_DEPENDS}})); \
+		@bdirs = map((split /:/)[1], split(q{ }, q{${BUILD_DEPENDS}})); \
+		@rdirs = map((split /:/)[1], split(q{ }, q{${RUN_DEPENDS}})); \
+		@ddirs = map((split /:/)[0], split(q{ }, q{${DEPENDS}})); \
+		@ldirs = map((split /:/)[1], split(q{ }, q{${LIB_DEPENDS}})); \
+		for my $$i (\@edirs, \@pdirs, \@fdirs, \@bdirs, \@rdirs, \@ddirs, \@ldirs) { \
+			my @dirs = @$$i; \
+			@$$i = (); \
+			for (@dirs) { \
+				if (-d $$_) { \
+					push @$$i, $$_; \
+				} else { \
+					print STDERR qq{${PKGNAME}: \"$$_\" non-existent -- dependency list incomplete\n}; \
+					exit(1); \
+				} \
+			} \
+		} \
+		for (@edirs, @ddirs) { \
+			$$xe{$$_} = 1; \
+		} \
+		print join(q{ }, sort keys %xe), q{|}; \
+		for (@pdirs, @ddirs) { \
+			$$xp{$$_} = 1; \
+		} \
+		print join(q{ }, sort keys %xp), q{|}; \
+		for (@fdirs, @ddirs) { \
+			$$xf{$$_} = 1; \
+		} \
+		print join(q{ }, sort keys %xf), q{|}; \
+		for (@bdirs, @ddirs, @ldirs) { \
+			$$xb{$$_} = 1; \
+		} \
+		print join(q{ }, sort keys %xb), q{|}; \
+		for (@rdirs, @ddirs, @ldirs) { \
+			$$xr{$$_} = 1; \
+		} \
+		print join(q{ }, sort keys %xr), q{|}; \
+		if (open(DESCR, q{${DESCR}})) { \
+			while (<DESCR>) { \
+				if (/^WWW:\s+(\S+)/) { \
+					print $$1; \
+					last; \
+				} \
+			} \
+		} \
+		print qq{\n};'
+.endif
+
+
+#
+# describe-yaml
+#
+# Prints the port's description in YAML markup.  YAML is very human readable, and 
+# there are libraries in many languages for conversion to native data structures.
+#
+# This target requires perl.
+.if !target(describe-yaml)
+describe-yaml:
+	@perl -MYAML -e ' \
+		sub uniq (@) {  my %saw;  return grep(!$$saw{$$_}++, @_); } \
+		my %port = ( \
+			pkgname        => q(${PKGSUBNAME}), \
+			name           => q(${PKGORIGIN}), \
+			version        => q(${PKGVERSION}), \
+			description    => qq(${COMMENT:S/'/\x27/g}), \
+			license        => q(${LICENSE}), \
+			categories     => [qw(${CATEGORIES})], \
+			is_interactive => q(${IS_INTERACTIVE}) ? 1 : 0, \
+		); \
+		$$port{license} ||= undef; \
+		my %depends; \
+		$$depends{extract} = [ uniq map((split /:/)[1], qw{${EXTRACT_DEPENDS:S|${PORTSDIR}/||g}}) ]; \
+		$$depends{patch}   = [ uniq map((split /:/)[1], qw{${PATCH_DEPENDS:S|${PORTSDIR}/||}})   ]; \
+		$$depends{fetch}   = [ uniq map((split /:/)[1], qw{${FETCH_DEPENDS:S|${PORTSDIR}/||}})   ]; \
+		$$depends{build}   = [ uniq map((split /:/)[1], qw{${BUILD_DEPENDS:S|${PORTSDIR}/||}})   ]; \
+		$$depends{run}     = [ uniq map((split /:/)[1], qw{${RUN_DEPENDS:S|${PORTSDIR}/||}})     ]; \
+		$$depends{misc}	   = [ uniq map((split /:/)[0], qw{${DEPENDS:S|${PORTSDIR}/||}})         ]; \
+		$$depends{lib}     = [ uniq map((split /:/)[1], qw{${LIB_DEPENDS:S|${PORTSDIR}/||}})     ]; \
+		$$port{depends}  = \%depends; \
+		open(my $$desc, q(<), q(${DESCR})) || die qq(Could not open ${DESCR}: $$!\n); \
+		while (<$$desc>) { \
+			if (m/^WWW:\s+(\S+)/) { \
+				$$port{www} = $$1; \
+				last; \
+			} \
+		} \
+		$$port{www} ||= undef; \
+		print Dump(\%port);  '
+.endif
+
+www-site:
+.if exists(${DESCR})
+	@${AWK} '$$1 ~ /^WWW:/ {print $$2}' ${DESCR} | ${HEAD} -1
+.else
+	@${ECHO_CMD}
+.endif
+
+.if !target(readmes)
+readmes:	readme
+.endif
+
+.if !target(readme)
+readme:
+	@${RM} -f ${.CURDIR}/README.html
+	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} ${.CURDIR}/README.html
+.endif
+
+${.CURDIR}/README.html:
+	@${ECHO_MSG} "===>   Creating README.html for ${PKGNAME}"
+	@__softMAKEFLAGS='${__softMAKEFLAGS:S/'/'\''/g}'; \
+	${SED} -e 's|%%PORT%%|'$$(${ECHO_CMD} ${.CURDIR} | \
+							  ${SED} -e 's|.*/\([^/]*/[^/]*\)$$|\1|')'|g' \
+			-e 's|%%PKG%%|${PKGNAME}|g' \
+			-e 's|%%LICENSE%%|${LICENSE}|g' \
+			-e 's|%%COMMENT%%|'"$$(${ECHO_CMD} ${COMMENT:Q})"'|' \
+			-e '/%%COMMENT%%/d' \
+			-e 's|%%DESCR%%|'"$$(${ECHO_CMD} ${DESCR} | \
+								 ${SED} -e 's|${.CURDIR}/||')"'|' \
+			-e 's|%%EMAIL%%|'"$$(${ECHO_CMD} "${MAINTAINER}" | \
+								 ${SED} -e 's/([^)]*)//;s/.*<//;s/>.*//')"'|g' \
+			-e 's|%%MAINTAINER%%|${MAINTAINER}|g' \
+			-e 's|%%WEBSITE%%|'"$$(cd ${.CURDIR} && eval ${MAKE} \
+					$${__softMAKEFLAGS} pretty-print-www-site)"'|' \
+			-e 's|%%BUILD_DEPENDS%%|'"$$(cd ${.CURDIR} && eval ${MAKE} \
+					$${__softMAKEFLAGS} pretty-print-build-depends-list)"'|' \
+			-e 's|%%RUN_DEPENDS%%|'"$$(cd ${.CURDIR} && eval ${MAKE} \
+					$${__softMAKEFLAGS} pretty-print-run-depends-list)"'|' \
+			-e 's|%%TOP%%|'"$$(${ECHO_CMD} ${CATEGORIES} | \
+							   ${SED} -e 's| .*||' -e 's|[^/]*|..|g')"'/..|' \
+		${TEMPLATES}/README.port >> ${.TARGET}
+
+# The following two targets require an up-to-date INDEX in ${PORTSDIR}
+
+_PRETTY_PRINT_DEPENDS_LIST=\
+	if [ ! -r ${INDEXDIR}/${INDEXFILE} ] ; then \
+		${ECHO_MSG} "${.TARGET} requires an INDEX file (${INDEXFILE}). Please run make index or make fetchindex."; \
+	else \
+		target=${.TARGET:C/pretty-print-(.*)-depends-list/\1/} ; \
+		if [ "$$target" = "build" ] ; then fldnum=8 ; else fldnum=9 ; fi ; \
+		${ECHO_MSG} -n 'This port requires package(s) "' ; \
+		${ECHO_MSG} -n `${AWK} -F\| "\\$$1 ~ /^${PKGNAME}/ {print \\$$$${fldnum};}" ${INDEXDIR}/${INDEXFILE}` ; \
+		${ECHO_MSG} "\" to $$target."; \
+	fi;
+
+
+.if !target(pretty-print-build-depends-list)
+pretty-print-build-depends-list:
+.if defined(EXTRACT_DEPENDS) || defined(PATCH_DEPENDS) || \
+	defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || \
+	defined(LIB_DEPENDS) || defined(DEPENDS)
+	@${_PRETTY_PRINT_DEPENDS_LIST}
+.endif
+.endif
+
+.if !target(pretty-print-run-depends-list)
+pretty-print-run-depends-list:
+.if defined(RUN_DEPENDS) || defined(LIB_DEPENDS) || \
+	defined(DEPENDS)
+	@${_PRETTY_PRINT_DEPENDS_LIST}
+.endif
+.endif
--- /dev/null
+++ Mk/mport.inc/commands.mk
@@ -0,0 +1,91 @@
+#-*- mode: Fundamental; tab-width: 4; -*-
+# ex:ts=4
+#
+# bsd.commands.mk - Common commands used within the ports infrastructure
+#
+# $FreeBSD: ports/Mk/bsd.commands.mk,v 1.1 2007/08/04 11:37:23 gabor Exp $
+# $MidnightBSD: mports/Mk/mport.inc/commands.mk,v 1.1 2008/05/16 19:08:42 ctriv Exp $
+#
+
+COMMANDS_Include_MAINTAINER=		ctriv at MidnightBSD.org
+
+.if !defined(_COMMANDSMKINCLUDED)
+
+_COMMANDSMKINCLUDED=     yes
+
+_MAKE_CMD=	/usr/bin/make
+
+AWK?=		/usr/bin/awk
+BASENAME?=	/usr/bin/basename
+BRANDELF?=	/usr/bin/brandelf
+BZCAT?=		/usr/bin/bzcat
+BZIP2_CMD?=	/usr/bin/bzip2
+CAT?=		/bin/cat
+CHGRP?=		/usr/bin/chgrp
+CHMOD?=		/bin/chmod
+CHOWN?=		/usr/sbin/chown
+CHROOT?=	/usr/sbin/chroot
+COMM?=		/usr/bin/comm
+CP?=		/bin/cp
+GCPIO?=		${LOCALBASE}/bin/gcpio
+CPIO?=		/usr/bin/cpio
+CUT?=		/usr/bin/cut
+DC?=		/usr/bin/dc
+DIALOG?=	/usr/bin/dialog
+DIFF?=		/usr/bin/diff
+DIRNAME?=	/usr/bin/dirname
+EGREP?=		/usr/bin/egrep
+EXPR?=		/bin/expr
+FALSE?=		false				# Shell builtin
+FILE?=		/usr/bin/file
+FIND?=		/usr/bin/find
+FMT?=		/usr/bin/fmt
+GREP?=		/usr/bin/grep
+GUNZIP_CMD?=	/usr/bin/gunzip -f
+GZCAT?=		/usr/bin/gzcat
+GZIP?=		-9
+GZIP_CMD?=	/usr/bin/gzip -nf ${GZIP}
+HEAD?=		/usr/bin/head
+ID?=		/usr/bin/id
+IDENT?=		/usr/bin/ident
+LDCONFIG?=	/sbin/ldconfig
+LN?=		/bin/ln
+LS?=		/bin/ls
+MKDIR?=		/bin/mkdir -p
+MKTEMP?=	/usr/bin/mktemp
+MV?=		/bin/mv
+OBJCOPY?=	/usr/bin/objcopy
+OBJDUMP?=	/usr/bin/objdump
+PASTE?=		/usr/bin/paste
+PAX?=		/bin/pax
+PRINTF?=	/usr/bin/printf
+REALPATH?=	/bin/realpath
+RM?=		/bin/rm
+RMDIR?=		/bin/rmdir
+SED?=		/usr/bin/sed
+SETENV?=	/usr/bin/env
+SH?=		/bin/sh
+SORT?=		/usr/bin/sort
+STRIP_CMD?=	/usr/bin/strip
+SU_CMD?=	/usr/bin/su root -c
+SUDO?=		/usr/bin/sudo
+SYSCTL?=	/sbin/sysctl
+TAIL?=		/usr/bin/tail
+TEST?=		test				# Shell builtin
+TR?=		LANG=C /usr/bin/tr
+TRUE?=		true				# Shell builtin
+UNAME?=		/usr/bin/uname
+UNZIP_CMD?=	${LOCALBASE}/bin/unzip
+WHICH?=		/usr/bin/which
+XARGS?=		/usr/bin/xargs
+YACC?=		/usr/bin/yacc
+
+# ECHO is defined in /usr/share/mk/sys.mk, which can either be "echo",
+# or "true" if the make flag -s is given.  Use ECHO_CMD where you mean
+# the echo command.
+ECHO_CMD?=	echo				# Shell builtin
+
+# Used to print all the '===>' style prompts - override this to turn them off.
+ECHO_MSG?=		${ECHO_CMD}
+
+.endif


More information about the Midnightbsd-cvs mailing list