Blob Blame History Raw
# When we are bootstrapping, we drop some dependencies, and/or build time tests.
# Set this to 0 after we've bootstrapped.
%{!?_with_bootstrap: %global bootstrap 0}

%global modname pyface

Name:           python-%{modname}
Version:        5.1.0
Release:        6%{?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}/pyface-%{version}.tar.gz
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
%if ! 0%{?bootstrap}
BuildRequires:  python2-traitsui
%endif
BuildRequires:  python2-pygments
BuildRequires:  python2-nose python2-mock
Requires:       python2-traits
%if ! 0%{?bootstrap}
Requires:       python2-traitsui
%endif
BuildRequires:  python2-pygments
Requires:       python2-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 python%{python3_pkgversion}-%{modname}
Summary:        %{summary}
%{?python_provide:%python_provide python%{python3_pkgversion}-%{modname}}
BuildRequires:  python%{python3_pkgversion}-devel python%{python3_pkgversion}-setuptools
BuildRequires:  python%{python3_pkgversion}-Traits
%if ! 0%{?bootstrap}
BuildRequires:  python%{python3_pkgversion}-traitsui
%endif
BuildRequires:  python2-pygments
BuildRequires:  python%{python3_pkgversion}-pygments
BuildRequires:  python%{python3_pkgversion}-nose python%{python3_pkgversion}-mock
Requires:       python%{python3_pkgversion}-Traits
%if ! 0%{?bootstrap}
Requires:       python%{python3_pkgversion}-traitsui
%endif
BuildRequires:  python2-pygments
Requires:       python%{python3_pkgversion}-pygments
Requires:       python%{python3_pkgversion}-%{modname}-backend
BuildRequires:  /usr/bin/2to3

%description -n python%{python3_pkgversion}-%{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:  python2-qt4
Requires:       python2-qt4
Provides:       python2-%{modname}-backend
Obsoletes:      %{name}-qt <= 5.0.0-2

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

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

%description -n python%{python3_pkgversion}-%{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:  python2-wxpython
Requires:       python2-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}
# Upstream uses 2to3 so we need separate builds
mv pyface-%{version} python2
cp -a python2 python3
ln python2/*.{rst,txt} .
# 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


%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 image_LICENSE*.txt LICENSE.txt
%doc CHANGES.txt README.rst
%{python2_sitelib}/%{modname}*

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

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

%files -n python2-%{modname}-qt
%files -n python%{python3_pkgversion}-%{modname}-qt
%files -n python2-%{modname}-wx

%changelog
* Fri Feb 09 2018 Iryna Shcherbina <ishcherb@redhat.com> - 5.1.0-6
- Update Python 2 dependency declarations to new packaging standards
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 5.1.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 5.1.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 5.1.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Tue Dec 20 2016 Orion Poplawski <orion@cora.nwra.com> - 5.1.0-2
- Disable bootstrap

* Tue Dec 20 2016 Orion Poplawski <orion@cora.nwra.com> - 5.1.0-1
- Update to 5.1.0
- Add bootstrap, and enable it for python 3.6 build

* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 5.0.0-11
- Rebuild for Python 3.6

* 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