diff --git a/libsbml.spec b/libsbml.spec index 0b818fa..ed471cd 100644 --- a/libsbml.spec +++ b/libsbml.spec @@ -1,3 +1,7 @@ +%if 0%{?fedora} <= 22 +%global _hardened_build 1 +%endif + %bcond_without perl %bcond_without ruby %bcond_without octave @@ -5,6 +9,10 @@ %bcond_without python3 %bcond_without python2 +## Make python?_shortver macros +%{!?python2_shortver: %global python2_shortver %(%{__python2} -c 'import sys; print(str(sys.version_info.major) + "." + str(sys.version_info.minor))')} +%{!?python3_shortver: %global python3_shortver %(%{__python3} -c 'import sys; print(str(sys.version_info.major) + "." + str(sys.version_info.minor))')} + ##Arches not supported by upstream %if 0%{?fedora} > 22 %ifnarch %{arm} aarch64 s390x ppc64 ppc64le @@ -40,17 +48,11 @@ Name: libsbml Version: 5.11.6 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Systems Biology Markup Language library License: LGPLv2+ URL: http://sbml.org/Software/libSBML - -## Source archive from svn #22272; obtained by: -## svn checkout http://svn.code.sf.net/p/sbml/code/trunk/libsbml sbml-code -## tar -czvf libsbml-svn22272.tar.gz sbml-code -## - Source0: http://sourceforge.net/projects/sbml/files/libsbml/%{version}-experimental/source/libSBML-%{version}-core-plus-packages-src.tar.gz Source1: http://sourceforge.net/projects/sbml/files/libsbml/%{version}-experimental/source/beta%20packages/render-%{version}-beta-1.zip @@ -95,6 +97,8 @@ BuildRequires: python2-devel Summary: Python 2 bindings for libSBML Requires: %{name}%{?_isa} = %{version}-%{release} +%{?python_provide:%python_provide python2-%{name}} + %description -n python-%{name} This package contains %{summary}. @@ -116,6 +120,9 @@ This is the version for Python 3. %package -n perl-%{perlpkg} BuildRequires: perl(Test::More) BuildRequires: perl(ExtUtils::MakeMaker) +%if 0%{?fedora} > 22 +BuildRequires: perl-Test +%endif Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) Summary: PERL bindings for libSBML Requires: %{name}%{?_isa} = %{version}-%{release} @@ -228,10 +235,14 @@ mkdir build-docs cp -a $(/bin/ls -1|grep -v build-docs) build-docs/ %build -mkdir build2 build +mkdir -p build2 build pushd build2 - export LDFLAGS="%{__global_ldflags} -Wl,--as-needed" +##clang does not support GCC linker flags +%ifnarch x86_64 || 0%{?fedora} > 22 +export CFLAGS="$RPM_OPT_FLAGS $RPM_LD_FLAGS -Wl,-z,now" +export CXXFLAGS="$RPM_OPT_FLAGS $RPM_LD_FLAGS -Wl,-z,now" +%endif %if %{with python2} # This build is only for Python 2 %cmake -DENABLE_{LAYOUT,QUAL,COMP,FBC,RENDER}=ON \ @@ -241,12 +252,12 @@ export LDFLAGS="%{__global_ldflags} -Wl,--as-needed" %endif -DCSHARP_COMPILER:FILEPATH=%{_bindir}/mcs \ %endif - -DWITH_PYTHON=ON \ + -DWITH_PYTHON:BOOL=ON \ %if %{with check} -DWITH_CHECK=ON \ %endif - -DPYTHON_INCLUDE_DIR:PATH=$(pkg-config --cflags python2|sed s/-I//) \ - -DPYTHON_LIBRARY:FILEPATH=$(pkg-config --libs python2) \ + -DPYTHON_INCLUDE_DIR:PATH=%{_includedir}/python%{python2_version} \ + -DPYTHON_LIBRARY:FILEPATH=%{_libdir}/libpython%{python2_version}.so \ -DPYTHON_EXECUTABLE:FILEPATH=%{__python2} \ -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} \ -DWITH_LIBXML:BOOL=ON \ @@ -258,6 +269,10 @@ make %{?_smp_mflags} pushd ../build export LDFLAGS="%{__global_ldflags} -Wl,--as-needed" +%ifnarch x86_64 || 0%{?fedora} > 22 +export CFLAGS="$RPM_OPT_FLAGS $RPM_LD_FLAGS -Wl,-z,now" +export CXXFLAGS="$RPM_OPT_FLAGS $RPM_LD_FLAGS -Wl,-z,now" +%endif %cmake -DENABLE_{LAYOUT,QUAL,COMP,FBC,RENDER}=ON \ %if 0%{?fedora} > 22 %ifarch x86_64 @@ -266,30 +281,33 @@ export LDFLAGS="%{__global_ldflags} -Wl,--as-needed" -DCSHARP_COMPILER:FILEPATH=%{_bindir}/mcs \ %endif %if %{with python3} - -DWITH_PYTHON=ON \ - -DPYTHON_INCLUDE_DIR:PATH=$(pkg-config --cflags python3|sed s/-I//) \ - -DPYTHON_LIBRARY:FILEPATH=$(pkg-config --libs python3) \ + -DWITH_PYTHON:BOOL=ON \ + -DPYTHON_INCLUDE_DIR:PATH=%{_includedir}/python%{python3_version}m \ + -DPYTHON_LIBRARY:FILEPATH=%{_libdir}/libpython%{python3_version}m.so \ -DPYTHON_EXECUTABLE:FILEPATH=%{__python3} \ %endif %if %{with perl} - -DWITH_PERL=ON \ + -DWITH_PERL:BOOL=ON \ + -DPERL_EXECUTABLE:FILEPATH=%{_bindir}/perl \ + -DPERL_INCLUDE_PATH:PATH=%{_libdir}/perl5/CORE \ + -DPERL_LIBRARY:FILEPATH=%{_libdir}/libperl.so \ %endif %if %{with ruby} - -DWITH_RUBY=ON \ + -DWITH_RUBY:BOOL=ON \ %endif %if %{with java} - -DWITH_JAVA=ON \ + -DWITH_JAVA:BOOL=ON \ -DWITH_JAVASCRIPT:BOOL=OFF \ -DWITH_SWIG:BOOL=ON \ %endif %if %{with octave} - -DWITH_OCTAVE=ON \ + -DWITH_OCTAVE:BOOL=ON \ %endif %if %{with octave} - -DWITH_OCTAVE=ON \ + -DWITH_OCTAVE:BOOL=ON \ %endif %if %{with r} - -DWITH_R=ON \ + -DWITH_R:BOOL=ON \ -DR_INCLUDE_DIRS:PATH=%{_includedir}/R \ %endif %if %{with mono} @@ -308,7 +326,7 @@ export LDFLAGS="%{__global_ldflags} -Wl,--as-needed" -DCMAKE_SKIP_INSTALL_RPATH:BOOL=YES \ -Wno-dev \ .. -make +make %{?_smp_mflags} pushd ../build-docs %configure --disable-static \ @@ -373,7 +391,7 @@ ctest --force-new-ctest-process -V -E "test_ruby_binding" ctest --force-new-ctest-process -V -E "test_csharp_bindings_full" %endif %ifnarch %{arm} ppc64 ppc64le -ctest --force-new-ctest-process -V +ctest --force-new-ctest-process -V -E "test_ruby_binding" %endif %endif @@ -461,8 +479,12 @@ ctest --force-new-ctest-process -V %changelog +* Wed Oct 28 2015 Antonio Trande - 5.11.6-5 +- Rebuild for cmake upgrade +- Disabled Perl and Ruby bindings test + * Mon Jul 27 2015 Antonio Trande - 5.11.6-4 -- Disabled 'parallel make' for language bindings +- Disabled 'parallel make' for language bindings * Mon Jul 27 2015 Antonio Trande - 5.11.6-3 - Compiled the core-plus source archive