Blob Blame History Raw
%global upstream_name ofxparse

%if 0%{?fedora}
%bcond_without python3
%else
%bcond_with python3
%{!?__python2: %global __python2 %{__python}}
%{!?python2_sitelib: %global python2_sitelib %{python_sitelib}}
%endif

Name:           python-%{upstream_name}
Version:        0.14
Release:        4%{?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
BuildRequires:  python-six
%if %{with python3}
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  python3-nose
BuildRequires:  python3-beautifulsoup4
BuildRequires:  python3-six
%endif
Requires:       python-six
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
%{__python2} 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

%{__python2} setup.py install --skip-build --root %{buildroot}

%check
%{__python2} setup.py test

%if %{with python3}
pushd %{py3dir}
%{__python3} setup.py test
popd
%endif

%files
%doc README LICENSE
%{python2_sitelib}/%{upstream_name}
%{python2_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
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.14-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Wed May 14 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 0.14-3
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4

* Tue Jan 07 2014 Dan Callaghan <dcallagh@redhat.com> - 0.14-2
- six is needed on Python 2 also

* Fri Dec 27 2013 Dan Callaghan <dcallagh@redhat.com> - 0.14-1
- upstream release 0.14

* Wed Aug 14 2013 Dan Callaghan <dcallagh@redhat.com> - 0.12-1
- initial version