Name: hdfview Version: 3.2.0 Release: 1%{?dist} Summary: Java HDF5 Object viewer License: BSD with advertising URL: https://support.hdfgroup.org/products/java/ Source0: https://support.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfview-%{version}/src/hdfview-%{version}.zip Source1: hdfview Source2: hdfview.xml Source3: hdfview.desktop Source4: hdfview.appdata.xml # ./getsources.sh will download Source0 and remove bundled libs Source9: getsources.sh # Upstream creates a single jar with both the hdfobject interface and # the HDFView parts. Split that into separate jars. #Patch0: hdfview-jars.patch %global jhdf_version 3.3.2 BuildRequires: maven-local BuildRequires: ant hostname BuildRequires: hdf-devel hdf5-devel BuildRequires: java-hdf java-hdf5 junit BuildRequires: mvn(junit:junit) BuildRequires: mvn(org.eclipse.swt:swt) BuildRequires: mvn(org.slf4j:slf4j-api) BuildRequires: mvn(org.slf4j:slf4j-nop) BuildRequires: mvn(gov.nasa.gsfc.heasarc:nom-tam-fits) BuildRequires: ImageMagick BuildRequires: libappstream-glib BuildRequires: desktop-file-utils Requires: java Requires: javapackages-tools Requires: java-hdf java-hdf5 Requires: mvn(junit:junit) Requires: mvn(org.eclipse.swt:swt) Requires: mvn(org.slf4j:slf4j-api) Requires: mvn(org.slf4j:slf4j-simple) Requires: mvn(gov.nasa.gsfc.heasarc:nom-tam-fits) Requires: java-hdfobject = %{version}-%{release} Requires: hicolor-icon-theme BuildArch: noarch %description HDF is a versatile data model that can represent very complex data objects and a wide variety of meta-data. It is a completely portable file format with no limit on the number or size of data objects in the collection. This package provides a HDF4/HDF5 viewer. %package -n java-hdfobject Summary: Java HDF/HDF5 Object Package Requires: javapackages-tools Requires: java-hdf java-hdf5 Requires: mvn(org.slf4j:slf4j-api) %description -n java-hdfobject HDF is a versatile data model that can represent very complex data objects and a wide variety of meta-data. It is a completely portable file format with no limit on the number or size of data objects in the collection. This Java package implements HDF4/HDF5 data objects in an object-oriented form. It provides a common Java API for accessing HDF files. %package doc Summary: Sample files and example code for %{name} Enhances: %{name} Requires: %{name}-javadoc %description doc %{summary}. %package javadoc Summary: API documentation for %{name} %description javadoc %{summary}. %prep %autosetup # build jar repo mkdir -p lib/extra build-jar-repository -p lib/ junit slf4j- hdf hdf5 nom-tam-fits ln -s hdf.jar lib/jarhdf.jar ln -s hdf5.jar lib/jarhdf5.jar # simulate the settings files ln -s %{_libdir}/libhdf4.settings lib/libhdf4.settings ln -s %{_libdir}/libhdf5.settings lib/libhdf5.settings # artifacts location %mvn_package org.hdfgroup:hdfobject hdfobject %mvn_file org.hdfgroup:hdfobject hdfobject %mvn_package org.hdfgroup:jhdfview jhdfview %mvn_file org.hdfgroup:jhdfview jhdfview echo hdf.lib.dir=$(pwd)/lib >> build.properties echo hdf5.lib.dir=$(pwd)/lib >> build.properties %build ant jar ant javadoc %install # jars and depmap %mvn_artifact org.hdfgroup:hdfobject:%{version} build/jar/hdfobject.jar %mvn_artifact org.hdfgroup:jhdfview:%{version} build/jar/HDFView.jar %mvn_install -J build/javadocs install -Dpm0755 %{SOURCE1} -t %{buildroot}%{_bindir}/ # Create and install hicolor icons. for i in 16 22 32 48 ; do mkdir -p icons/${i}x${i}/apps convert -resize ${i}x${i} src/org.hdfgroup.hdfview/hdf/view/icons/hdf_large.gif \ icons/${i}x${i}/apps/hdfview.png install -Dpm 0644 icons/${i}x${i}/apps/hdfview.png \ %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps/hdfview.png install -Dpm 0644 icons/${i}x${i}/apps/hdfview.png \ %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/mimetypes/application-x-hdf.png done # .desktop file mkdir -p %{buildroot}%{_datadir}/applications desktop-file-install \ --dir %{buildroot}%{_datadir}/applications \ %{SOURCE3} # mime types install -Dpm644 -t %{buildroot}%{_datadir}/mime/packages/ %{SOURCE2} # appdata install -Dpm644 -t %{buildroot}%{_datadir}/appdata/ %{SOURCE4} rm ./test/org.hdfgroup.object.example.test/testfiles/*.txt # swt and deps mkdir -p %{buildroot}/usr/lib/java/hdfview/swt install -m644 lib/netcdf.jar %{buildroot}/usr/lib/java/hdfview/ #install -m644 lib/ext/swt/linux/%{_arch}/swt.jar %{buildroot}/usr/lib/java/hdfview/ install -m644 lib/ext/swt/org.eclipse.jface.jar %{buildroot}/usr/lib/java/hdfview/swt/ install -m644 lib/ext/swt/org.eclipse.collections.jar %{buildroot}/usr/lib/java/hdfview/swt/ install -m644 lib/ext/swt/org.eclipse.core.commands.jar %{buildroot}/usr/lib/java/hdfview/swt/ install -m644 lib/ext/swt/org.eclipse.equinox.common.jar %{buildroot}/usr/lib/java/hdfview/swt/ install -m644 lib/ext/swt/org.eclipse.nebula.widgets.nattable.core.jar %{buildroot}/usr/lib/java/hdfview/swt/ %check appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/appdata/*.appdata.xml %global _docdir_fmt %{name} %files -f .mfiles-jhdfview %_bindir/hdfview %{_datadir}/applications/hdfview.desktop %{_datadir}/icons/hicolor/*/*/*.png %{_datadir}/mime/packages/hdfview.xml %{_datadir}/appdata/hdfview.appdata.xml %files -n java-hdfobject -f .mfiles-hdfobject %doc docs/RELEASE.txt # other docs are very outdated, stuff that's on the web seems better %license COPYING /usr/lib/java/hdfview/* %files doc %doc samples/ %license COPYING %files javadoc -f .mfiles-javadoc %license COPYING %changelog * Wed Jul 05 2023 Balint Cristian - 3.2.0-1 - New release * Thu Jul 25 2019 Fedora Release Engineering - 2.14-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild