%global srcname sparqlwrapper %global modname SPARQLWrapper Name: python-%{srcname} Version: 1.8.0 Release: 1%{?dist} Summary: Wrapper for a remote SPARQL endpoint License: W3C URL: https://rdflib.github.io/sparqlwrapper/ Source0: https://github.com/RDFLib/sparqlwrapper/archive/%{version}/%{srcname}-%{version}.tar.gz BuildArch: noarch %global _description \ SPARQLWrapper is a simple Python wrapper around a SPARQL service to remotely\ execute your queries. It helps in creating the query invocation and, possibly,\ convert the result into a more manageable format. %description %{_description} %package -n python2-%{srcname} Summary: %{summary} %{?python_provide:%python_provide python2-%{srcname}} BuildRequires: python2-devel BuildRequires: python2-setuptools BuildRequires: python2-nose Requires: python2-rdflib %description -n python2-%{srcname} %{_description} Python 2 version. %package -n python3-%{srcname} Summary: %{summary} %{?python_provide:%python_provide python3-%{srcname}} BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-nose Requires: python3-rdflib %description -n python3-%{srcname} %{_description} Python 3 version. %prep %autosetup -c mv %{srcname}-%{version} python2 cp -a python2/{LICENSE.txt,README.md,ChangeLog.txt,AUTHORS.md} . cp -a python2 python3 2to3 -w -n python3 # https://github.com/RDFLib/sparqlwrapper/issues/81 find python3 -type f -name '*.py' -exec sed -i -e 's/urllib2._opener/urllib.request._opener/g' {} ';' %build pushd python2 %py2_build popd pushd python3 %py3_build popd %install pushd python2 %py2_install popd pushd python3 %py3_install popd %check pushd python2 nosetests-%{python2_version} -v popd pushd python3 nosetests-%{python3_version} -v popd %files -n python2-%{srcname} %license LICENSE.txt %doc README.md ChangeLog.txt AUTHORS.md %{python2_sitelib}/%{modname}-*.egg-info/ %{python2_sitelib}/%{modname}/ %files -n python3-%{srcname} %license LICENSE.txt %doc README.md ChangeLog.txt AUTHORS.md %{python3_sitelib}/%{modname}-*.egg-info/ %{python3_sitelib}/%{modname}/ %changelog * Tue Jan 03 2017 Igor Gnatenko - 1.8.0-1 - Initial package