packages java-cml.spec
      Pages: < 1 >  DOWNLOAD      
%define        javahome     /usr/lib/jvm/jdk-sun

%define        javac_bin    %{javahome}/bin/javac
%define        jar_bin      %{javahome}/bin/jar
%define        javadoc_bin  %{javahome}/bin/javadoc

Name:          java-cml
Version:       1.2.6
Release:       1mamba
Summary:       Java CML Server Library (JCFL) Project
Group:         Development/Libraries/Java
Vendor:        openmamba
Distribution:  openmamba
Packager:      gil <puntogil@...>
URL:           http://www.openscience.org/~egonw/cml/
Source:        http://www.openscience.org/~egonw/cml/cml_source_%{version}.tar.gz
Patch0:        java-cml-1.2.6-Makefile.patch
License:       GPL
BuildRequires: java-jugglinglab
BuildRequires: java-sax2
BuildRequires: java-saxon6-aelfred
BuildRequires: sun-java
BuildRoot:     %{_tmppath}/%{name}-%{version}-root

%description
The Chemical Markup Language (CML) is a XML application for storing and transporting chemical information.
The first official release of CML was in spring 1999. Egon Willighagen wrote import and export filters in the
Java programming language soon after. 

The library makes use of the Chemical Data Object Programming Interface (CDOPI). Using the JCF Library means
that the Java program must define a class that implements CDOPI. JCFL uses this subclass to store information
taken from a CML file or stores the information in the subclass into a CML file. 

%package javadoc
Group:          Documentation
Summary:        Javadoc for %{name}

%description javadoc
Java CML Server Library (JCFL) Project.

This package contains javadoc for %{name}

%prep
%setup -q -c -n cml-%{version}

mkdir -p src
mkdir -p target/classes
mv org src/

%build

export JAVA_HOME=%{javahome}

%{javac_bin} -O -deprecation -source 1.4 -target 1.4 \
	-classpath target/classes:$(build-classpath jugglinglab sax2 saxon-aelfred):%{javahome}/jre/lib/rt.jar -g \
	-d target/classes \
	-encoding iso-8859-1 \
	$(find src -name "*.java")

%{jar_bin} cf target/cml.jar -C target/classes .

%{javadoc_bin} -d target/site/apidocs \
	-classpath target/cml.jar:$(build-classpath jugglinglab sax2 saxon-aelfred):%{javahome}/jre/lib/rt.jar \
	-source 1.4 \
	-encoding iso-8859-1 \
        -sourcepath src org.openscience.cml

%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"

mkdir -p %{buildroot}%{_javadir}/jmol
install -pm 644 target/cml.jar %{buildroot}%{_javadir}/jmol/cml-%{version}.jar
(
	cd %{buildroot}%{_javadir}/jmol
	for jar in *-%{version}*; do
		ln -sf ${jar} `echo $jar| sed  "s|-%{version}||g"`
	done
)

mkdir -p %{buildroot}%{_javadocdir}/cml-%{version}
cp -rp target/site/apidocs/* %{buildroot}%{_javadocdir}/cml-%{version}
ln -sf cml-%{version} %{buildroot}%{_javadocdir}/cml

%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"

%files
%defattr(-,root,root)
%{_javadir}/jmol/cml-%{version}.jar
%{_javadir}/jmol/cml.jar
%doc LICENSE.txt README.txt

%files javadoc
%defattr(-,root,root)
%{_javadocdir}/cml-%{version}
%{_javadocdir}/cml

%changelog
* Sat Dec 04 2010 gil <puntogil@...> 1.2.6-1mamba
- package created by autospec