svn commit: r50673 - head/en_US.ISO8859-1/books/porters-handbook/makefiles

Mathieu Arnold mat at FreeBSD.org
Mon Aug 14 14:59:21 UTC 2017


Author: mat
Date: Mon Aug 14 14:59:20 2017
New Revision: 50673
URL: https://svnweb.freebsd.org/changeset/doc/50673

Log:
  Add another example about GitHub projects with no versions.
  
  Sponsored by:	Absolight

Modified:
  head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml

Modified: head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml
==============================================================================
--- head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml	Mon Aug 14 14:59:17 2017	(r50672)
+++ head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml	Mon Aug 14 14:59:20 2017	(r50673)
@@ -2516,6 +2516,39 @@ USE_GITHUB=	yes</programlisting>
 	  <varname>${WRKDIR}/foo-1.0.2</varname>.</para>
       </example>
 
+      <example xml:id="makefile-master_sites-github-ex4">
+	<title>Using <varname>USE_GITHUB</varname> When Upstream Does
+	  Not Use Versions</title>
+
+	<para>If there never was a version upstream, do not invent one
+	  like <literal>0.1</literal> or <literal>1.0</literal>.
+	  Create the port with a <varname>DISTVERSION</varname> of
+	  <literal>g<replaceable>YYYY</replaceable><replaceable>MM</replaceable><replaceable>DD</replaceable></literal>,
+	  where <literal>g</literal> is for
+	  <application>Git</application>, and
+	  <literal><replaceable>YYYY</replaceable><replaceable>MM</replaceable><replaceable>DD</replaceable></literal>
+	  represents the date the commit referenced in
+	  <varname>GH_TAGNAME</varname>.</para>
+
+	<programlisting>PORTNAME=	bar
+DISTVERSION=	g20140411
+
+USE_GITHUB=	yes
+GH_TAGNAME=	c472d66b</programlisting>
+
+	<para>This creates a versioning scheme that increases over
+	  time, and that is still before version <literal>0</literal>
+	  (see <xref linkend="makefile-versions-ex-pkg-version"/> for
+	  details on &man.pkg-version.8;):</para>
+
+	<screen>&prompt.user; <userinput>pkg version -t g20140411 0</userinput>
+<</screen>
+
+	<para>Which means using <varname>PORTEPOCH</varname> will not
+	  be needed in case upstream decides to cut versions in the
+	  future.</para>
+      </example>
+
       <sect3 xml:id="makefile-master_sites-github-multiple">
 	<title>Fetching Multiple Files from GitHub</title>
 


More information about the svn-doc-all mailing list