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