diff --git a/0001-nexus-fix-version-and-nxtranslate-xml.patch b/0001-nexus-fix-version-and-nxtranslate-xml.patch new file mode 100644 index 0000000..f000158 --- /dev/null +++ b/0001-nexus-fix-version-and-nxtranslate-xml.patch @@ -0,0 +1,86 @@ +From 3563d9b37ebb3a59dd4d5ed1d82882818fd5d1ea Mon Sep 17 00:00:00 2001 +From: bzg1107 +Date: Wed, 28 Jul 2021 16:11:33 +0800 +Subject: [PATCH] nexus fix version and nxtranslate xml + +--- + CMakeLists.txt | 2 -- + applications/NXtranslate/text_xml/xml_retriever_dom.cpp | 8 ++++---- + applications/NXtranslate/xml_parser.cpp | 8 ++++---- + 3 files changed, 8 insertions(+), 10 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4c50538..8f8b0bd 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -69,7 +69,6 @@ endif() + #----------------------------------------------------------------------------- + set (API_VERSION_MAJOR 4) + set (API_VERSION_MINOR 4) +-set (API_VERSION_PATCH 2) + set (API_VERSION "${API_VERSION_MAJOR}.${API_VERSION_MINOR}.${API_VERSION_PATCH}") + set (ABI_CURRENT 1) + set (ABI_REVISION 0) +@@ -78,7 +77,6 @@ set (ABI_VERSION "${ABI_CURRENT}.${ABI_REVISION}.${ABI_AGE}") + + set (NEXUS_VERSION_MAJOR 4) + set (NEXUS_VERSION_MINOR 4) +-set (NEXUS_VERSION_PATCH 2) + set (NEXUS_SONAME 4) + set (NAPI_VERSION "${NEXUS_VERSION_MAJOR}.${NEXUS_VERSION_MINOR}.${NEXUS_VERSION_PATCH}") + set (NXLTVERSINFO "${NEXUS_VERSION_MAJOR}:${NEXUS_VERSION_MINOR}:${NEXUS_VERSION_PATCH}") +diff --git a/applications/NXtranslate/text_xml/xml_retriever_dom.cpp b/applications/NXtranslate/text_xml/xml_retriever_dom.cpp +index dcc56f4..dad5403 100644 +--- a/applications/NXtranslate/text_xml/xml_retriever_dom.cpp ++++ b/applications/NXtranslate/text_xml/xml_retriever_dom.cpp +@@ -163,8 +163,8 @@ static void my_error(void *user_data, const char* msg, ...){ + va_start(args,msg); + + // get the position of the error +- int line=getLineNumber(context); +- int col =getColumnNumber(context); ++ int line=xmlSAX2GetLineNumber(context); ++ int col =xmlSAX2GetColumnNumber(context); + + // print out the result + char str[70]; +@@ -186,8 +186,8 @@ static void my_fatalError(void *user_data, const char* msg, ...){ + va_start(args,msg); + + // get the position of the error +- int line=getLineNumber(context); +- int col =getColumnNumber(context); ++ int line=xmlSAX2GetLineNumber(context); ++ int col =xmlSAX2GetColumnNumber(context); + + // print out the result + char str[70]; +diff --git a/applications/NXtranslate/xml_parser.cpp b/applications/NXtranslate/xml_parser.cpp +index 70500a1..7457180 100644 +--- a/applications/NXtranslate/xml_parser.cpp ++++ b/applications/NXtranslate/xml_parser.cpp +@@ -463,8 +463,8 @@ static void my_error(void *user_data, const char* msg, ...){ + va_start(args,msg); + + // get the position of the error +- int line=getLineNumber(context); +- int col =getColumnNumber(context); ++ int line=xmlSAX2GetLineNumber(context); ++ int col =xmlSAX2GetColumnNumber(context); + + // print out the result + char str[70]; +@@ -486,8 +486,8 @@ static void my_fatalError(void *user_data, const char* msg, ...){ + va_start(args,msg); + + // get the position of the error +- int line=getLineNumber(context); +- int col =getColumnNumber(context); ++ int line=xmlSAX2GetLineNumber(context); ++ int col =xmlSAX2GetColumnNumber(context); + + // print out the result + char str[70]; +-- +2.30.0 + diff --git a/code-v4.4.3.tar.gz b/code-v4.4.3.tar.gz new file mode 100644 index 0000000..f7805ad Binary files /dev/null and b/code-v4.4.3.tar.gz differ diff --git a/nexus.spec b/nexus.spec new file mode 100644 index 0000000..497c35d --- /dev/null +++ b/nexus.spec @@ -0,0 +1,81 @@ +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 - 4.4.3-1 +- Package init