Blob Blame Raw
%global srcname pycha
%global sum A library for drawing charts with Python and Cairo

Name:           python-%{srcname}
Version:        0.7.0
Release:        2%{?dist}
Summary:        %{sum}

Group:          Development/Libraries
License:        LGPLv3+
URL:            https://bitbucket.org/lgs/pycha/
Source0:        https://files.pythonhosted.org/packages/source/p/%{srcname}/%{srcname}-%{version}.tar.gz
Source1:        chavier.desktop

BuildArch:      noarch
BuildRequires:  desktop-file-utils
BuildRequires:  python2-devel
BuildRequires:  python3-devel
BuildRequires:  python-tools

%description
Pycha is a very simple Python package for drawing charts using the great Cairo
library. Its goals are:
    * Lightweight
    * Simple to use
    * Nice looking with default values
    * Customization 
It won't try to draw any possible chart on earth but draw the most common ones
nicely.

%package -n python2-%{srcname}
Summary:        %{sum}
%{?python_provide:%python_provide python2-%{srcname}}
BuildRequires:  pycairo
Requires:       pycairo

%description -n python2-%{srcname}
Pycha is a very simple Python package for drawing charts using the great Cairo
library. Its goals are:
    * Lightweight
    * Simple to use
    * Nice looking with default values
    * Customization 
It won't try to draw any possible chart on earth but draw the most common ones
nicely.

%package -n python3-%{srcname}
Summary:        %{sum}
%{?python_provide:%python_provide python3-%{srcname}}
BuildRequires:  python3-cairo
Requires:       python3-cairo

%description -n python3-%{srcname}
Pycha is a very simple Python package for drawing charts using the great Cairo
library. Its goals are:
    * Lightweight
    * Simple to use
    * Nice looking with default values
    * Customization 
It won't try to draw any possible chart on earth but draw the most common ones
nicely.

%package -n     chavier
Summary:        GUI application for exploring the pycha library
Group:          Development/Tools
Requires:       python3-%{srcname} = %{version}-%{release}

%description -n chavier
Chavier allows the user to generate random data sets or use existing data to
test the various options that %{shortname} provides in an interactive GUI
application. Various chart types can be plotted and their options adjusted
from the interface.

%prep
%setup -q -c

# remove upstream egg-info
rm -rf */*.egg-info

mv %{srcname}-%{version} python2
cp -a python2 python3


%build
# separate dirs because 2to3 is used
pushd python2
%py2_build
popd
pushd python3
2to3 --no-diffs -w chavier pycha
%py3_build
popd


%install
pushd python2
%py2_install
popd
pushd python3
%py3_install
popd

desktop-file-install \
--dir=%{buildroot}%{_datadir}/applications %{SOURCE1}

# remove py2 version of chavier
rm -rf %{buildroot}%{python2_sitelib}/chavier


%check
pushd python2
%{__python2} setup.py test
popd
pushd python3
#%{__python3} setup.py test
popd


%files -n python2-%{srcname}
%doc python2/examples/ python2/{COPYING,AUTHORS,README.txt}
%{python2_sitelib}/%{srcname}
%{python2_sitelib}/%{srcname}-*.egg-info

%files -n python3-%{srcname}
%doc python3/examples/ python2/{COPYING,AUTHORS,README.txt}
%{python3_sitelib}/%{srcname}
%{python3_sitelib}/%{srcname}-*.egg-info

%files -n chavier
%{_bindir}/chavier
%{_datadir}/applications/chavier.desktop
%{python3_sitelib}/chavier


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

* Fri Jul 15 2016 Dan Horák <dan[at]danny.cz> - 0.7.0-1
- new upstream release 0.7.0
- introduced py3 variant

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

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

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

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

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

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

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Sun Jan 16 2011 Ionuț C. Arțăriși <mapleoin@fedoraproject.org> - 0.6.0-1
- new upstream release 0.6.0

* Sat Aug  7 2010 Ionuț C. Arțăriși <mapleoin@fedoraproject.org> - 0.5.3-1
- new upstream bugfix release

* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 0.5.2-3
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild

* Sat Mar 27 2010 Ionuț C. Arțăriși <mapleoin@fedoraproject.org> - 0.5.2-2
- changed license from LGPLv3 to LGPLv3+
- fixed spelling error in %%description
- capitalized chavier package %%summary
- added pycairo Requires
- removed tests

* Tue Mar 23 2010 Ionuț C. Arțăriși <mapleoin@fedoraproject.org> - 0.5.2-1
- first Fedora release