b4ad114
##Documents generation and Octave binding look not available yet
b4ad114
%global with_python2 1
b4ad114
%global with_python3 1
b4ad114
%global with_ruby    0
b4ad114
df024e2
%ifarch s390x %{arm} aarch64 %{power64}
b4ad114
%global with_java    0
b4ad114
%else
b4ad114
%global with_java    1
b4ad114
%endif
b4ad114
b4ad114
%global with_octave  0
b4ad114
%global with_perl    0
b4ad114
%global with_r       0
b4ad114
b4ad114
%ifarch %{mono_arches}
b4ad114
%global with_mono    0
b4ad114
%else
b4ad114
%global with_mono    0
b4ad114
%endif
b4ad114
b4ad114
%global with_doc     1
b4ad114
b4ad114
# No tests
b4ad114
%global with_check   0
b4ad114
b4ad114
%global octpkg NUML
b4ad114
%if 0%{?with_octave}
b4ad114
# Exclude .oct files from provides
b4ad114
%global __provides_exclude_from ^%{octpkglibdir}/.*\\.oct$
b4ad114
%endif
b4ad114
b4ad114
%global _docdir_fmt %{name}
b4ad114
b4ad114
Name:           libnuml
b4ad114
Summary:        Numerical Markup Language
b4ad114
Version:        1.1.1
20411e9
Release:        10%{?dist}
b4ad114
URL:            https://github.com/NuML/NuML
b4ad114
Source0:        https://github.com/NuML/NuML/releases/download/v%{version}/libNUML-%{version}-Source.tar.gz
b4ad114
b4ad114
License:        LGPLv2+
b4ad114
b4ad114
BuildRequires: cmake
1713b6d
BuildRequires: gcc, gcc-c++
b4ad114
BuildRequires: zlib-devel
b4ad114
BuildRequires: swig
b4ad114
BuildRequires: libsbml-devel
b4ad114
BuildRequires: libxml2-devel
b4ad114
BuildRequires: bzip2-devel
b4ad114
BuildRequires: xerces-c-devel
df024e2
BuildRequires: minizip-devel
b4ad114
b4ad114
%if 0%{?with_check}
b4ad114
BuildRequires: check-devel
b4ad114
%endif
b4ad114
b4ad114
##This patch BuildRequires:  cmakesets libraries' installation paths
b4ad114
Patch0: %{name}-fix_install_libpaths.patch
b4ad114
b4ad114
%description
b4ad114
LibNuML is a library for reading/writing documents describing numerical
b4ad114
results in an XML dialect.
b4ad114
This release includes a number of improvements especially:
b4ad114
b4ad114
 * improved object structure matching the specification document
b4ad114
 * ability to add notes and annotations
b4ad114
 * improved python support
