Blob Blame Raw
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}

%global modname tw2.sqla

Name:           python-tw2-sqla
Version:        2.0.6
Release:        16%{?dist}
Summary:        SQLAlchemy database layer for ToscaWidgets2

License:        MIT
URL:            http://toscawidgets.org
Source0:        http://pypi.python.org/packages/source/t/%{modname}/%{modname}-%{version}.tar.gz
BuildArch:      noarch

# For building
BuildRequires:  python2-devel
BuildRequires:  python2-setuptools
BuildRequires:  python2-tw2-core >= 2.1.4
BuildRequires:  python2-tw2-forms >= 2.1.4.1
BuildRequires:  python2-tw2-dynforms
%if 0%{?rhel} && 0%{?rhel} <= 6
BuildRequires:  python-sqlalchemy0.7 >= 0.7
%else
BuildRequires:  python2-sqlalchemy >= 0.7
%endif
BuildRequires:  python2-zope-sqlalchemy

# For tests
BuildRequires:  python2-nose
BuildRequires:  python2-formencode
BuildRequires:  python2-beautifulsoup
BuildRequires:  python2-strainer
BuildRequires:  python2-webtest
BuildRequires:  python2-elixir
BuildRequires:  python2-sieve

# Templates for the test suite
BuildRequires:  python2-genshi
BuildRequires:  python2-mako
BuildRequires:  python2-chameleon
BuildRequires:  python2-kajiki
BuildRequires:  python2-jinja2

# It doesn't *actually* need these, but its setup.py claims it does.
# And so, we comply.
BuildRequires:  python2-turbokid
BuildRequires:  python2-turbocheetah


# Runtime requirements

%global _description\
tw2.sqla is a database layer for ToscaWidgets 2 and SQLAlchemy. It allows common\
database tasks to be achieved with minimal code.

%description %_description

%package -n python2-tw2-sqla
Summary: %summary
Requires:  python2-tw2-forms >= 2.1.4.1
Requires:  python2-tw2-dynforms
%if 0%{?rhel} && 0%{?rhel} <= 6
Requires:  python-sqlalchemy0.7 >= 0.7
%else
Requires:  python2-sqlalchemy >= 0.7
%endif
Requires:  python2-zope-sqlalchemy
%{?python_provide:%python_provide python2-tw2-sqla}

%description -n python2-tw2-sqla %_description

%prep
%setup -q -n %{modname}-%{version}

%if 0%{?rhel} && 0%{?rhel} <= 6

# Make sure that epel/rhel picks up the correct version of webob *and* SA
awk 'NR==1{print "import __main__; __main__.__requires__ = __requires__ = [\"WebOb>=1.0\", \"sqlalchemy>=0.7\"]; import pkg_resources"}1' setup.py > setup.py.tmp
mv setup.py.tmp setup.py

# Remove all the fancy nosetests configuration for older python
rm setup.cfg

%endif


%build
%py2_build

%install
%{__python} setup.py install -O1 --skip-build \
    --install-data=%{_datadir} --root %{buildroot}

# Disable tests for now.  They're failing upstream.
#%check
#%if 0%{?rhel}
## Don't actually run tests on el or f18.  There's an issue with python-elixir.
#%else
#PYTHONPATH=$(pwd) python setup.py test
#%endif

%files -n python2-tw2-sqla
%doc README.rst LICENSE
%{python2_sitelib}/tw2/sqla
%{python2_sitelib}/%{modname}-%{version}-*-nspkg.pth
%{python2_sitelib}/%{modname}-%{version}-*.egg-info

%changelog
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.6-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.6-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Wed Feb 28 2018 Iryna Shcherbina <ishcherb@redhat.com> - 2.0.6-14
- Update Python 2 dependency declarations to new packaging standards
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.6-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Sun Dec 17 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 2.0.6-12
- Python 2 binary package renamed to python2-tw2-sqla
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.6-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.6-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.6-9
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.6-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Mon Jul 06 2015 Ralph Bean <rbean@redhat.com> - 2.0.6-7
- Fix rhel conditionals... again?
- Add dep on python-sieve for tests.
- Disable tests.  They're failing upstream.

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.6-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Thu Nov 13 2014 Ralph Bean <rbean@redhat.com> - 2.0.6-5
- Fix rhel conditionals.

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.6-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.6-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Thu Feb 28 2013 Ralph Bean <rbean@redhat.com> - 2.0.6-2
- Conditionalize tests for rawhide.

* Fri Feb 22 2013 Ralph Bean <rbean@redhat.com> - 2.0.6-1
- Latest upstream.

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Fri May 04 2012 Ralph Bean <rbean@redhat.com> - 2.0.1-3
- Fixed (again) incorrect directory ownership.

* Thu May 03 2012 Ralph Bean <rbean@redhat.com> - 2.0.1-2
- Fixed directory ownership issue.

* Wed May 02 2012 Ralph Bean <rbean@redhat.com> - 2.0.1-1
- New upstream release, contains LICENSE.

* Wed May 02 2012 Ralph Bean <rbean@redhat.com> - 2.0.0-2
- Removed clean section
- Removed defattr in files section
- Removed unnecessary references to buildroot

* Wed Apr 11 2012 Ralph Bean <rbean@redhat.com> - 2.0.0-1
- Initial packaging for Fedora