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 @@ -25,7 +25,7 @@ The Original Source Does it live in DISTDIR as a standard - gzipped tarball named something like + compressed tarball named something like foozolix-1.2.tar.gz? If so, go on to the next step. If not, the distribution file format might require overriding one or more of @@ -261,7 +261,7 @@ collection: PORTNAME= gtkmumble - PORTVERSION= 0.10 +PORTVERSION= 0.10 PKGNAME becomes gtkmumble-0.10. @@ -271,8 +271,8 @@ accordingly. PORTNAME= gtkmumble - PORTVERSION= 0.10 - PORTREVISION= 1 +PORTVERSION= 0.10 +PORTREVISION= 1 PKGNAME becomes gtkmumble-0.10_1 @@ -287,12 +287,12 @@ PORTEPOCH must be bumped to manually force the new package to be detected as newer. Since it is a new vendor release of - the code, PORTREVISION is reset to 0 (or - removed from the Makefile). + the code, PORTREVISION is reset to 0 + (removed from the Makefile). PORTNAME= gtkmumble - PORTVERSION= 0.2 - PORTEPOCH= 1 +PORTVERSION= 0.2 +PORTEPOCH= 1 PKGNAME becomes gtkmumble-0.2,1 @@ -302,8 +302,8 @@ variables are now: PORTNAME= gtkmumble - PORTVERSION= 0.3 - PORTEPOCH= 1 +PORTVERSION= 0.3 +PORTEPOCH= 1 PKGNAME becomes gtkmumble-0.3,1 @@ -1390,9 +1390,8 @@ we can discuss it before we import it. As a committer, send a note to the &a.ports; so we can discuss it first. Too often, new ports are imported to the wrong - category only to be moved right away. This causes unnecessary - and undesirable bloat in the master source repository. - + category only to be moved right away. + Proposing a New Category @@ -1627,10 +1626,7 @@ It is recommended that multiple sites are included on this list, preferably from different continents. This will - safeguard against wide-area network problems. We are even - planning to add support for automatically determining the - closest master site and fetching from there; having multiple - sites will go a long way towards helping this effort. + safeguard against wide-area network problems. If the original tarball is part of one of the popular archives such as SourceForge, GNU, or Perl CPAN, it may be @@ -1646,7 +1642,7 @@ really is no reason to do so: MASTER_SITES= ${MASTER_SITE_GNU} - MASTER_SITE_SUBDIR= make +MASTER_SITE_SUBDIR= make These values and variables are defined in /usr/ports/Mk/bsd.sites.mk. There are @@ -1668,7 +1664,7 @@ This can also be written as MASTER_SITES= SF - MASTER_SITE_SUBDIR= stardict/WyabdcRealPeopleTTS/${PORTVERSION} +MASTER_SITE_SUBDIR= stardict/WyabdcRealPeopleTTS/${PORTVERSION} Popular Magic <varname>MASTER_SITES</varname> @@ -1849,11 +1845,11 @@ this (slightly stripped for the example):</para> <programlisting>PORTNAME= pkg - PORTVERSION= 1.2.7 +PORTVERSION= 1.2.7 - USE_GITHUB= yes - GH_ACCOUNT= freebsd - GH_COMMIT= f53e577</programlisting> +USE_GITHUB= yes +GH_ACCOUNT= freebsd +GH_COMMIT= f53e577</programlisting> <para>It will automatically have <varname>MASTER_SITES</varname> set to <literal>GH @@ -1873,13 +1869,13 @@ this (slightly stripped for the example):</para> <programlisting>PORTNAME= pkg-devel - PORTVERSION= 1.3.0.a.20140411 +PORTVERSION= 1.3.0.a.20140411 - USE_GITHUB= yes - GH_ACCOUNT= freebsd - GH_PROJECT= pkg - GH_TAGNAME= ${GH_COMMIT} - GH_COMMIT= 6dbb17b</programlisting> +USE_GITHUB= yes +GH_ACCOUNT= freebsd +GH_PROJECT= pkg +GH_TAGNAME= ${GH_COMMIT} +GH_COMMIT= 6dbb17b</programlisting> <para>It will automatically have <varname>MASTER_SITES</varname> set to <literal>GH @@ -1902,7 +1898,7 @@ <filename>foo.tar.gz</filename>, write:</para> <programlisting>DISTNAME= foo - EXTRACT_SUFX= .tar.gzip</programlisting> +EXTRACT_SUFX= .tar.gzip</programlisting> <para>The <literal>USES=tar[:<replaceable>xxx</replaceable>]</literal>, @@ -1949,7 +1945,7 @@ <varname>EXTRACT_ONLY</varname>.</para> <programlisting>DISTFILES= source.tar.gz manual.html - EXTRACT_ONLY= source.tar.gz</programlisting> +EXTRACT_ONLY= source.tar.gz</programlisting> <para>When none of the <varname>DISTFILES</varname> need to be uncompressed, set <varname>EXTRACT_ONLY</varname> to the empty @@ -1981,7 +1977,7 @@ <filename>.bz2</filename> or <filename>.xz</filename>.</para> <para>If the patch is distributed with some other files, such as - documentation, in a <command>gzip</command>ped tarball, using + documentation, in a compressed tarball, using <varname>PATCHFILES</varname> is not possible. If that is the case, add the name and the location of the patch tarball to <varname>DISTFILES</varname> and @@ -2010,9 +2006,8 @@ <note> <para>The tarball will have been extracted alongside the regular source by then, so there is no need to explicitly - extract it if it is a regular <command>gzip</command>ped or - <command>compress</command>ed tarball. Take extra care not - to overwrite something that already exists in that + extract it if it is a regular compressed tarball. Take extra + care not to overwrite something that already exists in that directory if extracting it manually. Also, do not forget to add a command to remove the copied patch in the <buildtarget>pre-clean</buildtarget> target.</para> @@ -2113,9 +2108,9 @@ with One File Per SiteMASTER_SITES= ftp://ftp.example1.com/:source1 \ - ftp://ftp.example2.com/:source2 - DISTFILES= source1.tar.gz:source1 \ - source2.tar.gz:source2 + ftp://ftp.example2.com/:source2 +DISTFILES= source1.tar.gz:source1 \ + source2.tar.gz:source2Multiple distribution files can have the same tag. @@ -2134,10 +2129,10 @@ with More Than One File Per Site MASTER_SITES= ftp://ftp.example1.com/:source1 \ - ftp://ftp.example2.com/:source2 - DISTFILES= source1.tar.gz:source1 \ - source2.tar.gz:source2 \ - source3.tar.gz:source2 + ftp://ftp.example2.com/:source2 +DISTFILES= source1.tar.gz:source1 \ + source2.tar.gz:source2 \ + source3.tar.gz:source2 @@ -2319,10 +2314,10 @@ http://site7/:DEFAULT,group6 \ http://site8/%SUBDIR%/:group6,group7 \ http://site9/:group8 - DISTFILES= file1 file2:DEFAULT file3:group3 \ +DISTFILES= file1 file2:DEFAULT file3:group3 \ file4:group4,group5,group6 file5:grouping \ file6:group7 - MASTER_SITE_SUBDIR= directory-trial:1 directory-n/:groupn \ +MASTER_SITE_SUBDIR= directory-trial:1 directory-n/:groupn \ directory-one/:group6,DEFAULT \ directory @@ -2511,7 +2506,7 @@ MASTER_SITE_SOURCEFORGE MASTER_SITES= http://site1/ ${MASTER_SITE_SOURCEFORGE:S/$/:sourceforge,TEST/} - DISTFILES= something.tar.gz:sourceforge +DISTFILES= something.tar.gz:sourceforge something.tar.gz will be @@ -2538,7 +2533,7 @@ PATCH_SITES PATCH_SITES= http://site1/ http://site2/:test - PATCHFILES= patch1:test +PATCHFILES= patch1:test @@ -2684,7 +2679,7 @@ It will also look at the subdirectory with the same name on the backup master site at - ftp.FreeBSD.org. (Setting + http://distcache.FreeBSD.org. (Setting DISTDIR explicitly in Makefile will not accomplish this, so please use DIST_SUBDIR.) @@ -2716,9 +2711,9 @@ ALWAYS_KEEP_DISTFILES .if defined(PACKAGE_BUILDING) - DISTFILES+= foo.tar.gz - ALWAYS_KEEP_DISTFILES= yes - .endif +DISTFILES+= foo.tar.gz +ALWAYS_KEEP_DISTFILES= yes +.endif When adding extra files to DISTFILES, @@ -3331,9 +3326,9 @@ .include <bsd.port.pre.mk> - .if exists(${LOCALBASE}/bin/foo) - LIB_DEPENDS= libbar.so:${PORTSDIR}/foo/bar - .endif +.if exists(${LOCALBASE}/bin/foo) +LIB_DEPENDS= libbar.so:${PORTSDIR}/foo/bar +.endif The problem with trying to automatically add dependencies @@ -3350,9 +3345,9 @@ Correct Declaration of an Optional Dependency OPTIONS_DEFINE= BAR - BAR_DESC= Calling cellphones via bar +BAR_DESC= Calling cellphones via bar - BAR_LIB_DEPENDS= libbar.so:${PORTSDIR}/foo/bar +BAR_LIB_DEPENDS= libbar.so:${PORTSDIR}/foo/bar Testing option variables is the correct method. It will @@ -3420,18 +3415,18 @@ of japanese/xdvi300/Makefile; PORTNAME= xdvi - PORTVERSION= 17 - PKGNAMEPREFIX= ja- - PKGNAMESUFFIX= ${RESOLUTION} - : - # default - RESOLUTION?= 300 - .if ${RESOLUTION} != 118 && ${RESOLUTION} != 240 && \ - ${RESOLUTION} != 300 && ${RESOLUTION} != 400 - @${ECHO_MSG} "Error: invalid value for RESOLUTION: \"${RESOLUTION}\"" - @${ECHO_MSG} "Possible values are: 118, 240, 300 (default) and 400." - @${FALSE} - .endif +PORTVERSION= 17 +PKGNAMEPREFIX= ja- +PKGNAMESUFFIX= ${RESOLUTION} +[...] +# default +RESOLUTION?= 300 +.if ${RESOLUTION} != 118 && ${RESOLUTION} != 240 && \ + ${RESOLUTION} != 300 && ${RESOLUTION} != 400 + @${ECHO_MSG} "Error: invalid value for RESOLUTION: \"${RESOLUTION}\"" + @${ECHO_MSG} "Possible values are: 118, 240, 300 (default) and 400." + @${FALSE} +.endif japanese/xdvi300 also has all the regular patches, package files, etc. Running @@ -3443,9 +3438,9 @@ xdvi118/Makefile: RESOLUTION= 118 - MASTERDIR= ${.CURDIR}/../xdvi300 +MASTERDIR= ${.CURDIR}/../xdvi300 - .include "${MASTERDIR}/Makefile" +.include "${MASTERDIR}/Makefile" (xdvi240/Makefile and xdvi400/Makefile are similar). @@ -3560,11 +3555,11 @@ described (optional, but strongly recommended): OPT1_DESC= Describe OPT1 - OPT2_DESC= Describe OPT2 - OPT3_DESC= Describe OPT3 - OPT4_DESC= Describe OPT4 - OPT5_DESC= Describe OPT5 - OPT6_DESC= Describe OPT6 +OPT2_DESC= Describe OPT2 +OPT3_DESC= Describe OPT3 +OPT4_DESC= Describe OPT4 +OPT5_DESC= Describe OPT5 +OPT6_DESC= Describe OPT6 ports/Mk/bsd.options.desc.mk has descriptions for many common OPTIONS. @@ -3595,7 +3590,7 @@ allowed: OPTIONS_SINGLE= SG1 - OPTIONS_SINGLE_SG1= OPT3 OPT4 +OPTIONS_SINGLE_SG1= OPT3 OPT4 There must be one of each @@ -4435,10 +4430,13 @@ targets. Set ownership directly in pkg-plist with the corresponding entries, such as + @(owner, + group, + mode) or @owner owner and @group group. - These operators work until being overridden, or until the end - of pkg-plist, so do not forget to reset + The latter operators work until being overridden, or until the + end of pkg-plist, so do not forget to reset them after they are no longer needed. The default ownership is root:wheel. @@ -4653,10 +4651,8 @@ additional documentation installed in DOCSDIR. It does not apply to standard man pages and info pages. Things installed in - DATADIR and EXAMPLESDIR are controlled by - DATA and EXAMPLES - options, respectively. + EXAMPLES option. These variables are exported to