b4ad11
##Documents generation and Octave binding look not available yet
601355
601355
%global with_python 1
b4ad11
%global with_ruby    0
b4ad11
df024e
%ifarch s390x %{arm} aarch64 %{power64}
b4ad11
%global with_java    0
b4ad11
%else
b4ad11
%global with_java    1
b4ad11
%endif
b4ad11
b4ad11
%global with_octave  0
b4ad11
%global with_perl    0
b4ad11
%global with_r       0
b4ad11
b4ad11
%ifarch %{mono_arches}
b4ad11
%global with_mono    0
b4ad11
%else
b4ad11
%global with_mono    0
b4ad11
%endif
b4ad11
b4ad11
%global with_doc     1
b4ad11
601355
# No tests?
b4ad11
%global with_check   0
b4ad11
b4ad11
%global octpkg NUML
b4ad11
%if 0%{?with_octave}
b4ad11
# Exclude .oct files from provides
b4ad11
%global __provides_exclude_from ^%{octpkglibdir}/.*\\.oct$
b4ad11
%endif
b4ad11
b4ad11
%global _docdir_fmt %{name}
b4ad11
601355
%global commit e61f6d521fd97f8699ea2b596b64d3e3eda0d647
601355
%global date 20190327
601355
%global shortcommit %(c=%{commit}; echo ${c:0:7})
601355
b4ad11
Name:           libnuml
b4ad11
Summary:        Numerical Markup Language
b4ad11
Version:        1.1.1
994fd2
Release:        18.%{date}git%{shortcommit}%{?dist}
b4ad11
URL:            https://github.com/NuML/NuML
601355
Source0:        https://github.com/NuML/NuML/archive/%{commit}/NuML-%{commit}.tar.gz
b4ad11
License:        LGPLv2+
b4ad11
b4ad11
BuildRequires: cmake
1713b6
BuildRequires: gcc, gcc-c++
b4ad11
BuildRequires: zlib-devel
b4ad11
BuildRequires: swig
b4ad11
BuildRequires: libsbml-devel
b4ad11
BuildRequires: libxml2-devel
b4ad11
BuildRequires: bzip2-devel
b4ad11
BuildRequires: xerces-c-devel
00dcbb
# Use new minizip starting from fedora 30
00dcbb
# rhbz #1632187
00dcbb
%if 0%{?fedora} == 29
00dcbb
BuildRequires:  minizip-compat-devel
00dcbb
%endif
00dcbb
%if 0%{?fedora} == 28
00dcbb
BuildRequires:  minizip-devel
00dcbb
%endif
00dcbb
%if 0%{?fedora} >= 30
00dcbb
#BuildRequires:  minizip-devel >= 2.5.0
00dcbb
%endif
b4ad11
b4ad11
%if 0%{?with_check}
b4ad11
BuildRequires: check-devel
b4ad11
%endif
b4ad11
601355
Obsoletes:     python2-libnuml < 0:5.18.0
601355
b4ad11
##This patch BuildRequires:  cmakesets libraries' installation paths
b4ad11
Patch0: %{name}-fix_install_libpaths.patch
b4ad11
b4ad11
%description
b4ad11
LibNuML is a library for reading/writing documents describing numerical
b4ad11
results in an XML dialect.
b4ad11
This release includes a number of improvements especially:
b4ad11
b4ad11
 * improved object structure matching the specification document
b4ad11
 * ability to add notes and annotations
b4ad11
 * improved python support
