Blob Blame History Raw
%if 0%{?fedora}
%global with_python3 1
%endif

%global modname pygal

Name:               python-pygal
Version:            1.6.1
Release:            2%{?dist}
Summary:            A python svg graph plotting library

Group:              Development/Libraries
License:            LGPLv3+
URL:                http://pypi.python.org/pypi/pygal
Source0:            http://pypi.python.org/packages/source/p/%{modname}/%{modname}-%{version}.tar.gz

BuildArch:          noarch

BuildRequires:      python2-devel
BuildRequires:      python-setuptools
BuildRequires:      python-pyquery
BuildRequires:      python-flask
BuildRequires:      python-cairosvg
BuildRequires:      pytest
BuildRequires:      python-lxml

%if 0%{?with_python3}
BuildRequires:      python3-devel
BuildRequires:      python3-setuptools
# We would need these, but there is no python3-pycairo or python3-pyquery, so
# no python3 tests for us yet...
#BuildRequires:      python3-pyquery
#BuildRequires:      python3-flask
#BuildRequires:      python3-cairosvg
#BuildRequires:      python3-pytest
BuildRequires:      python3-lxml
%endif

Requires:           python-lxml

%description
A python svg graph plotting library.

%if 0%{?with_python3}
%package -n python3-pygal
Summary:            A python svg graph plotting library
Group:              Development/Libraries

Requires:           python3-lxml

%description -n python3-pygal
A python svg graph plotting library
%endif

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

# Remove bundled egg-info in case it exists
rm -rf %{modname}.egg-info
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif

%build
%{__python} setup.py build
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif


%install
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install -O1 --skip-build --root=%{buildroot}
popd
%endif
%{__python} setup.py install -O1 --skip-build --root=%{buildroot}

%check
%if 0%{?fedora}
py.test pygal/test

# Tests would require python3-flask, which does not exist.  Disabled for now.
#%%if 0%%{?with_python3}
#pushd %%{py3dir}
#%%{__python3} setup.py test
#popd
#%%endif
%endif

%files
%doc README
%{python_sitelib}/%{modname}/
%{python_sitelib}/%{modname}-%{version}*
%{_bindir}/pygal_gen.py

%if 0%{?with_python3}
%files -n python3-pygal
%doc README
%{python3_sitelib}/%{modname}/
%{python3_sitelib}/%{modname}-%{version}-*
%endif

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

* Mon Jan 19 2015 Ralph Bean <rbean@redhat.com> - 1.6.1-1
- new version

* Mon Nov 10 2014 Ralph Bean <rbean@redhat.com> - 1.5.1-1
- Latest upstream RHBZ#1140143.

* Thu Sep 04 2014 Ralph Bean <rbean@redhat.com> - 1.5.0-2
- Disable tests for epel.

* Mon Aug 18 2014 Ralph Bean <rbean@redhat.com> - 1.5.0-1
- Latest upstream.

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

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

* Tue Apr 22 2014 Ralph Bean <rbean@redhat.com> - 1.4.6-1
- Latest upstream.

* Fri Mar 07 2014 Ralph Bean <rbean@redhat.com> - 1.4.5-1
- Latest upstream.

* Thu Feb 27 2014 Ralph Bean <rbean@redhat.com> - 1.4.2-1
- Latest upstream.
- Reenabled tests.

* Wed Feb 26 2014 Ralph Bean <rbean@redhat.com> - 1.4.1-1
- Latest upstream.
- Disable tests for https://github.com/Kozea/pygal/issues/97

* Wed Feb 12 2014 Ralph Bean <rbean@redhat.com> - 1.3.1-1
- Latest upstream.

* Sun Feb 02 2014 Ralph Bean <rbean@redhat.com> - 1.2.3-1
- Latest upstream
- Re-enabled tests.

* Thu Jan 30 2014 Ralph Bean <rbean@redhat.com> - 1.2.2-1
- Latest upstream.
- Remove patch, now upstreamed.
- Disable tests.. pytest is behaving strangely.

* Fri Nov 15 2013 Ralph Bean <rbean@redhat.com> - 1.1.0-1
- Latest upstream.
- Re-enabled python3 subpackage.
- Patch to get around encoding issues in the build step.
- Updated comment about requirements for python3 tests.

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

* Tue Apr 16 2013 Ralph Bean <rbean@redhat.com> - 0.13.0-2
- Updated license with clarification from usptream
  https://github.com/Kozea/pygal/pull/32

* Sat Apr 13 2013 Ralph Bean <rbean@redhat.com> - 0.13.0-1
- Initial package for Fedora