Matthew Johnson wrote: > On Mon Apr 12 19:06, Niels Thykier wrote: >> p2_java_executables.patch rewords the part about executable jar files >> under the Java Programs section. It will allow Java Programs to install >> in accordance with the Debian Policy (and not just in /usr/bin). It also >> specifies where private jar files should be placed. >> > > You should mention a requirement for a Main-Class attribute if you are using > executable jars. > > Matt >
Hi I have reworded the p2 patch to include this. Thanks for the suggestion, ~Niels
Description: Relax the restriction on install location of Java Programs to allow any location allowed by the Debian Policy. . The rewording also removes binfmt_misc from the paragraph and specifies where privates jar files should be installed. Closes: #395372, #227594 --- policy.xml.orig 2010-04-12 17:56:40.916744857 +0200 +++ policy.xml 2010-04-14 23:02:18.075496660 +0200 @@ -13,6 +13,7 @@ <!ENTITY d-jdoc "<emphasis>default-jdk-doc</emphasis>"> <!ENTITY JVM "<acronym>JVM</acronym>"> <!ENTITY JIT "<acronym>JIT</acronym>"> +<!ENTITY debpol "http://www.debian.org/doc/debian-policy"> ]> <book> @@ -184,21 +185,33 @@ <title>Java programs</title> <para> - Programs &must; have executable(s) in - <filename>/usr/bin</filename> and be executable. They can be Java - classes (using binfmt_misc) or wrappers. In any case, they &must; run + Programs &must; have one or more executables in one or more of + the directories defined by <ulink url="&debpol;/ch-opersys.html#s9.1"> + 9.1</ulink> of the Debian Policy. These &must; either be a wrapper + script or a symlink to an executable jar. In any case, they &must; run without specific environment variables (see - <ulink url="http://www.debian.org/doc/debian-policy/ch-opersys.html#s10.9">Policy + <ulink url="&debpol;/ch-opersys.html#s10.9">Policy 10.9</ulink>), for instance CLASSPATH. They &must; respect the Policy rules for executables (for instance a manual page per executable, see - <ulink url="http://www.debian.org/doc/debian-policy/ch-docs.html#s13.1"> + <ulink url="&debpol;/ch-docs.html#s13.1"> Policy 13.1</ulink>). </para> + + <para> + If the package installs a jar (or a symlink to a jar) as an executable + the package &must; have an absolute dependency on jarwrapper or an + equivalent package, which allows jar files to be executed directly + from PATH like a normal program. The package &must; also ensure that + the correct class is used as main-class. As an example jarwrapper + uses the Main-Class attribute from the main part of the Manifest of the + jar file to determine this. + </para> + <para> - If they have their own auxiliary classes, they - &must; be in a jar file in <filename>/usr/share/java</filename>. The - name of the jar &should; follow the same naming conventions as for - libraries. + Additional classes in the package must be packaged in one or more JARs + which can be put into /usr/share/java (if they are intended to be used + by other programs) or into a private directory in + /usr/share/<package>. </para> <para> Programs &must; depend on the needed
diff -u policy.xml policy.xml --- policy.xml 2010-04-12 18:02:50.803500788 +0200 +++ policy.xml 2010-04-14 23:02:18.075496660 +0200 @@ -188,10 +188,7 @@ Programs &must; have one or more executables in one or more of the directories defined by <ulink url="&debpol;/ch-opersys.html#s9.1"> 9.1</ulink> of the Debian Policy. These &must; either be a wrapper - script or a symlink to an executable jar. In the latter case, the - package &must; have an absolute dependency on jarwrapper or an - equivalent package, which allows jar files to be executed directly - from PATH like a normal program. In any case, they &must; run + script or a symlink to an executable jar. In any case, they &must; run without specific environment variables (see <ulink url="&debpol;/ch-opersys.html#s10.9">Policy 10.9</ulink>), for instance CLASSPATH. They &must; respect the Policy @@ -199,6 +196,17 @@ <ulink url="&debpol;/ch-docs.html#s13.1"> Policy 13.1</ulink>). </para> + + <para> + If the package installs a jar (or a symlink to a jar) as an executable + the package &must; have an absolute dependency on jarwrapper or an + equivalent package, which allows jar files to be executed directly + from PATH like a normal program. The package &must; also ensure that + the correct class is used as main-class. As an example jarwrapper + uses the Main-Class attribute from the main part of the Manifest of the + jar file to determine this. + </para> + <para> Additional classes in the package must be packaged in one or more JARs which can be put into /usr/share/java (if they are intended to be used
signature.asc
Description: OpenPGP digital signature