b4ad11
b4ad11
%package devel
b4ad11
Summary: Library that fully supports NUML
b4ad11
Requires: %{name}%{?_isa} = %{version}-%{release}
b4ad11
%description devel
b4ad11
This package provides header and library files of libnuml.
b4ad11
7ac6ab
%package static
7ac6ab
Summary: Library that fully supports NUML
601355
Provides: libNuML-static = %{version}-%{release}
7ac6ab
%description static
7ac6ab
This package provides static library of libnuml.
7ac6ab
601355
%if 0%{?with_python}
b4ad11
%package -n python3-libnuml
b4ad11
Summary: Python3 library that fully supports NUML
b4ad11
BuildRequires: python3-devel
b4ad11
%{?python_provide:%python_provide python3-%{name}}
b4ad11
%description -n python3-libnuml
b4ad11
The %{octpkg} python package contains the libraries to 
b4ad11
develop applications with libNUML Python3 bindings.
b4ad11
%endif
b4ad11
b4ad11
%if 0%{?with_java}
b4ad11
%package -n java-%{octpkg}
b4ad11
Summary: Java library that fully supports NUML
b4ad11
BuildRequires:  java-1.8.0-openjdk-devel
df024e
BuildRequires:  java-devel, javapackages-tools
b4ad11
Requires:       java-headless
b4ad11
Requires:       jpackage-utils
b4ad11
%description -n java-%{octpkg}
b4ad11
The %{octpkg} java package contains the libraries to 
b4ad11
develop applications with libNUML Java bindings.
b4ad11
%endif
b4ad11
b4ad11
%if 0%{?with_octave}
b4ad11
%package -n octave-%{octpkg}
b4ad11
Summary: Octave library that fully supports NUML
b4ad11
BuildRequires:  octave-devel
b4ad11
Requires:       octave(api) = %{octave_api}
b4ad11
Requires(post): octave
b4ad11
Requires(postun): octave
b4ad11
%description -n octave-%{octpkg}
b4ad11
The %{octpkg} octave package contains the libraries to 
b4ad11
develop applications with libNUML Octave bindings.
b4ad11
%endif
b4ad11
b4ad11
%if 0%{?with_perl}
b4ad11
%package -n perl-%{octpkg}
b4ad11
Summary: Perl library that fully supports NUML
b4ad11
BuildRequires: perl-interpreter
b4ad11
BuildRequires: perl-devel
b4ad11
BuildRequires: perl-generators
b4ad11
BuildRequires: perl(ExtUtils::MakeMaker)
b4ad11
BuildRequires: perl(Test::More)
b4ad11
Requires:      perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
b4ad11
%description -n perl-%{octpkg}
b4ad11
The %{octpkg} perl package contains the libraries to 
b4ad11
develop applications with libNUML Perl bindings.
b4ad11
%endif
b4ad11
b4ad11
%if 0%{?with_ruby}
b4ad11
%package -n ruby-%{octpkg}
b4ad11
Summary: Ruby library that fully supports NUML
b4ad11
BuildRequires: ruby-devel
b4ad11
Requires: ruby(release)
b4ad11
Provides: ruby(NUML) = %{version}
b4ad11
%description -n ruby-%{octpkg}
b4ad11
The %{octpkg} ruby package contains the libraries to 
b4ad11
develop applications with libNUML Ruby bindings.
b4ad11
%endif
b4ad11
b4ad11
%if 0%{?with_r}
b4ad11
%package -n R-%{octpkg}
b4ad11
Summary: R library that fully supports NUML
b4ad11
BuildRequires: R-devel, R-core-devel, tex(latex)
b4ad11
Requires:      R-core
b4ad11
%description -n R-%{octpkg}
b4ad11
The %{octpkg} R package contains the libraries to 
b4ad11
develop applications with libNUML R bindings.
b4ad11
%endif
b4ad11
b4ad11
%if 0%{?with_mono}
b4ad11
%package sharp
b4ad11
Summary: Mono library that fully supports NUML
b4ad11
BuildRequires: xerces-c-devel, libxml2-devel, expat-devel
b4ad11
BuildRequires: mono-core
b4ad11
Requires: mono-core
b4ad11
%description sharp
b4ad11
The %{octpkg} csharp package contains the libraries to 
b4ad11
develop applications with libNUML C# bindings.
b4ad11
%endif
b4ad11
b4ad11
%if 0%{?with_doc}
b4ad11
%package doc
b4ad11
Summary: Library that fully supports NUML
b4ad11
BuildRequires: doxygen
b4ad11
BuildArch: noarch
b4ad11
%description doc
b4ad11
The %{octpkg} doc package contains the HTML documentation
b4ad11
of libNUML libraries.
b4ad11
%endif
b4ad11
b4ad11
%prep
601355
%autosetup -n NuML-%{commit} -N
601355
pushd libnuml
601355
%patch0 -p0
b4ad11
sed -e 's| lib | %{_lib} |g' -i CMakeLists.txt
b4ad11
sed -e 's| lib/cmake | %{_lib}/cmake |g' -i CMakeLists.txt
601355
popd
b4ad11
b4ad11
%build
601355
mkdir -p libnuml/build && pushd libnuml/build
b4ad11
%cmake -Wno-dev \
601355
%if 0%{?with_python}
b4ad11
 -DWITH_PYTHON:BOOL=ON \
