Blob Blame History Raw
%global sum Python library to write SQL queries
%global module_name sql

Name:           python-%{module_name}
Version:        0.8
Release:        5%{?dist}
Summary:        %{sum}

License:        BSD
URL:            http://pypi.python.org/pypi/%{name}
Source0:        http://pypi.python.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz

BuildArch:      noarch
BuildRequires:  python2-devel python3-devel
BuildRequires:  python-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
* 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