Name:           nexus
Version:        4.4.3
Release:        1
Summary:        Libraries and tools for the NeXus scientific data file format
# The entire source code is GPLv2+ except nxdir which is MIT
License:        LGPLv2+ and MIT and IJG and GPLv2+ and Zlib
URL:            http://www.nexusformat.org/
Source0:        https://github.com/nexusformat/code/archive/v%{version}/code-v%{version}.tar.gz
Patch0:         0001-nexus-fix-version-and-nxtranslate-xml.patch
BuildRequires:  cmake gcc gcc-c++ hdf5-devel hdf-devel make python-docutils 
BuildRequires:	doxygen libtirpc
Requires:       hdf5 hdf mxml

%description
NeXus is common data format for neutron, x-ray, and muon science. This
package provides tools and libraries for accessing these files. The on disk representation is based upon either HDF4, HDF5 or XML.

%package        devel
Summary:        Development files for %{name}
Requires:       %{name}%{?_isa} = %{version}-%{release}
Requires:       hdf5-devel
Requires:       hdf-devel

%description    devel
The %{name}-devel package contains header files for
developing applications that use %{name}

%package        tools
Summary:        Applications for reading and writing NeXus files.
Requires:       %{name}%{?_isa} = %{version}-%{release}
Requires:       readline
BuildRequires:  pkgconfig(libxml-2.0)
BuildRequires:  pkgconfig(readline)

%description    tools
%{summary}.

%prep
%autosetup -p1 -n code-%{version}

%build
%cmake \
       -DENABLE_HDF5=1 \
       -DENABLE_CXX=1 \
       -DENABLE_APPS=1 .
make %{?_smp_mflags}

%install
%make_install

%files
%license COPYING
%doc %{_datadir}/doc/NeXus/README.doc
%{_libdir}/lib*.so.*

%files devel
%license COPYING
%{_includedir}/nexus/
%{_libdir}/pkgconfig/
%{_libdir}/lib*.so
%{_libdir}/lib*.a

%files tools
%{_bindir}/nxbrowse
%{_bindir}/nxconvert
%{_bindir}/nxsummary
%{_bindir}/nxtranslate
%{_bindir}/nxtraverse
%{_mandir}/man1/nxbrowse.1.gz
%{_mandir}/man1/nxconvert.1.gz 
%{_mandir}/man1/nxsummary.1.gz
%license %{_datadir}/doc/NeXus/programs/nxdir/LICENSE
%doc %{_datadir}/doc/NeXus/programs/nxdir/CHANGES
%doc %{_datadir}/doc/NeXus/programs/nxdir/README
%doc %{_datadir}/doc/NeXus/programs/nxdir/TODO
%{_bindir}/nxdir
%{_mandir}/man1/nxdir.1.gz  

%changelog
* Tue Jul 13 2021 baizhonggui <baizhonggui@huawei.com> - 4.4.3-1
- Package init
