Index: en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml =================================================================== --- en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml +++ en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml @@ -1965,6 +1965,88 @@ ${WRKDIR}/foo-1.0.2. + + Fetching Multiple Files From GitHub + + The USE_GITHUB framework also + supports fetching multiple distribution files from + different places in GitHub. It works in a very similar + way than the . + + Multiple values are added to + GH_ACCOUNT, + GH_PROJECT, and + GH_TAGNAME, each different value is + assigned a tag. The main value can either have no tag, or + the :DEFAULT tag. A value can be + omitted if it is the same as the default as listed in + . + + For each tag, a + ${WRKSRC_tag} + helper variable is created, it contains the directory into + which the file has been extracted. The + ${WRKSRC_tag} + variables can be used to move directories around during + post-extract, or add to + CONFIGURE_ARGS, or whatever is needed + so that the software builds correctly. + + + Use of <varname>USE_GITHUB</varname> with Multiple + Distribution Files + + From time to time, there is a need to fetch more + than one distribution file. For example, when the + upstream git repository uses submodules. This can be + done easily using tags in the + GH_* + variables: + + PORTNAME= foo +PORTVERSION= 1.0.2 + +USE_GITHUB= yes +GH_ACCOUNT= bar:icons,contrib +GH_PROJECT= foo-icons:icons foo-contrib:contrib +GH_TAGNAME= 1.0:icons fa579bc:contrib + +CONFIGURE_ARGS= --with-contrib=${WRKSRC_contrib} + +post-extract: + @${MV} ${WRKSRC_icons} ${WRKSRC}/icons + + This will fetch three distribution files from + github, the default one comes from + foo/foo and is version + 1.0.2, the second one, tagged + icons, comes from + bar/foo-icons and is in version + 1.0, and the third one comes from + bar/foo-contrib and uses the + Git commit + fa579bc. The distribution files are + named foo-foo-1.0.2_GH0.tar.gz, + bar-foo-icons-1.0_GH0.tar.gz, and + bar-foo-contrib-fa579bc_GH0.tar.gz. + + All the distribution files extracted in + ${WRKDIR} in their respective + sub-directories. The default one is still extracted in + ${WRKSRC}, in this case, + ${WRKDIR}/foo-1.0.2. Each + additional distribution file in its + ${WRKSRC_tag}, + here, for the icons tag, it is called + ${WRKSRC_icons} and it contains + ${WRKDIR}/foo-icons-1.0, the one + with the contrib tag is called + ${WRKSRC_contrib} and contains + ${WRKDIR}/foo-contrib-fa579bc. + + @@ -2099,9 +2181,8 @@ - Multiple Distribution Files or Patches from Different - Sites and Subdirectories - (<literal>MASTER_SITES:n</literal>) + Multiple Distribution or Patches Files from Multiple + Locations (Consider this to be a somewhat advanced topic; those new to this document