# empty debuginfo
%global debug_package %nil
%ifarch x86_64
%global pl_linus LINUX-AMD64
%else
%global pl_linus LINUX-X86
%endif
%ifarch %arm
%global pl_linus LINUX-ARM"
%endif
%ifarch aarch64
%global pl_linus LINUX-AARCH64"
%endif
Name: jni-inchi
Version: 0.8
Release: 1%{?dist}
Summary: Java software to generate IUPAC's International Chemical Identifiers
License: LGPLv3
URL: http://jni-inchi.sourceforge.net/
# svn export https://svn.code.sf.net/p/jni-inchi/code/tags/jni-inchi-0.8
# find jni-inchi-0.8 -name "*.dll" -print -delete
# find jni-inchi-0.8 -name "*.so" -print -delete
# rm -rf jni-inchi-0.8/src/main/resources/META-INF/jniinchi/1.03_1/*
# tar cJf jni-inchi-0.8.tar.xz jni-inchi-0.8
Source0: %{name}-%{version}.tar.xz
Source1: %{name}-OSGi.bnd
BuildRequires: aqute-bnd
BuildRequires: gcc
BuildRequires: java-devel
BuildRequires: javapackages-local
# BuildRequires: maven-local
BuildRequires: mvn(junit:junit)
BuildRequires: mvn(net.sf.jnati:jnati-deploy)
# BuildRequires: mvn(net.sf.jnati:jnati-maven-plugin)
BuildRequires: mvn(org.codehaus.mojo:exec-maven-plugin)
BuildRequires: mvn(org.sonatype.oss:oss-parent:pom:)
%description
JNI-InChI enables Java software to generate IUPAC's
International Chemical Identifiers (InChIs) by
making Java Native Interface (JNI) calls to the
InChI C library developed by IUPAC. All of the
features from the InChI library are supported:
° Standard and Non-Standard InChI generation from structures
with 3D, 2D, or no coordinates
° Structure generation (without coordinates) from InChI
° InChIKey generation
° Check InChI / InChIKey
° InChI-to-InChI conversion
° AuxInfo to InChI input
° Access to the full range of options supported by InChI
° Full support for InChI's handling of stereo-chemistry
JNI-InChI is a library intended for use by developers of
other projects. It does not enable users to generate InChIs
from molecule file formats such as ".mol", ".cml", ".mol2",
or SMILES strings. If you want to do any of these, you
should take a look at the Chemistry Development Kit (CDK)
or JUMBO, both of which include InChI generation powered by the
JNI-InChI. If, however, you are a software developer and
you want want to generate the InChI for a molecule that
you already hold in memory, JNI-InChI is what you need.
%package javadoc
Summary: Javadoc for %{name}
BuildArch: noarch
%description javadoc
This package contains javadoc for %{name}.
%prep
%setup -q -n %{name}-%{version}
sed -i "s|CFLAGS +=|CFLAGS += %optflags|" src/main/native/Makefile.linux
sed -i "s|LDFLAGS += -shared|LDFLAGS += -shared %__global_ldflags|" src/main/native/Makefile.linux
sed -i "s|CFLAGS +=|CFLAGS += %optflags|" src/main/native/Makefile.gcc
sed -i "s|LDFLAGS += -s|LDFLAGS += -s %__global_ldflags|" src/main/native/Makefile.gcc
sed -i "s|mvn -f|xmvn -o -- -f|" src/main/native/Makefile
%pom_remove_plugin :maven-assembly-plugin
%pom_remove_plugin :maven-source-plugin
%if 0
%pom_xpath_inject pom:project 'bundle'
%pom_add_plugin org.apache.felix:maven-bundle-plugin . "
true
net.sf.jniinchi.Main
bundle-manifest
process-classes
manifest
"
%endif
# Convert from dos to unix line ending
sed -i.orig 's|\r||g' README
touch -r README.orig README
rm README.orig
mkdir -p target/{classes,generated-sources}
%mvn_file net.sf.%{name}:%{name} %{name}
%build
(cd src/main/java; %javac -d ../../../target/classes -classpath $(build-classpath jnati/jnati-core jnati/jnati-deploy log4j-1) -encoding UTF-8 $(find . -name "*.java"))
(cd target/classes; javah -jni -d ../generated-sources -encoding UTF-8 net.sf.jniinchi.JniInchiWrapper)
export JAVA_HOME=%{_jvmdir}/java PLATFORM=%pl_linus
make %{?_smp_mflags} all
(cd target/classes; %jar cvfe ../%{name}-%{version}.jar net.sf.jniinchi.Main -C . $(find -name "*.class") META-INF ../../LICENSE-*.txt ../../NOTICE.txt)
(cd src/main/java; %javadoc -Xdoclint:none -d ../../../target/site/apidocs -classpath $(build-classpath jnati/jnati-core jnati/jnati-deploy log4j-1):../../../target/%{name}-%{version}.jar -encoding UTF-8 $(find . -name "*.java"))
bnd wrap --properties %{SOURCE1} --version %{version} --output %{name}.jar target/%{name}-%{version}.jar
# %%mvn_build -- -Djnati.allowDownload=false
%install
%mvn_artifact pom.xml %{name}.jar
%mvn_install -J target/site/apidocs
%files -f .mfiles
%doc README
%license LICENSE-*.txt NOTICE.txt
%files javadoc -f .mfiles-javadoc
%license LICENSE-*.txt NOTICE.txt
%changelog
* Sat Oct 08 2016 gil cattaneo 0.8-1
- initial rpm