docs/75636: [PATCH] Update the Porter's handbook - Java section
Herve Quiroz
hq at FreeBSD.org
Wed Dec 29 22:20:19 UTC 2004
>Number: 75636
>Category: docs
>Synopsis: [PATCH] Update the Porter's handbook - Java section
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-doc
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Wed Dec 29 22:20:19 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator: Herve Quiroz
>Release: FreeBSD 5.3-STABLE i386
>Organization:
>Environment:
System: FreeBSD 5.3-STABLE #1: Mon Dec 6 04:02:19 CET 2004 i386
>Description:
Document the latest features from bsd.java.mk and detail a new policy regarding
the 'java'category:
- USE_ANT
- HAVE_JIKES
- JAVALIBDIR
- New entries in SUB_LIST
- Additional notes regarding the 'java' category
- Improve the PLIST_FILES JAR file hint (use %%JAVAJARDIR%%)
NOTE: There are several statements such as:
"... (see <makevar>MAKEVAR</makevar>, documented <link>here</link>) ..."
Another approach would be to use:
"... (see <link><makevar>MAKEVAR</makevar></link>) ..."
But I will let that up to you.
NOTE2: I don't know where to document the JAVA_PREFERRED_PORT mechanism but I
doubt this is the right place. Probably on the FreeBSD Java project homepage,
if someone feels like updating it...
NOTE3: We should also consider adding a statement regarding the use of
javavmwrapper in application launcher shell scripts. I'm not quite sure about
this one though.
>How-To-Repeat:
>Fix:
Index: book.sgml
===================================================================
RCS file: /var/fcvs/doc/en_US.ISO8859-1/books/porters-handbook/book.sgml,v
retrieving revision 1.510
diff -u -r1.510 book.sgml
--- book.sgml 22 Dec 2004 23:51:15 -0000 1.510
+++ book.sgml 29 Dec 2004 21:56:53 -0000
@@ -1536,7 +1536,10 @@
<row>
<entry><filename>java</filename></entry>
<entry>Software related to the Java language.</entry>
- <entry></entry>
+ <entry><filename>java</filename> shall not be the only
+ category for a port. Porters are also encouraged not to
+ use <filename>java</filename> as the main category of a
+ port.</entry>
</row>
<row>
@@ -4297,7 +4300,10 @@
<command>jikes</command> (by setting <literal>'no'</literal>
or <literal>'yes'</literal>). In the later case, <filename
role="package">devel/jikes</filename> will be added to build
- dependencies of the port.</entry>
+ dependencies of the port. In any case that <command>jikes</command>
+ is actually used in place of <command>javac</command>, then the
+ <makevar>HAVE_JIKES</makevar> variable is defined by
+ <filename>bsd.java.mk</filename>.</entry>
</row>
</tbody>
</tgroup>
@@ -4435,6 +4441,11 @@
JDKs used
<filename>${JAVA_HOME}/lib/classes.zip</filename>.</entry>
</row>
+ <row>
+ <entry><makevar>HAVE_JIKES</makevar></entry>
+ <entry>Defined whenever <command>jikes</command> is used by
+ the port (see <makevar>USE_JIKES</makevar> above).</entry>
+ </row>
</tbody>
</tgroup>
</table>
@@ -4469,10 +4480,41 @@
Default:
<filename>${JAVASHAREDIR}/classes</filename>.</entry>
</row>
+ <row>
+ <entry><makevar>JAVALIBDIR</makevar></entry>
+ <entry>The directory where JAR files installed by other
+ ports are located. Default:
+ <filename>${LOCALBASE}/share/java/classes</filename>.</entry>
+ </row>
</tbody>
</tgroup>
</table>
+ <para>The related entries are defined in both
+ <makevar>PLIST_SUB</makevar> (documented
+ <link linkend="porting-plist">here</link>) and
+ <makevar>SUB_LIST</makevar>.</para>
+
+ </sect2>
+
+ <sect2 id="java-building-with-ant">
+ <title>Building with Ant</title>
+
+ <para>When the port is to be built using Apache Ant, it has to
+ define <makevar>USE_ANT</makevar>. Ant is thus considered to be
+ the sub-make command. When no <literal>do-build</literal> target
+ is defined by the port, a default one will be set that simply
+ runs Ant according to <makevar>MAKE_ENV</makevar>,
+ <makevar>MAKE_ARGS</makevar> and <makevar>ALL_TARGETS</makevar>.
+ This is similar to the <makevar>USE_GMAKE</makevar> mechanism,
+ which is documented <link linkend="makefile-build">here</link>.
+ </para>
+
+ <para>If <command>jikes</command> is used in place of
+ <command>javac</command> (see <makevar>USE_JIKES</makevar>
+ <link linkend="java-variables">above</link>), then Ant will
+ automatically use it to build the port.</para>
+
</sect2>
<sect2 id="java-best-practices">
@@ -4487,7 +4529,7 @@
statement (where <filename>myport.jar</filename> is the name
of the JAR file installed as part of the port):</para>
- <programlisting>PLIST_FILES+= ${JAVAJARDIR:S,^${PREFIX}/,,}/myport.jar</programlisting>
+ <programlisting>PLIST_FILES+= %%JAVAJARDIR%%/myport.jar</programlisting>
<para>When porting a Java application, the port usually installs
everything under a single directory (including its JAR
@@ -4548,6 +4590,10 @@
the issue you are trying to resolve is related to either a JDK
implementation or <filename>bsd.java.mk</filename>.</para>
+ <para>Similarly, there is a defined policy regarding the
+ <makevar>CATEGORIES</makevar> of a Java port, which is detailed
+ <link linkend="makefile-categories">here</link>.</para>
+
</sect2>
</sect1>
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-doc
mailing list