d3a5488
%global upstream_name ofxparse
d3a5488
d3a5488
%if 0%{?fedora} || 0%{?rhel} > 6
d3a5488
%bcond_without python3
d3a5488
%else
d3a5488
%bcond_with python3
8d64d8e
%{!?__python2: %global __python2 %{__python}}
8d64d8e
%{!?python2_sitelib: %global python2_sitelib %{python_sitelib}}
d3a5488
%endif
d3a5488
d3a5488
Name:           python-%{upstream_name}
a7e8160
Version:        0.14
fff725f
Release:        2%{?dist}
d3a5488
Summary:        Python library for working with the OFX (Open Financial Exchange) file format
d3a5488
License:        MIT
d3a5488
URL:            http://sites.google.com/site/ofxparse
d3a5488
Source0:        http://pypi.python.org/packages/source/o/%{upstream_name}/%{upstream_name}-%{version}.tar.gz
d3a5488
BuildArch:      noarch
d3a5488
BuildRequires:  python2-devel
d3a5488
BuildRequires:  python-setuptools
d3a5488
BuildRequires:  python-nose
a7e8160
BuildRequires:  python-beautifulsoup4
fff725f
BuildRequires:  python-six
d3a5488
%if %{with python3}
d3a5488
BuildRequires:  python3-devel
d3a5488
BuildRequires:  python3-setuptools
d3a5488
BuildRequires:  python3-nose
a7e8160
BuildRequires:  python3-beautifulsoup4
a7e8160
BuildRequires:  python3-six
d3a5488
%endif
fff725f
Requires:       python-six
a7e8160
Requires:       python-beautifulsoup4
d3a5488
d3a5488
%description
d3a5488
ofxparse is a parser for Open Financial Exchange (.ofx) format files. OFX files 
d3a5488
are available from almost any online banking site, so they work well if you 
d3a5488
want to pull together your finances from multiple sources. Online trading 
d3a5488
accounts also provide account statements in OFX files.
d3a5488
d3a5488
%if %{with python3}
d3a5488
%package -n python3-%{upstream_name}
d3a5488
Summary:        Python 3 library for working with the OFX (Open Financial Exchange) file format
a7e8160
Requires:       python3-beautifulsoup4
a7e8160
Requires:       python3-six
d3a5488
d3a5488
%description -n python3-%{upstream_name}
d3a5488
ofxparse is a parser for Open Financial Exchange (.ofx) format files. OFX files 
d3a5488
are available from almost any online banking site, so they work well if you 
d3a5488
want to pull together your finances from multiple sources. Online trading 
d3a5488
accounts also provide account statements in OFX files.
d3a5488
%endif
d3a5488
d3a5488
%prep
d3a5488
%setup -q -n %{upstream_name}-%{version}
d3a5488
rm -rf %{upstream_name}.egg-info
d3a5488
d3a5488
%if %{with python3}
d3a5488
rm -rf %{py3dir}
d3a5488
cp -a . %{py3dir}
d3a5488
%endif
d3a5488
d3a5488
%build
8d64d8e
%{__python2} setup.py build
d3a5488
d3a5488
%if %{with python3}
d3a5488
pushd %{py3dir}
d3a5488
%{__python3} setup.py build
d3a5488
popd
d3a5488
%endif
d3a5488
d3a5488
%install
d3a5488
%if %{with python3}
d3a5488
pushd %{py3dir}
d3a5488
%{__python3} setup.py install --skip-build --root %{buildroot}
d3a5488
popd
d3a5488
%endif
d3a5488
8d64d8e
%{__python2} setup.py install --skip-build --root %{buildroot}
d3a5488
a7e8160
%check
8d64d8e
%{__python2} setup.py test
a7e8160
a7e8160
%if %{with python3}
a7e8160
pushd %{py3dir}
a7e8160
%{__python3} setup.py test
a7e8160
popd
a7e8160
%endif
d3a5488
d3a5488
%files
d3a5488
%doc README LICENSE
8d64d8e
%{python2_sitelib}/%{upstream_name}
8d64d8e
%{python2_sitelib}/%{upstream_name}*.egg-info
d3a5488
d3a5488
%if %{with python3}
d3a5488
%files -n python3-%{upstream_name}
d3a5488
%doc README LICENSE
d3a5488
%{python3_sitelib}/%{upstream_name}
d3a5488
%{python3_sitelib}/%{upstream_name}*.egg-info
d3a5488
%endif
d3a5488
d3a5488
%changelog
fff725f
* Tue Jan 07 2014 Dan Callaghan <dcallagh@redhat.com> - 0.14-2
fff725f
- six is needed on Python 2 also
fff725f
a7e8160
* Fri Dec 27 2013 Dan Callaghan <dcallagh@redhat.com> - 0.14-1
a7e8160
- upstream release 0.14
a7e8160
d3a5488
* Wed Aug 14 2013 Dan Callaghan <dcallagh@redhat.com> - 0.12-1
d3a5488
- initial version