diff --git a/gfal2-python.spec b/gfal2-python.spec index 2f2445d..6c2b306 100644 --- a/gfal2-python.spec +++ b/gfal2-python.spec @@ -1,5 +1,8 @@ -%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} +# Use static linking against boost +%bcond_with static_boost_python +# Doc directory +%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} #include boost > 141 for EL5 %if 0%{?el5} @@ -8,9 +11,18 @@ %global boost_cmake_flags -DBOOST_INCLUDEDIR=/usr/include %endif +# Python 3 +%if 0%{?fedora} >= 23 +%global with_python3 0 +%endif + # python path discovery %{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} +%if 0%{?with_python3} +%{!?python3_sitearch: %define python3_sitearch %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} +%endif + # python modules filtering %if 0%{?el6} || 0%{?el5} %{?filter_setup: @@ -18,25 +30,29 @@ %filter_setup } %else -%global __provides_exclude_from ^(%{python_sitearch}/.*\\.so)$ +%global __provides_exclude_from ^((%{python_sitearch})|(%{python3_sitearch})/.*\\.so)$ %endif Name: gfal2-python -Version: 1.9.1 +Version: 1.9.2 Release: 1%{?dist} Summary: Python bindings for gfal 2 Group: Applications/Internet License: ASL 2.0 URL: http://dmc.web.cern.ch/ -# git clone --branch master https://gitlab.cern.ch/dmc/gfal2-bindings.git gfal2-python-1.9.1 -# pushd gfal2-python-1.9.1 -# git checkout v1.9.1 +# git clone --branch master https://gitlab.cern.ch/dmc/gfal2-bindings.git gfal2-python-1.9.2 +# pushd gfal2-python-1.9.2 +# git checkout v1.9.2 # popd -# tar czf gfal2-python-1.9.1.tar.gz --exclude-vcs gfal2-python-1.9.1 +# tar czf gfal2-python-1.9.2.tar.gz --exclude-vcs gfal2-python-1.9.2 Source0: %{name}-%{version}.tar.gz BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) -BuildRequires: cmake +%if 0%{?el5} +BuildRequires: cmake28 +%else +BuildRequires: cmake +%endif BuildRequires: gfal2-devel >= 2.13.0 %if 0%{?el5} BuildRequires: boost141-devel @@ -48,6 +64,12 @@ BuildRequires: epydoc Requires: gfal2-core >= 2.13.0 +# Python 3 +%if 0%{?with_python3} +BuildRequires: python3-devel +BuildRequires: boost-python3-devel +%endif + %description Python bindings for gfal2. GFAL2 offers an a single, simple and portable API @@ -61,7 +83,18 @@ BuildArch: noarch %endif %description doc -Documentation files for %{name} . +Documentation files for %{name}. + +%if 0%{?with_python3} +%package -n gfal2-python3 +Summary: gfal2 python birngins for Python 3 +Group: Applications/Internet + +%description -n gfal2-python3 +Python 3 bindings for gfal2. +GFAL2 offers an a single, simple and portable API +for the file operations in grids and cloud environments. +%endif %clean rm -rf %{buildroot}; @@ -71,16 +104,43 @@ make clean %setup -q %build -%cmake \ --DDOC_INSTALL_DIR=%{_pkgdocdir} \ - %{boost_cmake_flags} \ - -DUNIT_TESTS=TRUE . +# Make sure the version in the spec file and the version used +# for building matches +gfal2_python_cmake_ver=`sed -n 's/^set *(VERSION_\(MAJOR\|MINOR\|PATCH\) *\([0-9]\+\).*/\2/p' CMakeLists.txt | paste -sd '.'` +gfal2_python_spec_ver=`expr "%{version}" : '\([0-9]*\\.[0-9]*\\.[0-9]*\)'` +if [ "$gfal2_python_cmake_ver=" != "$gfal2_python_spec_ver=" ]; then + echo "The version in the spec file does not match the CMakeLists.txt version!" + echo "$gfal2_python_cmake_ver!= %{version}" + exit 1 +fi + +%if 0%{?el5} + %cmake28 \ + -DDOC_INSTALL_DIR=%{_pkgdocdir} \ + %{boost_cmake_flags} \ +%if 0%{?with_static_boost_python} + -DBoost_USE_STATIC_LIBS=ON \ +%endif + -DUNIT_TESTS=TRUE . +%else + %cmake \ + -DDOC_INSTALL_DIR=%{_pkgdocdir} \ + %{boost_cmake_flags} \ +%if 0%{?with_static_boost_python} + -DBoost_USE_STATIC_LIBS=ON \ +%endif + -DUNIT_TESTS=TRUE . +%endif make %{?_smp_mflags} make doc %check -ctest -V -T Test . +%if 0%{?el5} + ctest28 -V -T Test . +%else + ctest -V -T Test . +%endif %install rm -rf %{buildroot} @@ -101,9 +161,18 @@ make DESTDIR=%{buildroot} install %{_pkgdocdir}/html/* %{_pkgdocdir}/examples/* +%if 0%{?with_python3} +%files -n gfal2-python3 +%defattr (-,root,root) +%{python3_sitearch}/gfal2.so +%endif + %changelog +* Mon Apr 03 2017 Alejandro Alvarez - 1.9.2-1 +- Update for release 1.9.2 + * Mon Feb 20 2017 Alejandro Alvarez - 1.9.1-1 -- Update for release 1.9.0 +- Update for release 1.9.1 * Fri Feb 10 2017 Fedora Release Engineering - 1.8.5-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild diff --git a/sources b/sources index 30f0a05..4a1c105 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (gfal2-python-1.9.1.tar.gz) = 81a9d14d7c6718cc564f5e4f61a9bdac88dc057c4ebd6d760b4a73fc9e0642e13c113050a7b98bc3b49a483722a7d00b3dce8216cf8e074dbfa2f05a9251d9f0 +SHA512 (gfal2-python-1.9.2.tar.gz) = c6feac3aa53bfd16bb7270860832a8cb7a9bd7bf0d74f602aa00c8dafb1914afd2711a36ed3b85371b0d2840ce3bad2d18df2ba59612d2ccd317bc1d0cf40da1