b4ad114
b4ad114
%package devel
b4ad114
Summary: Library that fully supports NUML
b4ad114
Requires: %{name}%{?_isa} = %{version}-%{release}
b4ad114
%description devel
b4ad114
This package provides header and library files of libnuml.
b4ad114
7ac6ab5
%package static
7ac6ab5
Summary: Library that fully supports NUML
7ac6ab5
Provides: %{name}-static = %{version}-%{release}
7ac6ab5
%description static
7ac6ab5
This package provides static library of libnuml.
7ac6ab5
b4ad114
%if 0%{?with_python2}
b4ad114
%package -n python2-libnuml
b4ad114
Summary: Python2 library that fully supports NUML
b4ad114
BuildRequires: python2-devel
b4ad114
%{?python_provide:%python_provide python2-%{name}}
b4ad114
%description -n python2-libnuml
b4ad114
The %{octpkg} python package contains the libraries to 
b4ad114
develop applications with libNUML Python2 bindings.
b4ad114
%endif
b4ad114
b4ad114
%if 0%{?with_python3}
b4ad114
%package -n python3-libnuml
b4ad114
Summary: Python3 library that fully supports NUML
b4ad114
BuildRequires: python3-devel
b4ad114
%{?python_provide:%python_provide python3-%{name}}
b4ad114
%description -n python3-libnuml
b4ad114
The %{octpkg} python package contains the libraries to 
b4ad114
develop applications with libNUML Python3 bindings.
b4ad114
%endif
b4ad114
b4ad114
%if 0%{?with_java}
b4ad114
%package -n java-%{octpkg}
b4ad114
Summary: Java library that fully supports NUML
b4ad114
BuildRequires:  java-1.8.0-openjdk-devel
df024e2
BuildRequires:  java-devel, javapackages-tools
b4ad114
Requires:       java-headless
b4ad114
Requires:       jpackage-utils
b4ad114
%description -n java-%{octpkg}
b4ad114
The %{octpkg} java package contains the libraries to 
b4ad114
develop applications with libNUML Java bindings.
b4ad114
%endif
b4ad114
b4ad114
%if 0%{?with_octave}
b4ad114
%package -n octave-%{octpkg}
b4ad114
Summary: Octave library that fully supports NUML
b4ad114
BuildRequires:  octave-devel
b4ad114
Requires:       octave(api) = %{octave_api}
b4ad114
Requires(post): octave
b4ad114
Requires(postun): octave
b4ad114
%description -n octave-%{octpkg}
b4ad114
The %{octpkg} octave package contains the libraries to 
b4ad114
develop applications with libNUML Octave bindings.
b4ad114
%endif
b4ad114
b4ad114
%if 0%{?with_perl}
b4ad114
%package -n perl-%{octpkg}
b4ad114
Summary: Perl library that fully supports NUML
b4ad114
BuildRequires: perl-interpreter
b4ad114
BuildRequires: perl-devel
b4ad114
BuildRequires: perl-generators
b4ad114
BuildRequires: perl(ExtUtils::MakeMaker)
b4ad114
BuildRequires: perl(Test::More)
b4ad114
Requires:      perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
b4ad114
%description -n perl-%{octpkg}
b4ad114
The %{octpkg} perl package contains the libraries to 
b4ad114
develop applications with libNUML Perl bindings.
b4ad114
%endif
b4ad114
b4ad114
%if 0%{?with_ruby}
b4ad114
%package -n ruby-%{octpkg}
b4ad114
Summary: Ruby library that fully supports NUML
b4ad114
BuildRequires: ruby-devel
b4ad114
Requires: ruby(release)
b4ad114
Provides: ruby(NUML) = %{version}
b4ad114
%description -n ruby-%{octpkg}
b4ad114
The %{octpkg} ruby package contains the libraries to 
b4ad114
develop applications with libNUML Ruby bindings.
b4ad114
%endif
b4ad114
b4ad114
%if 0%{?with_r}
b4ad114
%package -n R-%{octpkg}
b4ad114
Summary: R library that fully supports NUML
b4ad114
BuildRequires: R-devel, R-core-devel, tex(latex)
b4ad114
Requires:      R-core
b4ad114
%description -n R-%{octpkg}
b4ad114
The %{octpkg} R package contains the libraries to 
b4ad114
develop applications with libNUML R bindings.
b4ad114
%endif
b4ad114
b4ad114
%if 0%{?with_mono}
b4ad114
%package sharp
b4ad114
Summary: Mono library that fully supports NUML
b4ad114
BuildRequires: xerces-c-devel, libxml2-devel, expat-devel
b4ad114
BuildRequires: mono-core
b4ad114
Requires: mono-core
b4ad114
%description sharp
b4ad114
The %{octpkg} csharp package contains the libraries to 
b4ad114
develop applications with libNUML C# bindings.
b4ad114
%endif
b4ad114
b4ad114
%if 0%{?with_doc}
b4ad114
%package doc
b4ad114
Summary: Library that fully supports NUML
b4ad114
BuildRequires: doxygen
b4ad114
BuildArch: noarch
b4ad114
%description doc
b4ad114
The %{octpkg} doc package contains the HTML documentation
b4ad114
of libNUML libraries.
b4ad114
%endif
b4ad114
b4ad114
%prep
b4ad114
%setup -n libNUML-%{version}-Source -q
b4ad114
%patch0
b4ad114
sed -e 's| lib | %{_lib} |g' -i CMakeLists.txt
b4ad114
sed -e 's| lib/cmake | %{_lib}/cmake |g' -i CMakeLists.txt
b4ad114
b4ad114
%build
b4ad114
%if 0%{?with_python3}
b4ad114
mkdir build2 && pushd build2
b4ad114
%cmake -Wno-dev \
b4ad114
 -DWITH_PYTHON:BOOL=ON \
b4ad114
 -DWITH_SWIG:BOOL=ON \
b4ad114
 -DPYTHON_EXECUTABLE:FILEPATH=%{__python3} \
b4ad114
 -DPYTHON_INCLUDE_DIR:PATH=%{_includedir}/python%{python3_version}m \
b4ad114
 -DPYTHON_LIBRARY:FILEPATH=%{_libdir}/libpython%{python3_version}m.so \
b4ad114
%if 0%{?with_java}
b4ad114
 -DWITH_JAVA:BOOL=OFF \
b4ad114
 -DWITH_SWIG:BOOL=OFF \
b4ad114
%endif
b4ad114
%if 0%{?with_octave}
b4ad114
 -DWITH_OCTAVE:BOOL=OFF \
b4ad114
%endif
b4ad114
%if 0%{?with_perl}
b4ad114
 -DWITH_PERL:BOOL=OFF \
b4ad114
%endif
b4ad114
%if 0%{?with_ruby}
b4ad114
 -DWITH_RUBY:BOOL=OFF \
b4ad114
%endif
b4ad114
%if 0%{?with_r}
b4ad114
 -DWITH_R:BOOL=OFF \
b4ad114
 -DR_INCLUDE_DIRS:PATH=%{_includedir}/R \
b4ad114
%endif
b4ad114
%if 0%{?with_mono}
b4ad114
 -DWITH_CSHARP:BOOL=OFF \
b4ad114
 -DWITH_SWIG:BOOL=OFF \
b4ad114
%endif
b4ad114
 -DCSHARP_COMPILER:FILEPATH=%{_bindir}/mcs \
b4ad114
%if 0%{?with_doc}
b4ad114
 -DWITH_DOXYGEN:BOOL=OFF \
b4ad114
%endif
b4ad114
%if 0%{?with_check}
b4ad114
 -DWITH_CHECK:BOOL=ON \
b4ad114
 -DWITH_EXAMPLES:BOOL=ON \
b4ad114
%endif
b4ad114
 -DLIBSBML_LIBRARY:FILEPATH=%{_libdir}/libsbml.so -DLIBSBML_INCLUDE_DIR:PATH=%{_includedir} \
b4ad114
 -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} \
b4ad114
 -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} -DLIBNUML_SHARED_VERSION:BOOL=ON \
b4ad114
 -DEXTRA_LIBS:STRING="sbml;xml2;bz2;z;m;dl" -DLIBSBML_STATIC:BOOL=OFF \
b4ad114
 -DCMAKE_CXX_FLAGS_RELEASE:STRING="-I%{_includedir}/libxml2" \
b4ad114
 -DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE -DCMAKE_COLOR_MAKEFILE:BOOL=ON \
b4ad114
 -DCPACK_BINARY_TZ:BOOL=OFF -DCPACK_BINARY_TGZ:BOOL=OFF \
b4ad114
 -DCPACK_SOURCE_TBZ2:BOOL=OFF -DCPACK_SOURCE_TGZ:BOOL=OFF \
b4ad114
 -DCPACK_SOURCE_TZ:BOOL=OFF -DWITH_ZLIB:BOOL=ON -DWITH_CPP_NAMESPACE:BOOL=OFF \
b4ad114
 -DCMAKE_SKIP_RPATH:BOOL=YES -DCMAKE_SKIP_INSTALL_RPATH:BOOL=YES ..
b4ad114
b4ad114
%make_build
b4ad114
popd
b4ad114
%endif
b4ad114
b4ad114
######################################################################################################
b4ad114
## ----> Move to build directory ##
b4ad114
b4ad114
mkdir build && pushd build
b4ad114
%cmake -Wno-dev \
b4ad114
%if 0%{?with_python2}
b4ad114
 -DWITH_PYTHON:BOOL=ON \
b4ad114
 -DWITH_SWIG:BOOL=ON \
b4ad114
 -DPYTHON_EXECUTABLE:FILEPATH=%{__python2} \
b4ad114
 -DPYTHON_INCLUDE_DIR:PATH=%{_includedir}/python%{python2_version} \
b4ad114
 -DPYTHON_LIBRARY:FILEPATH=%{_libdir}/libpython%{python2_version}.so \
b4ad114
%endif
b4ad114
%if 0%{?with_java}
b4ad114
 -DWITH_JAVA:BOOL=ON \
b4ad114
 -DWITH_SWIG:BOOL=ON \
b4ad114
%endif
b4ad114
%if 0%{?with_octave}
b4ad114
 -DWITH_OCTAVE:BOOL=ON \
b4ad114
%endif
b4ad114
%if 0%{?with_perl}
b4ad114
 -DWITH_PERL:BOOL=ON \
b4ad114
%endif
b4ad114
%if 0%{?with_ruby}
b4ad114
 -DWITH_RUBY:BOOL=ON \
b4ad114
%endif
b4ad114
%if 0%{?with_r}
b4ad114
 -DWITH_R:BOOL=ON \
b4ad114
 -DR_INCLUDE_DIRS:PATH=%{_includedir}/R \
b4ad114
%endif
b4ad114
%if 0%{?with_mono}
b4ad114
 -DWITH_CSHARP:BOOL=ON \
b4ad114
 -DWITH_SWIG:BOOL=ON \
b4ad114
%endif
b4ad114
 -DCSHARP_COMPILER:FILEPATH=%{_bindir}/mcs \
b4ad114
%if 0%{?with_doc}
b4ad114
 -DWITH_DOXYGEN:BOOL=ON \
b4ad114
%endif
b4ad114
%if 0%{?with_check}
b4ad114
 -DWITH_CHECK:BOOL=ON \
b4ad114
 -DWITH_EXAMPLES:BOOL=ON \
b4ad114
%endif
b4ad114
 -DLIBSBML_LIBRARY:FILEPATH=%{_libdir}/libsbml.so -DLIBSBML_INCLUDE_DIR:PATH=%{_includedir} \
b4ad114
 -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} \
b4ad114
 -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} -DLIBNUML_SHARED_VERSION:BOOL=ON \
b4ad114
 -DEXTRA_LIBS:STRING="sbml;xml2;bz2;z;m;dl" -DLIBSBML_STATIC:BOOL=OFF \
b4ad114
 -DCMAKE_CXX_FLAGS_RELEASE:STRING="-I%{_includedir}/libxml2" \
b4ad114
 -DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE -DCMAKE_COLOR_MAKEFILE:BOOL=ON \
b4ad114
 -DCPACK_BINARY_TZ:BOOL=OFF -DCPACK_BINARY_TGZ:BOOL=OFF \
b4ad114
 -DCPACK_SOURCE_TBZ2:BOOL=OFF -DCPACK_SOURCE_TGZ:BOOL=OFF \
b4ad114
 -DCPACK_SOURCE_TZ:BOOL=OFF -DWITH_ZLIB:BOOL=ON -DWITH_CPP_NAMESPACE:BOOL=OFF \
b4ad114
 -DCMAKE_SKIP_RPATH:BOOL=YES -DCMAKE_SKIP_INSTALL_RPATH:BOOL=YES ..
