Commit 03858373 authored by Ole Streicher's avatar Ole Streicher

Import Debian changes 0.1+2016.09.08-1

starjava-fits (0.1+2016.09.08-1) UNRELEASED; urgency=low

  * Initial release. (Closes: #855790)
parent 449f3ccb
starjava-fits (0.1+2016.09.08-1) UNRELEASED; urgency=low
* Initial release. (Closes: #855790)
-- Ole Streicher <olebole@debian.org> Wed, 14 Dec 2016 13:23:38 +0100
9
\ No newline at end of file
Source: starjava-fits
Section: java
Priority: optional
Maintainer: Debian Astro Team <debian-astro-maintainers@lists.alioth.debian.org>
Uploaders: Ole Streicher <olebole@debian.org>
Build-Depends: ant, debhelper (>= 9), dh-exec, javahelper (>= 0.40)
Build-Depends-Indep: ant-optional,
default-jdk,
default-jdk-doc,
junit,
libfits-java,
starlink-array-java,
starlink-table-java,
starlink-util-java
Standards-Version: 3.9.8
Homepage: https://github.com/Starlink/starjava/tree/master/fits
Vcs-Git: https://anonscm.debian.org/cgit/debian-astro/packages/starjava-fits.git
Vcs-Browser: https://anonscm.debian.org/cgit/debian-astro/packages/starjava-fits.git
Package: starlink-fits-java
Architecture: all
Depends: ${java:Depends}, ${misc:Depends}
Description: Classes for general FITS handling
Classes for general FITS handling, including NDX, NDArray and
StarTable implementations.
.
Some of these classes use the nom.tam.fits package (libfits-java) for
low-level FITS access, though several of them do most of the handling
in customised ways themselves for efficiency reasons.
Package: starlink-fits-java-doc
Section: doc
Architecture: all
Depends: ${java:Depends}, ${misc:Depends}
Recommends: ${java:Recommends}
Description: Classes for general FITS handling (javadoc)
Classes for general FITS handling, including NDX, NDArray and
StarTable implementations.
.
Some of these classes use the nom.tam.fits package (libfits-java) for
low-level FITS access, though several of them do most of the handling
in customised ways themselves for efficiency reasons.
.
This package contains the JavaDoc documentation of the package.
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Starjava FITS
Upstream-Contact: Peter W. Draper <p.w.draper@durham.ac.uk>
Source: https://github.com/Starlink/starjava/tree/master/fits
Files: *
Copyright: 2005-2016 Central Laboratory of the Research Councils
1997-1999 Thomas McGlynn
2002 Sun Microsystems, Inc
2017 Ole Streicher <olebole@debian.org> (Debian files)
License: LGPL-3+
On Debian systems, the full text of the GNU Lesser General Public
License version 3 can be found in the file
`/usr/share/common-licenses/LGPL-3'.
Comment: The upstream repository itself does not contain a copyright
notice. The license information is taken from private communication
with Mark Taylor (one of the developers), and also documented at
http://www.star.bris.ac.uk/~mbt/stilts/LICENSE.txt
.
The file src/main/uk/ac/starlink/fits/AbstractArrayDataIO.java seems
however to contain a non-free version of writeUTF() from Sun.
\ No newline at end of file
From: Ole Streicher <olebole@debian.org>
Date: Thu, 16 Feb 2017 16:03:03 +0100
Subject: Fix build.xml for use outside of starjava
---
build.xml | 72 +++++++++++++++++++++++++--------------------------------------
1 file changed, 28 insertions(+), 44 deletions(-)
diff --git a/build.xml b/build.xml
index 00c4e1f..4d2c5a3 100644
--- a/build.xml
+++ b/build.xml
@@ -37,12 +37,6 @@
!-->
<project name="Build file for FITS" 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 -->
@@ -55,13 +49,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) -->
@@ -85,8 +79,8 @@
!-->
<!-- Define the package name and current versions -->
- <property name="Name" value="FITS"/>
- <property name="name" value="fits"/>
+ <property name="Name" value="Starjava FITS"/>
+ <property name="name" value="starlink-fits"/>
<property name="version" value="0.1"/>
<!-- The Java package name -->
@@ -193,25 +187,24 @@
! class files in preference to installed ones (an extra user-define
! defined CLASSPATH can also be used as needed).
!-->
- <extclasspath id="installed.classpath">
-
- <!-- JUnit -->
- <pathelement location="${star.jar.dir}/junit/junit.jar"/>
-
- <!-- TAMFITS -->
- <pathelement location="${star.jar.dir}/tamfits/tamfits.jar"/>
-
- <!-- Array -->
- <pathelement location="${star.jar.dir}/array/array.jar"/>
+ <path id="installed.classpath">
- <!-- Table -->
- <pathelement location="${star.jar.dir}/table/table.jar"/>
+ <pathelement location="${star.jar.dir}/junit.jar"/>
+ <pathelement location="${star.jar.dir}/fits.jar"/>
+ <pathelement location="${star.jar.dir}/starlink-array.jar"/>
+ <pathelement location="${star.jar.dir}/starlink-table.jar"/>
+ <pathelement location="${star.jar.dir}/starlink-util.jar"/>
- <!-- Util -->
- <pathelement location="${star.jar.dir}/util/util.jar"/>
+ </path>
- </extclasspath>
+ <path id="jar.classpath">
+ <pathelement location="${dist.lib.pkg}/fits.jar"/>
+ <pathelement location="${dist.lib.pkg}/starlink-util.jar"/>
+ <pathelement location="${dist.lib.pkg}/starlink-array.jar"/>
+ <pathelement location="${dist.lib.pkg}/starlink-table.jar"/>
+ </path>
+
<!-- Generate the local build classpath. This is the most difficult
! part of handling the classpath. The local classes will be in
! the "build/classes" part of each package, plus third party
@@ -228,15 +221,7 @@
! doesn't work as expected add the additional classes/jars to
! the extra classpath.
!-->
- <extclasspath id="built.jarpath">
- <pathelement location="${star.build.dir}/junit/lib/junit/junit.jar"/>
- <pathelement location="${star.build.dir}/tamfits/lib/tamfits/tamfits.jar"/>
- <pathelement location="${star.build.dir}/array/lib/array/array.jar"/>
- <pathelement location="${star.build.dir}/ndx/lib/ndx/ndx.jar"/>
- <pathelement location="${star.build.dir}/jniast/lib/jniast/jniast.jar"/>
- <pathelement location="${star.build.dir}/table/lib/table/table.jar"/>
- <pathelement location="${star.build.dir}/util/lib/util/util.jar"/>
- </extclasspath>
+ <path id="built.jarpath"/>
<path id="built.classpath">
@@ -374,7 +359,8 @@
destdir="${build.classes}"
debug="${debug}"
deprecation="${deprecation}"
- source="${source.version}"
+ encoding="cp1252"
+ includeantruntime="false"
optimize="${optimize}">
<classpath refid="classpath"/>
@@ -405,6 +391,10 @@
description="-> creates the package jar file">
<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>
@@ -415,13 +405,6 @@
<zip destfile="${dist.lib.pkg}/${name}_src.zip" basedir="${java.dir}"/>
- <!-- Sign all jar files -->
- <signjar jar="${dist.lib.pkg}/${name}.jar"
- alias="${webstart.alias}"
- keystore="${webstart.keystore}"
- keypass="${webstart.keypass}"
- storepass="${webstart.storepass}"/>
-
</target>
<!--
@@ -802,7 +785,7 @@
windowtitle="${Name} API"
doctitle="${Name}"
defaultexcludes="yes"
- source="${source.version}"
+ encoding="cp1252"
classpathref="classpath">
<!-- Get a list of directories that name all the potential
@@ -888,7 +871,8 @@
<javac srcdir="${tests.dir}"
destdir="${build.tests}"
debug="${debug}"
- source="${source.version}"
+ encoding="cp1252"
+ includeantruntime="false"
deprecation="${deprecation}" >
<classpath refid="tests-classpath"/>
<exclude name="uk/ac/starlink/fits/FitsNdxTest.java"/>
From: Ole Streicher <olebole@debian.org>
Date: Thu, 16 Feb 2017 16:10:49 +0100
Subject: Remove NDX and JNIAST references
---
build.xml | 22 ++++------------------
1 file changed, 4 insertions(+), 18 deletions(-)
diff --git a/build.xml b/build.xml
index 6c11e0f..00c4e1f 100644
--- a/build.xml
+++ b/build.xml
@@ -204,12 +204,6 @@
<!-- Array -->
<pathelement location="${star.jar.dir}/array/array.jar"/>
- <!-- NDX -->
- <pathelement location="${star.jar.dir}/ndx/ndx.jar"/>
-
- <!-- JNIAST -->
- <pathelement location="${star.jar.dir}/jniast/jniast.jar"/>
-
<!-- Table -->
<pathelement location="${star.jar.dir}/table/table.jar"/>
@@ -317,18 +311,6 @@
classname="uk.ac.starlink.array.NDArray"/>
<fail message="No Array available" unless="array.present"/>
- <!-- Need NDX -->
- <available property="ndx.present"
- classpathref="classpath"
- classname="uk.ac.starlink.ndx.Ndx"/>
- <fail message="No NDX available" unless="ndx.present"/>
-
- <!-- Need JNIAST -->
- <available property="jniast.present"
- classpathref="classpath"
- classname="uk.ac.starlink.ast.Grf"/>
- <fail message="No JNIAST available" unless="jniast.present"/>
-
<!-- Need Table -->
<available property="table.present"
classpathref="classpath"
@@ -400,6 +382,7 @@
<!-- Exclude any Java files in the source tree that should not be
! compiled -->
<exclude name="**/README*"/>
+ <exclude name="uk/ac/starlink/fits/FitsNdxHandler.java"/>
</javac>
</target>
@@ -828,6 +811,7 @@
<include name="**"/>
<exclude name="**/support/*"/>
<exclude name="**/testcases/*"/>
+ <exclude name="uk/ac/starlink/fits/FitsNdxHandler.java"/>
</packageset>
<!-- Link to the full Java API at SUNs website -->
@@ -907,6 +891,7 @@
source="${source.version}"
deprecation="${deprecation}" >
<classpath refid="tests-classpath"/>
+ <exclude name="uk/ac/starlink/fits/FitsNdxTest.java"/>
</javac>
</target>
@@ -944,6 +929,7 @@
<batchtest>
<fileset dir="${tests.dir}">
<include name="**/*Test*"/>
+ <exclude name="uk/ac/starlink/fits/FitsNdxTest.java"/>
</fileset>
</batchtest>
From: Ole Streicher <olebole@debian.org>
Date: Mon, 20 Feb 2017 13:28:16 +0100
Subject: Use latest nom.tam.fits API
---
src/main/uk/ac/starlink/fits/AbstractArrayDataIO.java | 4 ++++
src/main/uk/ac/starlink/fits/FitsConstants.java | 6 +++---
src/main/uk/ac/starlink/fits/FitsTableBuilder.java | 4 ++--
src/main/uk/ac/starlink/fits/MappedFile.java | 18 +++++++++++++++++-
src/main/uk/ac/starlink/fits/MultiMappedFile.java | 16 ++++++++++++++++
.../uk/ac/starlink/fits/WritableFitsArrayImpl.java | 2 +-
6 files changed, 43 insertions(+), 7 deletions(-)
diff --git a/src/main/uk/ac/starlink/fits/AbstractArrayDataIO.java b/src/main/uk/ac/starlink/fits/AbstractArrayDataIO.java
index 1c22edf..52654ba 100644
--- a/src/main/uk/ac/starlink/fits/AbstractArrayDataIO.java
+++ b/src/main/uk/ac/starlink/fits/AbstractArrayDataIO.java
@@ -322,6 +322,10 @@ public abstract class AbstractArrayDataIO
return primitiveArrayRecurse( o, nread );
}
+ public long readLArray( Object o ) throws IOException {
+ return readArray( o );
+ }
+
private int primitiveArrayRecurse( Object o, int nread )
throws IOException {
if ( o == null ) {
diff --git a/src/main/uk/ac/starlink/fits/FitsConstants.java b/src/main/uk/ac/starlink/fits/FitsConstants.java
index 43a9689..f45e0fa 100644
--- a/src/main/uk/ac/starlink/fits/FitsConstants.java
+++ b/src/main/uk/ac/starlink/fits/FitsConstants.java
@@ -42,7 +42,7 @@ public class FitsConstants {
public static final String NDARRAY_PREFIX = "NDA_";
/** Image of end-of-header card. */
- public static final HeaderCard END_CARD = new HeaderCard(
+ public static final HeaderCard END_CARD = HeaderCard.create(
"END " +
" " );
@@ -225,7 +225,7 @@ public class FitsConstants {
while ( need > 0 ) {
int len = strm.read( buffer, 80 - need, need );
if ( len <= 0 ) {
- throw new TruncatedFileException();
+ throw new TruncatedFileException("File truncated");
}
need -= len;
}
@@ -239,7 +239,7 @@ public class FitsConstants {
}
String cbuf = new String( buffer );
- HeaderCard fcard = new HeaderCard( cbuf );
+ HeaderCard fcard = HeaderCard.create( cbuf );
if ( firstCard ) {
String key = fcard.getKey();
if ( key == null ||
diff --git a/src/main/uk/ac/starlink/fits/FitsTableBuilder.java b/src/main/uk/ac/starlink/fits/FitsTableBuilder.java
index 121d4d0..0bca02a 100644
--- a/src/main/uk/ac/starlink/fits/FitsTableBuilder.java
+++ b/src/main/uk/ac/starlink/fits/FitsTableBuilder.java
@@ -283,7 +283,7 @@ public class FitsTableBuilder implements TableBuilder, MultiTableBuilder {
AsciiTable tdata = new AsciiTable( hdr );
tdata.read( in );
tdata.getData();
- TableHDU thdu = new AsciiTableHDU( hdr, (Data) tdata );
+ TableHDU thdu = new AsciiTableHDU( hdr, tdata );
Tables.streamStarTable( new FitsStarTable( thdu ), sink );
return true;
}
@@ -431,7 +431,7 @@ public class FitsTableBuilder implements TableBuilder, MultiTableBuilder {
AsciiTable tdata = new AsciiTable( hdr );
tdata.read( strm );
tdata.getData();
- TableHDU thdu = new AsciiTableHDU( hdr, (Data) tdata );
+ TableHDU thdu = new AsciiTableHDU( hdr, tdata );
return new TableResult( new FitsStarTable( thdu ), afterpos );
}
diff --git a/src/main/uk/ac/starlink/fits/MappedFile.java b/src/main/uk/ac/starlink/fits/MappedFile.java
index 3116315..4fe84e7 100644
--- a/src/main/uk/ac/starlink/fits/MappedFile.java
+++ b/src/main/uk/ac/starlink/fits/MappedFile.java
@@ -106,11 +106,19 @@ public class MappedFile extends AbstractArrayDataIO implements RandomAccess {
return (long) niobuf_.position();
}
+ public void skipAllBytes( long toSkip ) {
+ skipBytes((int)toSkip);
+ }
+
+ public void skipAllBytes( int toSkip ) {
+ skipBytes(toSkip);
+ }
+
public int skipBytes( int toSkip ) {
int nskip = Math.max( toSkip, 0 );
nskip = Math.min( toSkip, niobuf_.remaining() );
niobuf_.position( niobuf_.position() + nskip );
- return nskip;
+ return nskip;
}
protected byte get() throws IOException {
@@ -169,6 +177,14 @@ public class MappedFile extends AbstractArrayDataIO implements RandomAccess {
}
}
+ public void reset() {
+ // no action
+ }
+
+ public void mark( int i ) {
+ // no action
+ }
+
/**
* Returns a mapped byte buffer which results from mapping a given file.
*
diff --git a/src/main/uk/ac/starlink/fits/MultiMappedFile.java b/src/main/uk/ac/starlink/fits/MultiMappedFile.java
index 6d9a3cd..22c0689 100644
--- a/src/main/uk/ac/starlink/fits/MultiMappedFile.java
+++ b/src/main/uk/ac/starlink/fits/MultiMappedFile.java
@@ -101,6 +101,14 @@ public class MultiMappedFile extends AbstractArrayDataIO
}
}
+ public void skipAllBytes( long toSkip ) throws IOException {
+ skipBytes((int)toSkip);
+ }
+
+ public void skipAllBytes( int toSkip ) throws IOException {
+ skipBytes(toSkip);
+ }
+
public int skipBytes( int toSkip ) throws IOException {
return toInt( skip( (long) toSkip ) );
};
@@ -193,6 +201,14 @@ public class MultiMappedFile extends AbstractArrayDataIO
}
}
+ public void reset() {
+ // no action
+ }
+
+ public void mark( int i ) {
+ // no action
+ }
+
/**
* Returns the MappedByteBuffer corresponding to a given block of this
* file. The relevant region of the file is mapped (lazily) if
diff --git a/src/main/uk/ac/starlink/fits/WritableFitsArrayImpl.java b/src/main/uk/ac/starlink/fits/WritableFitsArrayImpl.java
index 33ffaee..38603cd 100644
--- a/src/main/uk/ac/starlink/fits/WritableFitsArrayImpl.java
+++ b/src/main/uk/ac/starlink/fits/WritableFitsArrayImpl.java
@@ -153,7 +153,7 @@ class WritableFitsArrayImpl implements ArrayImpl {
}
/* Add termination record. */
- cardlist.add( new HeaderCard( "END" ) );
+ cardlist.add( HeaderCard.create( "END" ) );
}
catch( HeaderCardException e ) {
throw (IOException) new IOException( e.getMessage() )
Remove-NDX-and-JNIAST-references.patch
Fix-build.xml-for-use-outside-of-starjava.patch
Use-latest-nom.tam.fits-API.patch
#!/usr/bin/make -f
%:
dh $@ --with javahelper
override_dh_auto_build:
ant jars
ant javadocs
override_dh_auto_test:
ant test -Djava.awt.headless=True
get-orig-source:
svn export https://github.com/Starlink/starjava/trunk/fits starjava-fits ; \
VERSION=`xmllint --xpath '//project/property[@name="version"]/@value' starjava-fits/build.xml | cut -d\" -f2| tr - .| tr -d +` ; \
DATE=`stat -c %y starjava-fits/src/main/uk/ac/starlink/fits/*.java | cut -c-10 | sort|uniq|tail -1| tr - .`; \
tar cf starjava-fits_$$VERSION+$$DATE.orig.tar starjava-fits ; \
rm -rf starjava-fits ; \
xz starjava-fits_$$VERSION+$$DATE.orig.tar
docs/starlink-fits/javadocs/
lib/starlink-fits/starlink-fits.jar
<?xml version="1.0"?>
<project name="Starjava CI tests" default="test" basedir=".">
<property name="build.dir" value="build"/>
<property name="src.dir" value="."/>
<property name="build.tests" value="${build.dir}/testcases"/>
<property name="tests.dir" value="${src.dir}/testcases"/>
<property name="debug" value="true"/>
<property name="source.version" value="1.5"/>
<property name="deprecation" value="false"/>
<property name="junit.fork" value="true"/>
<property name="junit.filtertrace" value="off"/>
<property name="junit.summary" value="no"/>
<path id="tests-classpath">
<pathelement location="/usr/share/java/${component}.jar"/>
<pathelement location="/usr/share/java/junit.jar"/>
<pathelement location="${build.tests}"/>
<pathelement location="${tests.dir}"/>
</path>
<target name="compile-tests">
<mkdir dir="${build.tests}"/>
<javac srcdir="${tests.dir}"
destdir="${build.tests}"
debug="${debug}"
includeantruntime="false"
encoding="cp1252"
deprecation="${deprecation}" >
<classpath refid="tests-classpath"/>
</javac>
</target>
<target name="test"
depends="run-tests"
description="-> run JUnit tests"/>
<target name="run-tests"
depends="compile-tests">
<junit printsummary="${junit.summary}" haltonfailure="yes"
filtertrace="${junit.filtertrace}"
fork="${junit.fork}">
<jvmarg value="-enableassertions"/>
<classpath refid="tests-classpath"/>
<sysproperty key="java.io.tmpdir" value="${build.tests}"/>
<sysproperty key="build.tests" value="${build.tests}"/>
<sysproperty key="tests-classpath.value"
value="${tests-classpath.value}"/>
<sysproperty key="java.awt.headless" value="${java.awt.headless}"/>
<formatter type="plain" usefile="false"/>
<batchtest>
<fileset dir="${tests.dir}">
<include name="**/*Test.java"/>
</fileset>
</batchtest>
</junit>
</target>
</project>
Tests: starjava-test
Depends: starlink-fits-java,
ant, ant-optional, default-jdk, junit
#!/bin/sh
set -e
rm -rf ${ADTTMP}/*
cp -a debian/tests/build.xml src/testcases ${ADTTMP}
cd ${ADTTMP}
ant test -Djava.awt.headless=True -Dcomponent=starlink-fits
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment