Blob Blame History Raw
%global modname pyface

Name:           python-%{modname}
Version:        5.0.0
Release:        10%{?dist}
Summary:        Generic User Interface objects

# Images have different licenses. For image license breakdown check
# image_LICENSE.txt file.
License:        BSD and EPL and LGPLv2+ and Public Domain
URL:            http://code.enthought.com/projects/traits_ui/
# Current release is missing files
# https://github.com/enthought/pyface/issues/98
#Source0:        http://www.enthought.com/repo/ets/pyface-%{version}.tar.gz
Source0:        https://github.com/enthought/pyface/archive/%{version}.tar.gz#/pyface-%{version}.tar.gz
# Fix python syntax error
# https://github.com/enthought/pyface/pull/178
Patch0:         pyface-python.patch
BuildArch:      noarch
BuildRequires:  /usr/bin/xvfb-run

%description
Pyface enables programmers to interact with generic UI objects, such as
an "MDI Application Window", rather than with raw UI widgets. (Pyface is
named by analogy to JFace in Java.) Traits uses Pyface to implement
views and editors for displaying and editing Traits-based objects.

%package -n python2-%{modname}
Summary:        %{summary}
%{?python_provide:%python_provide python2-%{modname}}
BuildRequires:  python2-devel python2-setuptools
BuildRequires:  python2-Traits python2-traitsui
BuildRequires:  python-pygments
BuildRequires:  python2-nose python-mock
Requires:       python2-Traits python2-traitsui
Requires:       python-pygments
Requires:       python2-%{modname}-backend

%description -n python2-%{modname}
Pyface enables programmers to interact with generic UI objects, such as
an "MDI Application Window", rather than with raw UI widgets. (Pyface is
named by analogy to JFace in Java.) Traits uses Pyface to implement
views and editors for displaying and editing Traits-based objects.

Python 2 version.

%package -n python3-%{modname}
Summary:        %{summary}
%{?python_provide:%python_provide python3-%{modname}}
BuildRequires:  python3-devel python3-setuptools
BuildRequires:  python3-Traits python3-traitsui
BuildRequires:  python3-pygments
BuildRequires:  python3-nose python3-mock
Requires:       python3-Traits python3-traitsui
Requires:       python3-pygments
Requires:       python3-%{modname}-backend
BuildRequires:  /usr/bin/2to3

%description -n python3-%{modname}
Pyface enables programmers to interact with generic UI objects, such as
an "MDI Application Window", rather than with raw UI widgets. (Pyface is
named by analogy to JFace in Java.) Traits uses Pyface to implement
views and editors for displaying and editing Traits-based objects.

Python 3 version.

%package doc
Summary:        Documentation for pyface

%description doc
Documentation and examples for pyface.

%package -n python2-%{modname}-qt
Summary:        Qt backend placeholder for pyface
%{?python_provide:%python_provide python2-%{modname}-qt}
Requires:       python2-%{modname} = %{version}-%{release}
BuildRequires:  PyQt4
Requires:       PyQt4
Provides:       python2-%{modname}-backend
Obsoletes:      %{name}-qt <= 5.0.0-2

%description -n python2-%{modname}-qt
Qt backend placeholder for pyface.

%package -n python3-%{modname}-qt
Summary:        Qt backend placeholder for pyface
%{?python_provide:%python_provide python3-%{modname}-qt}
Requires:       python3-%{modname} = %{version}-%{release}
BuildRequires:  python3-PyQt4
Requires:       python3-PyQt4
Provides:       python3-%{modname}-backend

%description -n python3-%{modname}-qt
Qt backend placeholder for pyface.

%package -n python2-%{modname}-wx
Summary:        wx backend placeholder for pyface
%{?python_provide:%python_provide python2-%{modname}-wx}
Requires:       python2-%{modname} = %{version}-%{release}
BuildRequires:  wxPython
Requires:       wxPython
Provides:       python2-%{modname}-backend
Obsoletes:      %{name}-wx <= 5.0.0-2

%description -n python2-%{modname}-wx
wx backend placeholder for pyface.

%prep
%setup -qcn pyface-%{version}
mv pyface-%{version} python2
pushd python2
%patch0 -p1
# file not utf-8
for f in image_LICENSE_{Eclipse,OOo}.txt
do
  iconv -f iso8859-1 -t utf-8 ${f} > ${f}.conv && mv -f ${f}.conv ${f}
done
popd

cp -a python2 python3


%build
pushd python2
  %py2_build
popd
pushd python3
  %py3_build
popd

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

%check
# Don't fail on testing due to:
# https://github.com/enthought/pyface/issues/180
pushd python2/build/lib/
  xvfb-run nosetests-%{python2_version} -v || :
popd
# xvfb-run will fail to start immediately
sleep 5
pushd python3/build/lib/
  xvfb-run nosetests-%{python3_version} -v || :
popd
 
%files -n python2-%{modname}
%license python2/image_LICENSE*.txt python2/LICENSE.txt
%doc python2/CHANGES.txt python2/README.rst
%{python2_sitelib}/%{modname}*

%files -n python3-%{modname}
%license python2/image_LICENSE*.txt python2/LICENSE.txt
%doc python3/CHANGES.txt python3/README.rst
%{python3_sitelib}/%{modname}*

%files doc
%doc python2/docs/DockWindowFeature.pdf python2/examples 

%files -n python2-%{modname}-qt
%files -n python3-%{modname}-qt
%files -n python2-%{modname}-wx

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

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

* Wed Nov 11 2015 Robert Kuska <rkuska@redhat.com> - 5.0.0-8
- Rebuilt with traitsui

* Wed Nov 11 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.0.0-7
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Mon Nov 9 2015 Orion Poplawski <orion@cora.nra.com> - 5.0.0-6
- Restore doc sub-package, fix doc installs

* Mon Nov 9 2015 Orion Poplawski <orion@cora.nra.com> - 5.0.0-5
- Add %%python_provides to qt/wx sub-packages
- Use sub-dirs for build

* Sat Nov 07 2015 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 5.0.0-4
- Rebuild against traitsui

* Sat Nov 07 2015 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 5.0.0-3
- Fix BR/Rs

* Fri Nov 06 2015 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 5.0.0-2
- Return back to PyQt4
- Add python3-subpackages (only qt backend supported)
- Fix license a bit

* Thu Nov 5 2015 Orion Poplawski <orion@cora.nwra.com> - 5.0.0-1
- Update to 5.0.0
- Switch qt requires to pyside

* Thu Nov 5 2015 Orion Poplawski <orion@cora.nwra.com> - 4.5.2-1
- Update to 4.5.2
- Add BR/R on python-pygments

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

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

* Thu Mar 13 2014 Orion Poplawski <orion@cora.nwra.com> - 4.4.0-1
- Update to 4.4.0

* Mon Sep 16 2013 Orion Poplawski <orion@cora.nwra.com> - 4.3.0-4
- Create dummy backend packages to express dependencies

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

* Thu Apr 25 2013 Orion Poplawski <orion@cora.nwra.com> - 4.3.0-2
- Fix non-UTF-8 files
- Add doc sub-package
- Be more explicit with files

* Tue Apr 23 2013 Orion Poplawski <orion@cora.nwra.com> - 4.3.0-1
- Initial package