This is one case where we have to special-case -main, as it's usually the package with the "simple" name.
but as you guessed, it seems it might set the FULLPKGNAME to the right value without needing to do a thing in many cases. Index: bsd.port.mk =================================================================== RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v retrieving revision 1.1561 diff -u -p -r1.1561 bsd.port.mk --- bsd.port.mk 21 Nov 2021 13:55:10 -0000 1.1561 +++ bsd.port.mk 21 Nov 2021 14:06:10 -0000 @@ -635,6 +635,14 @@ FULLPKGNAME- = ${FULLPKGNAME} PKGSTEM ?= ${FULLPKGNAME:C/-[0-9].*//} PKGSTEM- = ${PKGSTEM} .else +# parse PKGNAME as _STEM/_VERSION, just in case +_STEM = ${PKGNAME:C/-[0-9].*//} +. for _s in ${_STEM} +_VERSION = ${PKGNAME:S/^${_s}-//} +. endfor +.if ${MULTI_PACKAGES:M-main} +FULLPKGNAME-main ?= ${FULLPKGNAME} +.endif . for _s in ${MULTI_PACKAGES} . if defined(FULLPKGNAME${_s}) . if !defined(FULLPKGPATH${_s}) && "${FLAVORS}" != " ${PSEUDO_FLAVORS}" @@ -644,7 +652,7 @@ ERRORS += "Warning: FULLPKGNAME${_s} def . if defined(PKGNAME${_s}) FULLPKGNAME${_s} = ${PKGNAME${_s}}${FLAVOR_EXT} . else -ERRORS += "Fatal: FULLPKGNAME${_s} is not defined" +FULLPKGNAME${_s} = ${_STEM}${_s}-${_VERSION}${FLAVOR_EXT} . endif . endif # XXX see comments above for !MULTI_PACKAGES case