From: Ole Streicher <olebole@debian.org>
Date: Wed, 12 Apr 2017 16:44:48 +0200
Subject: Fix build.xml for use outside of starjava

---
 build.xml | 56 +++++++++++++++++++++++++-------------------------------
 1 file changed, 25 insertions(+), 31 deletions(-)

diff --git a/build.xml b/build.xml
index ace522d..6a581bb 100644
--- a/build.xml
+++ b/build.xml
@@ -32,12 +32,6 @@
  !-->
 
 <project name="Build file for CDF" default="build" basedir=".">
-
-  <!-- If either or both of these files exist then any properties
-   !   contained within them will override those defined here.  -->
-  <property file="${user.home}/.stardev.properties"/>
-  <property file=".properties"/>
-
   <!-- Properties will also be set for all environment variables
    !   (PATH becomes "env.PATH"), generally not a good
    !   idea as names are OS dependent -->
@@ -50,13 +44,13 @@
    !-->
 
   <!-- Directory for the Starlink installation (usually /star/java)-->
-  <property name="star.dir" value="${basedir}/../../"/>
+  <property name="star.dir" value="/usr/share/java"/>
 
   <!-- Directory to install into (install target, usually /star/java)-->
   <property name="star.install" value="${star.dir}"/>
 
   <!-- Directory that contains the Starlink jar tree -->
-  <property name="star.jar.dir" value="${star.dir}/lib"/>
+  <property name="star.jar.dir" value="${star.dir}"/>
 
   <!-- Directory that contains the locally built sources (usually
    !   /star/java/source for full distribution) -->
@@ -77,8 +71,8 @@
    !-->
 
   <!-- Define the package name and current versions -->
-  <property name="Name" value="CDF"/>
-  <property name="name" value="cdf"/>
+  <property name="Name" value="Starjava CDF"/>
+  <property name="name" value="starlink-cdf"/>
   <property name="version" value="1.0"/>
 
   <!-- The Java package name -->
@@ -114,6 +108,7 @@
   <!-- Directory containing any third-party jars that should be
    !   distributed (normally these would belong in a proper package)-->
   <property name="src.jars.dir" value="${src.dir}/lib"/>
+  <mkdir dir="${src.jars.dir}"/>
 
   <!-- Directory containing any JNI source code -->
   <property name="src.jni.dir" value="${src.dir}/jni"/>
@@ -196,21 +191,23 @@
    !   1.4 is no longer used the extclasspath type can be replaced by a simple
    !   path.
    !-->
-  <extclasspath id="installed.classpath">
-
-    <!-- Table -->
-    <pathelement location="${star.jar.dir}/table/table.jar"/>
+  <path id="installed.classpath">
+    <pathelement location="${star.jar.dir}/starlink-table.jar"/>
+    <pathelement location="${star.jar.dir}/jcdf.jar"/>
+    <pathelement location="${star.jar.dir}/junit.jar"/>
+  </path>
 
-  </extclasspath>
+  <path id="jar.classpath">
+    <pathelement location="${dist.lib.pkg}/starlink-table.jar"/>
+    <pathelement location="${dist.lib.pkg}/jcdf.jar"/>
+  </path>
 
   <!-- Local build system jar files.
    !
    !   Name all the jar files of other packages that we depend on, which have
    !   not been installed (should be same packages as in installed.classpath).
    !-->
-  <extclasspath id="built.jarpath">
-    <pathelement location="${star.build.dir}/table/lib/table/table.jar"/>
-  </extclasspath>
+  <path id="built.jarpath"/>
 
   <!-- Find all local third party jars files.
    !
@@ -303,6 +300,7 @@
     <pathelement location="${tests.dir}"/>
     <pathelement location="${tests.etc.dir}"/>
     <path refid="classpath"/>
+    <pathelement location="${star.jar.dir}/${name}.jar"/>
   </path>
 
   <!-- Turn this path into a string which is passed to the tests -->
@@ -392,7 +390,8 @@
            destdir="${build.classes}"
            debug="${debug}"
            deprecation="${deprecation}"
-           source="${source.version}"
+           encoding="cp1252"
+           includeantruntime="false"
            optimize="${optimize}">
       <compilerarg value="-Xlint:all,-path,-serial"/>
 
@@ -443,6 +442,10 @@
           description="-> creates the package jar file(s)">
 
     <mkdir dir="${dist.lib.pkg}"/>
+    <manifestclasspath property="jar.class.path"
+                       jarfile="${dist.lib.pkg}/${name}.jar">
+      <classpath refid="jar.classpath" />
+    </manifestclasspath>
     <jar destfile="${dist.lib.pkg}/${name}.jar"
          basedir="${build.classes}">
       <manifest>
@@ -451,16 +454,6 @@
       </manifest>
     </jar>
 
-    <!-- Sign all jar files -->
-    <antcall target="signjars"/>
-  </target>
-     
-  <target name="signjars" if="sign.jars">
-    <signjar jar="${dist.lib.pkg}/${name}.jar"
-             alias="${webstart.alias}"
-             keystore="${webstart.keystore}"
-             keypass="${webstart.keypass}"
-             storepass="${webstart.storepass}"/>
   </target>
 
   <!--
@@ -889,7 +882,7 @@
              windowtitle="${Name} API"
              doctitle="${Name}"
              defaultexcludes="yes"
-             source="${source.version}"
+             encoding="cp1252"
              classpathref="classpath">
       <arg value="-Xdoclint:all,-missing"/>
 
@@ -971,7 +964,8 @@
     <javac srcdir="${tests.dir}"
            destdir="${build.tests}"
            debug="${debug}"
-           source="${source.version}"
+           encoding="cp1252"
+           includeantruntime="false"
            deprecation="${deprecation}" >
 
       <classpath refid="tests-classpath"/>
