%global sum Python library to write SQL queries
%global module_name sql
Name: python-%{module_name}
Version: 0.9
Release: 3%{?dist}
Summary: %{sum}
License: BSD
URL: http://pypi.python.org/pypi/%{name}
Source0: https://files.pythonhosted.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python2-devel python3-devel
BuildRequires: python2-tools
%description
%{name} is a library to write SQL queries in a pythonic way.
%package -n python2-%{module_name}
Summary: %{sum}
%{?python_provide:%python_provide python2-%{name}}
%description -n python2-%{module_name}
%{name} is a library to write SQL queries in a pythonic way.
%package -n python3-%{module_name}
Summary: %{sum}
%{?python_provide:%python_provide python3-%{name}}
%description -n python3-%{module_name}
%{name} is a library to write SQL queries in a pythonic way.
%prep
%setup -q -c
# remove upstream egg-info
rm -rf */*.egg-info
mv %{name}-%{version} python2
cp -a python2 python3
%build
# separate dirs because 2to3 is used
pushd python2
%py2_build
popd
pushd python3
%py3_build
popd
%install
pushd python2
%py2_install
popd
pushd python3
%py3_install
popd
%check
pushd python2
%{__python2} setup.py test
popd
pushd python3
%{__python3} setup.py test
popd
%files -n python2-%{module_name}
%doc python2/{CHANGELOG,README}
%{python2_sitelib}/*
%exclude %{python2_sitelib}/*/tests
%files -n python3-%{module_name}
%doc python3/{CHANGELOG,README}
%{python3_sitelib}/*
%exclude %{python3_sitelib}/*/tests
%changelog
* Tue Jan 30 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.9-3
- Update Python 2 dependency declarations to new packaging standards
(See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Thu May 11 2017 Dan Horák <dan[at]danny.cz> - 0.9-1
- updated to 0.9 (#1444846)
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.8-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.8-4
- Rebuild for Python 3.6
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.8-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Wed Jan 06 2016 Dan Horák <dan[at]danny.cz> - 0.8-2
- remove upstream egg-info
* Tue Dec 29 2015 Dan Horák <dan[at]danny.cz> - 0.8-1
- initial Fedora package