Initial implementation of subpackages.
Based on previous mat's implementation: https://reviews.freebsd.org/D16457
To add subpackages to a port, define:
SUBPACKAGES= foo bar
and in the plist, prefix files to put in a subpackage with @@foo@@.
For each subpackage, some variables can be set, if needed.
- DESCR.<subpkg> defaults to the pkg-descr if pkg-descr.<subpkg> does not exist (with a warning)
- COMMENT.<subpkg> defaults to ${COMMENT} (subpkg: <subpkg>)
- All the PKGMESSAGE/PKGINSTALL/... variable have .<subpkg> version, pointing to pkg-message.<subpkg>/pkg-install.<subpkg> files.
- A few options helpers <opt>_SUBPACKAGES and <opt>_*_DEPENDS.<subpkg> can be used.
- PLIST_FILES.<subpkg> and PLIST_DIRS.subpkg were added too.
Subpackages can depend on each other, a new variable has been introduced, SELF_DEPENDS, and a special subpackage name has been introduced to refer to the main package. For example:
If the foo subpackage depends on the main subpackage:
SUBPACKAGES= foo SELF_DEPENDS.foo= main
If the main package depends on the tools subpackage:
SUBPACKAGE= tools SELF_DEPENDS= tools
An OPTIONcan define a SUBPACKAGEwith
<OPT>_SUBPACKAGES= subpkg
Licenses are currently propagated on every subpackage. Open to suggestions.