Index: head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml =================================================================== --- head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml +++ head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml @@ -1932,89 +1932,89 @@ - - <varname>USE_GITHUB</varname> + + <varname>USE_GITHUB</varname> - If the distribution file comes from a specific commit or - tag on GitHub - for which there is no officially released file, there is an - easy way to set the right DISTNAME and - MASTER_SITES automatically. These - variables are available: + If the distribution file comes from a specific commit or + tag on GitHub + for which there is no officially released file, there is an + easy way to set the right DISTNAME and + MASTER_SITES automatically. These + variables are available: - - <varname>USE_GITHUB</varname> Description +
+ <varname>USE_GITHUB</varname> Description - - - - Variable - Description - Default - - + + + + Variable + Description + Default + + - - - GH_ACCOUNT - Account name of the GitHub user hosting the - project - ${PORTNAME} - + + + GH_ACCOUNT + Account name of the GitHub user hosting the + project + ${PORTNAME} + - - GH_PROJECT - Name of the project on GitHub - ${PORTNAME} - + + GH_PROJECT + Name of the project on GitHub + ${PORTNAME} + - - GH_TAGNAME - Name of the tag to download (2.0.1, hash, ...) - Using the name of a branch here is incorrect. It is - also possible to use the hash of a commit id to do a - snapshot. - ${DISTVERSIONPREFIX}${DISTVERSION}${DISTVERSIONSUFFIX} - - - -
+ + GH_TAGNAME + Name of the tag to download (2.0.1, hash, ...) + Using the name of a branch here is incorrect. It is + also possible to use the hash of a commit id to do a + snapshot. + ${DISTVERSIONPREFIX}${DISTVERSION}${DISTVERSIONSUFFIX} + + + + - - Simple Use of <varname>USE_GITHUB</varname> + + Simple Use of <varname>USE_GITHUB</varname> - While trying to make a port for version - 1.2.7 of pkg - from the &os; user on github, at , The - Makefile would end up looking like - this (slightly stripped for the example): + While trying to make a port for version + 1.2.7 of pkg + from the &os; user on github, at , The + Makefile would end up looking like + this (slightly stripped for the example): - PORTNAME= pkg + PORTNAME= pkg PORTVERSION= 1.2.7 USE_GITHUB= yes GH_ACCOUNT= freebsd - It will automatically have - MASTER_SITES set to GH - GHC and WRKSRC to - ${WRKDIR}/pkg-1.2.7. - + It will automatically have + MASTER_SITES set to GH + GHC and WRKSRC to + ${WRKDIR}/pkg-1.2.7. + - - More Complete Use of - <varname>USE_GITHUB</varname> - - While trying to make a port for the bleeding edge - version of pkg from the &os; - user on github, at , the - Makefile ends up looking like - this (slightly stripped for the example): + + More Complete Use of + <varname>USE_GITHUB</varname> + + While trying to make a port for the bleeding edge + version of pkg from the &os; + user on github, at , the + Makefile ends up looking like + this (slightly stripped for the example): - PORTNAME= pkg-devel + PORTNAME= pkg-devel PORTVERSION= 1.3.0.a.20140411 USE_GITHUB= yes @@ -2022,77 +2022,77 @@ GH_PROJECT= pkg GH_TAGNAME= 6dbb17b - It will automatically have - MASTER_SITES set to GH - GHC and WRKSRC to - ${WRKDIR}/pkg-6dbb17b. - + It will automatically have + MASTER_SITES set to GH + GHC and WRKSRC to + ${WRKDIR}/pkg-6dbb17b. + - - Use of <varname>USE_GITHUB</varname> with - <varname>DISTVERSIONPREFIX</varname> - - From time to time, GH_TAGNAME is a - slight variation from DISTVERSION. - For example, if the version is 1.0.2, - the tag is v1.0.2. In those cases, it - is possible to use DISTVERSIONPREFIX or - DISTVERSIONSUFFIX: + + Use of <varname>USE_GITHUB</varname> with + <varname>DISTVERSIONPREFIX</varname> + + From time to time, GH_TAGNAME is a + slight variation from DISTVERSION. + For example, if the version is 1.0.2, + the tag is v1.0.2. In those cases, it + is possible to use DISTVERSIONPREFIX or + DISTVERSIONSUFFIX: - PORTNAME= foo + PORTNAME= foo PORTVERSION= 1.0.2 DISTVERSIONPREFIX= v USE_GITHUB= yes - It will automatically set - GH_TAGNAME to - v1.0.2, while WRKSRC - will be kept to - ${WRKDIR}/foo-1.0.2. - + It will automatically set + GH_TAGNAME to + v1.0.2, while WRKSRC + will be kept to + ${WRKDIR}/foo-1.0.2. + + + + Fetching Multiple Files From GitHub - - Fetching Multiple Files From GitHub + The USE_GITHUB framework also + supports fetching multiple distribution files from + different places in GitHub. It works in a way very + similar to . + + 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 + . - The USE_GITHUB framework also - supports fetching multiple distribution files from - different places in GitHub. It works in a way very - similar to . - - 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, containing 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: + For each tag, a + ${WRKSRC_tag} + helper variable is created, containing 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 + PORTNAME= foo PORTVERSION= 1.0.2 USE_GITHUB= yes @@ -2103,36 +2103,36 @@ CONFIGURE_ARGS= --with-contrib=${WRKSRC_contrib} post-extract: - @${MV} ${WRKSRC_icons} ${WRKSRC}/icons + @${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. 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 are extracted in - ${WRKDIR} in their respective - subdirectories. The default file is still extracted in - ${WRKSRC}, in this case, - ${WRKDIR}/foo-1.0.2. Each - additional distribution file is extracted in - ${WRKSRC_tag}. - Here, for the icons tag, it is called - ${WRKSRC_icons} and it contains - ${WRKDIR}/foo-icons-1.0. The file - with the contrib tag is called - ${WRKSRC_contrib} and contains - ${WRKDIR}/foo-contrib-fa579bc. - + 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. 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 are extracted in + ${WRKDIR} in their respective + subdirectories. The default file is still extracted in + ${WRKSRC}, in this case, + ${WRKDIR}/foo-1.0.2. Each + additional distribution file is extracted in + ${WRKSRC_tag}. + Here, for the icons tag, it is called + ${WRKSRC_icons} and it contains + ${WRKDIR}/foo-icons-1.0. The file + with the contrib tag is called + ${WRKSRC_contrib} and contains + ${WRKDIR}/foo-contrib-fa579bc. +
@@ -2924,8 +2924,8 @@ ${PKGNAMEPREFIX}${PORTNAME} are fine). This will change DISTDIR from the default /usr/ports/distfiles to - /usr/ports/distfiles/${DIST_SUBDIR}, and in - effect puts everything that is required for the port into + /usr/ports/distfiles/${DIST_SUBDIR}, and + in effect puts everything that is required for the port into that subdirectory. It will also look at the subdirectory with the same name @@ -4570,7 +4570,7 @@ Some variables are not in this list, in particular PKGNAMEPREFIX and - PKGNAMESUFFIX. This is intentional. A + PKGNAMESUFFIX. This is intentional. A port must not change its name when its option set changes. @@ -4785,8 +4785,9 @@ pkg-plist with the corresponding entries, such as @(owner,group,), - @owner owner, and - @group group. + @owner owner, + and @group + group. These operators work until overridden, or until the end of pkg-plist, so do not forget to reset them after they are no longer needed. The default ownership