From 9c11ffbc86d565c5da6d76d4a9f63c44fecd7926 Mon Sep 17 00:00:00 2001 From: Mathieu Arnold Date: Fri, 4 Aug 2017 13:42:30 +0000 Subject: [PATCH] Fix the MASTERDIR/slave example with an actually existing port. PR: 212937 Reported by: zzdudcjfzz hotmail com Sponsored by: Absolight, The FreeBSD Foundation --- .../porters-handbook/makefiles/chapter.xml | 47 ++++++++++--------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml b/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml index c4b844dae6..d7da80cc3d 100644 --- a/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml +++ b/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml @@ -5467,48 +5467,53 @@ BAR_LIB_DEPENDS= libbar.so:foo/bar so the packages will have different names. This will be best demonstrated by an example. This is part - of japanese/xdvi300/Makefile; + of print/pkfonts300/Makefile; - PORTNAME= xdvi -DISTVERSION= 17 -PKGNAMEPREFIX= ja- -PKGNAMESUFFIX= ${RESOLUTION} + PORTNAME= pkfonts${RESOLUTION} +PORTVERSION= 1.0 +DISTFILES= pk${RESOLUTION}.tar.gz -# default -RESOLUTION?= 300 +PLIST= ${PKGDIR}/pkg-plist.${RESOLUTION} + +.if !defined(RESOLUTION) +RESOLUTION= 300 +.else .if ${RESOLUTION} != 118 && ${RESOLUTION} != 240 && \ - ${RESOLUTION} != 300 && ${RESOLUTION} != 400 -pre-everything:: + ${RESOLUTION} != 300 && ${RESOLUTION} != 360 && \ + ${RESOLUTION} != 400 && ${RESOLUTION} != 600 +.BEGIN: @${ECHO_MSG} "Error: invalid value for RESOLUTION: \"${RESOLUTION}\"" - @${ECHO_MSG} "Possible values are: 118, 240, 300 (default) and 400." + @${ECHO_MSG} "Possible values are: 118, 240, 300, 360, 400 and 600." @${FALSE} +.endif .endif - japanese/xdvi300 also has all + print/pkfonts300 also has all the regular patches, package files, etc. Running make there, it will take the default value for the resolution (300) and build the port normally. As for other resolutions, this is the entire - xdvi118/Makefile: + print/pkfonts360/Makefile: - RESOLUTION= 118 -MASTERDIR= ${.CURDIR}/../xdvi300 + RESOLUTION= 360 +MASTERDIR= ${.CURDIR}/../pkfonts300 -.include "${MASTERDIR}/Makefile" +.include "${MASTERDIR}/Makefile" - (xdvi240/Makefile and - xdvi400/Makefile are similar). + (print/pkfonts118/Makefile, + print/pkfonts600/Makefile, and all the + other are similar). MASTERDIR definition tells bsd.port.mk that the regular set of subdirectories like FILESDIR and SCRIPTDIR are to be found under - xdvi300. The - RESOLUTION=118 line will override the + pkfonts300. The + RESOLUTION=360 line will override the RESOLUTION=300 line in - xdvi300/Makefile and the port will be built - with resolution set to 118. + pkfonts300/Makefile and the port will be + built with resolution set to 360.