b4ad114
b4ad114
##'Parallel make' breaks Java library's building
b4ad114
%if 0%{?with_java}
b4ad114
make -j1
b4ad114
%else
b4ad114
%make_build
b4ad114
%endif
b4ad114
popd
b4ad114
b4ad114
%if 0%{?with_doc}
b4ad114
doxygen
b4ad114
%endif
b4ad114
b4ad114
####################################################################################################
b4ad114
b4ad114
%install
b4ad114
%make_install -C build
b4ad114
b4ad114
%if 0%{?with_python3}
b4ad114
%make_install -C build2
b4ad114
%endif
b4ad114
b4ad114
mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}
b4ad114
b4ad114
##Only for R library
b4ad114
%if 0%{?with_r}
b4ad114
mkdir -p $RPM_BUILD_ROOT%{_libdir}/R/library
b4ad114
%{_bindir}/R CMD INSTALL -l $RPM_BUILD_ROOT%{_libdir}/R/library build/bindings/r/libNUML_%{version}_R_*.tar.gz
b4ad114
test -d %{octpkg}/src && (cd %{octpkg}/src; rm -f *.o *.so)
b4ad114
rm -rf $RPM_BUILD_ROOT%{_libdir}/R/library/%{octpkg}/R.css
b4ad114
b4ad114
# Make symlink instead hard-link
b4ad114
ln -sf %{_libdir}/libNUML.so $RPM_BUILD_ROOT%{_libdir}/R/library/libNUML/libs/libNUML.so
b4ad114
%endif
b4ad114
##
b4ad114
b4ad114
%if 0%{?with_octave}
b4ad114
mkdir -p $RPM_BUILD_ROOT%{octpkgdir}/packinfo
b4ad114
install -pm 644 LICENSE.txt *.md $RPM_BUILD_ROOT%{octpkgdir}/packinfo
b4ad114
%endif
b4ad114
b4ad114
%if 0%{?with_java}
b4ad114
mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{name}
b4ad114
mkdir -p $RPM_BUILD_ROOT%{_jnidir}
b4ad114
mv $RPM_BUILD_ROOT%{_libdir}/libnumlj.so $RPM_BUILD_ROOT%{_libdir}/%{name}/
b4ad114
ln -sf %{_libdir}/%{name}/libnumlj.so $RPM_BUILD_ROOT%{_jnidir}/libnumlj.so
b4ad114
%endif
b4ad114
b4ad114
## Remove libtool archives
b4ad114
find $RPM_BUILD_ROOT -name '*.la' -delete
b4ad114
6acfefc
%ldconfig_scriptlets
b4ad114
b4ad114
%if 0%{?with_r}
3dbb69f
%ldconfig_scriptlets -n R-%{octpkg}
b4ad114
%endif
b4ad114
b4ad114
%if 0%{?with_octave}
b4ad114
%post -n octave-%{octpkg}
b4ad114
%octave_cmd pkg rebuild
b4ad114
b4ad114
%postun -n octave-%{octpkg}
b4ad114
%octave_cmd pkg rebuild
b4ad114
b4ad114
%preun -n octave-%{octpkg}
b4ad114
%octave_pkg_preun
b4ad114
%endif
b4ad114
b4ad114
%if 0%{?with_check}
b4ad114
%check
b4ad114
make test -C build2
b4ad114
%endif
b4ad114
b4ad114
%files
b4ad114
%doc *.md
b4ad114
%license LICENSE.txt
b4ad114
%{_libdir}/libnuml.so.*
b4ad114
%if 0%{?with_check}
b4ad114
%exclude %{_datadir}/%{name}
b4ad114
%endif
b4ad114
b4ad114
%files devel
b4ad114
%{_libdir}/%{name}.so
7ac6ab5
%{_libdir}/cmake/numl-config*.cmake
b4ad114
%{_includedir}/numl/
b4ad114
7ac6ab5
%files static
7ac6ab5
%doc *.md
7ac6ab5
%license LICENSE.txt
7ac6ab5
%{_libdir}/%{name}-static.a
7ac6ab5
%{_libdir}/cmake/numl-static-config*.cmake
7ac6ab5
b4ad114
%if 0%{?with_python2}
b4ad114
%files -n python2-%{name}
b4ad114
%doc *.md
b4ad114
%license LICENSE.txt
b4ad114
%{python2_sitearch}/%{name}/
b4ad114
%{python2_sitearch}/*.pth
b4ad114
%endif
b4ad114
b4ad114
%if 0%{?with_python3}
b4ad114
%files -n python3-%{name}
b4ad114
%doc *.md
b4ad114
%license LICENSE.txt
b4ad114
%{python3_sitearch}/%{name}/
b4ad114
%{python3_sitearch}/*.pth
b4ad114
%endif
b4ad114
b4ad114
%if 0%{?with_java}
b4ad114
%files -n java-%{octpkg}
b4ad114
%{_javadir}/libnumlj.jar
b4ad114
%{_jnidir}/libnumlj.so
b4ad114
%{_libdir}/%{name}/
b4ad114
%endif
b4ad114
b4ad114
%if 0%{?with_octave}
b4ad114
%files -n octave-%{octpkg}
b4ad114
%{octpkgdir}/packinfo
b4ad114
%{octpkglibdir}/
b4ad114
%endif
b4ad114
b4ad114
%if 0%{?with_perl}
b4ad114
%files -n perl-%{octpkg}
b4ad114
%doc *.md
b4ad114
%license LICENSE.txt
b4ad114
%{perl_vendorarch}/LibNUML.*
b4ad114
%exclude %dir %{perl_vendorarch}/auto/
b4ad114
%{perl_vendorarch}/auto/libNUML/
b4ad114
%endif
b4ad114
b4ad114
%if 0%{?with_ruby}
b4ad114
%files -n ruby-%{octpkg}
b4ad114
%doc *.md
b4ad114
%license LICENSE.txt
b4ad114
%{ruby_vendorarchdir}/*.so
b4ad114
%endif
b4ad114
b4ad114
%if 0%{?with_r}
b4ad114
%files -n R-%{octpkg}
b4ad114
%doc *.md
b4ad114
%license LICENSE.txt
b4ad114
%{_libdir}/R/library/libNUML/
b4ad114
%{_libdir}/libNUML.so
b4ad114
%endif
b4ad114
b4ad114
%if 0%{?with_mono}
b4ad114
%files sharp
b4ad114
%doc *.md
b4ad114
%license LICENSE.txt
b4ad114
#%%{_monogacdir}/libnumlcsP
b4ad114
%{_monodir}/LibnumlcsP/
b4ad114
%endif
b4ad114
b4ad114
%if 0%{?with_doc}
b4ad114
%files doc
b4ad114
%license LICENSE.txt
b4ad114
%doc doc/html
b4ad114
%endif
b4ad114
b4ad114
%changelog
20411e9
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.1-10
20411e9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
20411e9
6c7f843
* Tue Jun 19 2018 Miro HronĨok <mhroncok@redhat.com> - 1.1.1-9
6c7f843
- Rebuilt for Python 3.7
6c7f843
df024e2
* Tue Jun 05 2018 Antonio Trande <sagitterATfedoraproject.org> - 1.1.1-8
df024e2
- Rebuild for libsbml-5.17.0
df024e2
- Add javapackages-tools
df024e2
1713b6d
* Thu Feb 22 2018 Antonio Trande <sagitterATfedoraproject.org> - 1.1.1-7
1713b6d
- Add gcc gcc-c++ BR
1713b6d
3dbb69f
* Thu Feb 15 2018 Antonio Trande <sagitterATfedoraproject.org> - 1.1.1-6
3dbb69f
- Fix %%ldconfig_scriptlets for sub-package
3dbb69f
6acfefc
* Thu Feb 15 2018 Antonio Trande <sagitterATfedoraproject.org> - 1.1.1-5
6acfefc
- Rebuild for libsbml-5.16.0
6acfefc
- Use %%ldconfig_scriptlets
6acfefc
955592e
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.1-4
955592e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
955592e
7ac6ab5
* Tue Oct 03 2017 Antonio Trande <sagitterATfedoraproject.org> - 1.1.1-3
7ac6ab5
- Created a static sub-package
7ac6ab5
b4ad114
* Fri Sep 29 2017 Antonio Trande <sagitterATfedoraproject.org> - 1.1.1-2
b4ad114
- Created a documentation sub-package
b4ad114
- Java shared library moved into a private lib directory
b4ad114
- Java shared library symlinked from /usr/lib/java
b4ad114
b4ad114
* Thu Sep 28 2017 Antonio Trande <sagitterATfedoraproject.org> - 1.1.1-1
b4ad114
- First package