b4ad11
 -DWITH_SWIG:BOOL=ON \
b4ad11
 -DPYTHON_EXECUTABLE:FILEPATH=%{__python3} \
333795
 -DPYTHON_INCLUDE_DIR:PATH=%{_includedir}/python%{python3_version}$(python3-config --abiflags) \
333795
 -DPYTHON_LIBRARY:FILEPATH=%{_libdir}/libpython%{python3_version}$(python3-config --abiflags).so \
b4ad11
%endif
b4ad11
%if 0%{?with_java}
b4ad11
 -DWITH_JAVA:BOOL=ON \
b4ad11
 -DWITH_SWIG:BOOL=ON \
b4ad11
%endif
b4ad11
%if 0%{?with_octave}
b4ad11
 -DWITH_OCTAVE:BOOL=ON \
b4ad11
%endif
b4ad11
%if 0%{?with_perl}
b4ad11
 -DWITH_PERL:BOOL=ON \
b4ad11
%endif
b4ad11
%if 0%{?with_ruby}
b4ad11
 -DWITH_RUBY:BOOL=ON \
b4ad11
%endif
b4ad11
%if 0%{?with_r}
b4ad11
 -DWITH_R:BOOL=ON \
b4ad11
 -DR_INCLUDE_DIRS:PATH=%{_includedir}/R \
b4ad11
%endif
b4ad11
%if 0%{?with_mono}
b4ad11
 -DWITH_CSHARP:BOOL=ON \
b4ad11
 -DWITH_SWIG:BOOL=ON \
b4ad11
%endif
b4ad11
 -DCSHARP_COMPILER:FILEPATH=%{_bindir}/mcs \
b4ad11
%if 0%{?with_doc}
b4ad11
 -DWITH_DOXYGEN:BOOL=ON \
b4ad11
%endif
b4ad11
%if 0%{?with_check}
b4ad11
 -DWITH_CHECK:BOOL=ON \
b4ad11
 -DWITH_EXAMPLES:BOOL=ON \
b4ad11
%endif
b4ad11
 -DLIBSBML_LIBRARY:FILEPATH=%{_libdir}/libsbml.so -DLIBSBML_INCLUDE_DIR:PATH=%{_includedir} \
b4ad11
 -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} \
b4ad11
 -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} -DLIBNUML_SHARED_VERSION:BOOL=ON \
b4ad11
 -DEXTRA_LIBS:STRING="sbml;xml2;bz2;z;m;dl" -DLIBSBML_STATIC:BOOL=OFF \
b4ad11
 -DCMAKE_CXX_FLAGS_RELEASE:STRING="-I%{_includedir}/libxml2" \
b4ad11
 -DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE -DCMAKE_COLOR_MAKEFILE:BOOL=ON \
b4ad11
 -DCPACK_BINARY_TZ:BOOL=OFF -DCPACK_BINARY_TGZ:BOOL=OFF \
b4ad11
 -DCPACK_SOURCE_TBZ2:BOOL=OFF -DCPACK_SOURCE_TGZ:BOOL=OFF \
b4ad11
 -DCPACK_SOURCE_TZ:BOOL=OFF -DWITH_ZLIB:BOOL=ON -DWITH_CPP_NAMESPACE:BOOL=OFF \
b4ad11
 -DCMAKE_SKIP_RPATH:BOOL=YES -DCMAKE_SKIP_INSTALL_RPATH:BOOL=YES ..
b4ad11
b4ad11
%make_build
b4ad11
popd
b4ad11
b4ad11
%if 0%{?with_doc}
601355
pushd libnuml
b4ad11
doxygen
601355
popd
b4ad11
%endif
b4ad11
b4ad11
####################################################################################################
b4ad11
b4ad11
%install
601355
%make_install -C libnuml/build
b4ad11
b4ad11
mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}
b4ad11
b4ad11
##Only for R library
b4ad11
%if 0%{?with_r}
b4ad11
mkdir -p $RPM_BUILD_ROOT%{_libdir}/R/library
b4ad11
%{_bindir}/R CMD INSTALL -l $RPM_BUILD_ROOT%{_libdir}/R/library build/bindings/r/libNUML_%{version}_R_*.tar.gz
b4ad11
test -d %{octpkg}/src && (cd %{octpkg}/src; rm -f *.o *.so)
b4ad11
rm -rf $RPM_BUILD_ROOT%{_libdir}/R/library/%{octpkg}/R.css
b4ad11
b4ad11
# Make symlink instead hard-link
b4ad11
ln -sf %{_libdir}/libNUML.so $RPM_BUILD_ROOT%{_libdir}/R/library/libNUML/libs/libNUML.so
b4ad11
%endif
b4ad11
##
b4ad11
b4ad11
%if 0%{?with_octave}
b4ad11
mkdir -p $RPM_BUILD_ROOT%{octpkgdir}/packinfo
b4ad11
install -pm 644 LICENSE.txt *.md $RPM_BUILD_ROOT%{octpkgdir}/packinfo
b4ad11
%endif
b4ad11
b4ad11
%if 0%{?with_java}
b4ad11
mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{name}
b4ad11
mkdir -p $RPM_BUILD_ROOT%{_jnidir}
b4ad11
mv $RPM_BUILD_ROOT%{_libdir}/libnumlj.so $RPM_BUILD_ROOT%{_libdir}/%{name}/
b4ad11
ln -sf %{_libdir}/%{name}/libnumlj.so $RPM_BUILD_ROOT%{_jnidir}/libnumlj.so
b4ad11
%endif
b4ad11
b4ad11
## Remove libtool archives
b4ad11
find $RPM_BUILD_ROOT -name '*.la' -delete
b4ad11
6acfef
%ldconfig_scriptlets
b4ad11
b4ad11
%if 0%{?with_r}
3dbb69
%ldconfig_scriptlets -n R-%{octpkg}
b4ad11
%endif
b4ad11
b4ad11
%if 0%{?with_octave}
b4ad11
%post -n octave-%{octpkg}
b4ad11
%octave_cmd pkg rebuild
b4ad11
b4ad11
%postun -n octave-%{octpkg}
b4ad11
%octave_cmd pkg rebuild
b4ad11
b4ad11
%preun -n octave-%{octpkg}
b4ad11
%octave_pkg_preun
b4ad11
%endif
b4ad11
b4ad11
%if 0%{?with_check}
b4ad11
%check
601355
make test -C libnuml/build
b4ad11
%endif
b4ad11
b4ad11
%files
601355
%doc libnuml/*.md
601355
%license libnuml/LICENSE.txt
b4ad11
%{_libdir}/libnuml.so.*
b4ad11
%if 0%{?with_check}
b4ad11
%exclude %{_datadir}/%{name}
b4ad11
%endif
b4ad11
b4ad11
%files devel
b4ad11
%{_libdir}/%{name}.so
7ac6ab
%{_libdir}/cmake/numl-config*.cmake
b4ad11
%{_includedir}/numl/
b4ad11
7ac6ab
%files static
601355
%doc libnuml/*.md
601355
%license libnuml/LICENSE.txt
7ac6ab
%{_libdir}/%{name}-static.a
7ac6ab
%{_libdir}/cmake/numl-static-config*.cmake
7ac6ab
601355
%if 0%{?with_python}
b4ad11
%files -n python3-%{name}
601355
%doc libnuml/*.md
601355
%license libnuml/LICENSE.txt
b4ad11
%{python3_sitearch}/%{name}/
b4ad11
%{python3_sitearch}/*.pth
b4ad11
%endif
b4ad11
b4ad11
%if 0%{?with_java}
b4ad11
%files -n java-%{octpkg}
b4ad11
%{_javadir}/libnumlj.jar
b4ad11
%{_jnidir}/libnumlj.so
b4ad11
%{_libdir}/%{name}/
b4ad11
%endif
b4ad11
b4ad11
%if 0%{?with_octave}
b4ad11
%files -n octave-%{octpkg}
b4ad11
%{octpkgdir}/packinfo
b4ad11
%{octpkglibdir}/
b4ad11
%endif
b4ad11
b4ad11
%if 0%{?with_perl}
b4ad11
%files -n perl-%{octpkg}
601355
%doc libnuml/*.md
601355
%license libnuml/LICENSE.txt
b4ad11
%{perl_vendorarch}/LibNUML.*
b4ad11
%exclude %dir %{perl_vendorarch}/auto/
b4ad11
%{perl_vendorarch}/auto/libNUML/
b4ad11
%endif
b4ad11
b4ad11
%if 0%{?with_ruby}
b4ad11
%files -n ruby-%{octpkg}
601355
%doc libnuml/*.md
601355
%license libnuml/LICENSE.txt
b4ad11
%{ruby_vendorarchdir}/*.so
b4ad11
%endif
b4ad11
b4ad11
%if 0%{?with_r}
b4ad11
%files -n R-%{octpkg}
601355
%doc libnuml/*.md
601355
%license libnuml/LICENSE.txt
b4ad11
%{_libdir}/R/library/libNUML/
b4ad11
%{_libdir}/libNUML.so
b4ad11
%endif
b4ad11
b4ad11
%if 0%{?with_mono}
b4ad11
%files sharp
601355
%doc libnuml/*.md
601355
%license libnuml/LICENSE.txt
b4ad11
#%%{_monogacdir}/libnumlcsP
b4ad11
%{_monodir}/LibnumlcsP/
b4ad11
%endif
b4ad11
b4ad11
%if 0%{?with_doc}
b4ad11
%files doc
601355
%license libnuml/LICENSE.txt
601355
%doc libnuml/doc/html *.pdf
b4ad11
%endif
b4ad11
b4ad11
%changelog
994fd2
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 1.1.1-18.20190327gite61f6d5
994fd2
- Rebuilt for Python 3.8
994fd2
3c8079
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.1-17.20190327gite61f6d5
3c8079
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
3c8079
333795
* Mon Jun 03 2019 Charalampos Stratakis <cstratak@redhat.com> - 1.1.1-16.20190327gite61f6d5
333795
- Don't hard-code python's abi flags
333795
601355
* Sun May 05 2019 Antonio Trande <sagitter@fedoraproject.org> - 1.1.1-15.20190327gite61f6d5
601355
- Build commit #e61f6d5
601355
- Obsolete Python2-libnuml
601355
f77bfa
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.1-14
f77bfa
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
f77bfa
00dcbb
* Mon Sep 24 2018 Antonio Trande <sagitter@fedoraproject.org> - 1.1.1-13
00dcbb
- Bundle minizip on fedora 30+ (rhbz#1632187) (upstream bug #466)
00dcbb
1b9a6f
* Tue Sep 04 2018 Patrik Novotný <panovotn@redhat.com> - 1.1.1-12
1b9a6f
- change requires to minizip-compat(-devel), rhbz#1609830, rhbz#1615381
1b9a6f
010615
* Sat Sep 01 2018 Antonio Trande <sagitteratfedoraproject.org> - 1.1.1-11
010615
- Deprecate Python2 on fedora 30+
010615
20411e
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.1-10
20411e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
20411e
6c7f84
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.1.1-9
6c7f84
- Rebuilt for Python 3.7
6c7f84
df024e
* Tue Jun 05 2018 Antonio Trande <sagitteratfedoraproject.org> - 1.1.1-8
df024e
- Rebuild for libsbml-5.17.0
df024e
- Add javapackages-tools
df024e
1713b6
* Thu Feb 22 2018 Antonio Trande <sagitteratfedoraproject.org> - 1.1.1-7
1713b6
- Add gcc gcc-c++ BR
1713b6
3dbb69
* Thu Feb 15 2018 Antonio Trande <sagitteratfedoraproject.org> - 1.1.1-6
3dbb69
- Fix %%ldconfig_scriptlets for sub-package
3dbb69
6acfef
* Thu Feb 15 2018 Antonio Trande <sagitteratfedoraproject.org> - 1.1.1-5
6acfef
- Rebuild for libsbml-5.16.0
6acfef
- Use %%ldconfig_scriptlets
6acfef
955592
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.1-4
955592
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
955592
7ac6ab
* Tue Oct 03 2017 Antonio Trande <sagitteratfedoraproject.org> - 1.1.1-3
7ac6ab
- Created a static sub-package
7ac6ab
b4ad11
* Fri Sep 29 2017 Antonio Trande <sagitteratfedoraproject.org> - 1.1.1-2
b4ad11
- Created a documentation sub-package
b4ad11
- Java shared library moved into a private lib directory
b4ad11
- Java shared library symlinked from /usr/lib/java
b4ad11
b4ad11
* Thu Sep 28 2017 Antonio Trande <sagitteratfedoraproject.org> - 1.1.1-1
b4ad11
- First package