Blob Blame History Raw
%global pkgname zope-component
%global modname zope.component
%global summary Zope Component Architecture
%global _description \
This package represents the core of the Zope Component Architecture.   \
Together with the 'zope.interface' package, it provides facilities for \
defining, registering and looking up components.

# EPEL7 support: Python2 packages prefix is unversioned.
%if 0%{?rhel} && 0%{?rhel} <= 7
%global py2_namespace python
%else
%global py2_namespace python2
%endif


Summary: %{summary}
Name: python-%{pkgname}
Epoch:   1
Version: 4.1.0
Release: 3%{?dist}
Source0: http://pypi.python.org/packages/source/z/%{modname}/%{modname}-%{version}.zip
License: ZPLv2.1
Group: Development/Libraries
BuildArch: noarch
URL: http://pypi.python.org/pypi/zope.component

BuildRequires: python2-devel
BuildRequires: %{py2_namespace}-setuptools
BuildRequires: %{py2_namespace}-sphinx
BuildRequires: %{py2_namespace}-repoze-sphinx-autointerface

# Python3
BuildRequires: python3-pkgversion-macros
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-setuptools
%if 0%{?with_python3_other}
BuildRequires: python%{python3_other_pkgversion}-devel
BuildRequires: python%{python3_other_pkgversion}-setuptools
%endif

# for tests
#BuildRequires: python-zope-testing
#BuildRequires: python-ZODB3
#BuildRequires: python-zope-proxy
# packages required by tests but not yet available in Fedora
#BuildRequires: python-zope-hookable
#BuildRequires: python-zope-location
#BuildRequires: python-zope-security
#BuildRequires: python-zope-testrunner

%if %{py2_namespace} == python
%{?python_provide:%python_provide %{py2_namespace}-%{pkgname}}
Requires: %{py2_namespace}-zope-interface
Requires: %{py2_namespace}-zope-event
%endif

%description %{_description}


# Python 2
%if %{py2_namespace} != python
%package -n %{py2_namespace}-%{pkgname}
Summary: %{summary}
%{?python_provide:%python_provide %{py2_namespace}-%{pkgname}}
Requires: %{py2_namespace}-zope-interface
Requires: %{py2_namespace}-zope-event

%description -n %{py2_namespace}-%{pkgname} %{_description}
%endif


# Python 3
%package -n python%{python3_pkgversion}-%{pkgname}
Summary: %{summary}
%{?python_provide:%python_provide python%{python3_pkgversion}-%{pkgname}}
Requires: python%{python3_pkgversion}-zope-interface
Requires: python%{python3_pkgversion}-zope-event

%description -n python%{python3_pkgversion}-%{pkgname} %{_description}

%if 0%{?with_python3_other}
%package -n python%{python3_other_pkgversion}-%{pkgname}
Summary: %{summary}
%{?python_provide:%python_provide python%{python3_other_pkgversion}-%{pkgname}}
Requires: python%{python3_other_pkgversion}-zope-interface
Requires: python%{python3_other_pkgversion}-zope-event

%description -n python%{python3_other_pkgversion}-%{pkgname} %{_description}
%endif


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

rm -rf %{modname}.egg-info


%build
%py2_build
%py3_build
%if 0%{?with_python3_other}
%py3_other_build
%endif

# Docs
make -C docs html
rm -fr docs/_build/html/{.buildinfo,.doctrees}


%install
%if 0%{?with_python3_other}
%py3_other_install
%endif
%py3_install
%py2_install


#%%check
#export PYTHONPATH=$(pwd)
#%%{__python2} setup.py -q test -q
#%%{__python3} setup.py -q test -q
#%%if 0%{?with_python3_other}
#%%{__python3_other} setup.py -q test -q
#%%endif


%files -n %{py2_namespace}-%{pkgname}
%defattr(-,root,root,-)
%license LICENSE.txt COPYRIGHT.txt
%doc CHANGES.rst README.rst
%doc docs/_build/html/
%{python2_sitelib}/zope/component/
%{python2_sitelib}/%{modname}-*.egg-info
%{python2_sitelib}/%{modname}-*-nspkg.pth

# Python3
%files -n python%{python3_pkgversion}-%{pkgname}
%license LICENSE.txt COPYRIGHT.txt
%doc CHANGES.rst README.rst
%doc docs/_build/html/
%{python3_sitelib}/zope/component/
%exclude %{python3_sitelib}/zope/component/*.txt
%{python3_sitelib}/%{modname}-*.egg-info
%{python3_sitelib}/%{modname}-*-nspkg.pth

%if 0%{?with_python3_other}
%files -n python%{python3_other_pkgversion}-%{pkgname}
%license LICENSE.txt COPYRIGHT.txt
%doc CHANGES.rst README.rst
%doc docs/_build/html/
%{python3_other_sitelib}/zope/component/
%exclude %{python3_other_sitelib}/zope/component/*.txt
%{python3_other_sitelib}/%{modname}-*.egg-info
%{python3_other_sitelib}/%{modname}-*-nspkg.pth
%endif


%changelog
* Tue Apr 25 2017 Aurelien Bompard <abompard@fedoraproject.org> - 1:4.1.0-3
- Use the included documentation.
- Re-add the Requires for the python- subpackage.

* Mon Apr 24 2017 Aurelien Bompard <abompard@fedoraproject.org> - 1:4.1.0-2
- Enable creation of the Python 3 packages in EPEL, now that the dependencies
  are available.

* Fri Nov 07 2014 Aurelien Bompard <abompard@fedoraproject.org> - 1:4.1.0-1
- Revert to version 4.1.0, EPEL7 can't have any later version because they
  require zope.interface >= 4.1.0, which is in RHEL.
  See https://bugzilla.redhat.com/show_bug.cgi?id=1161506

* Mon Jul 21 2014 Ralph Bean <rbean@redhat.com> - 4.2.1-1
- Latest upstream.

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

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

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

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

* Wed Apr 10 2013 Ralph Bean <rbean@redhat.com> - 4.1.0-1
- Updated to latest upstream: 4.1.0.
- Rename {README,CHANGES}.txt to {README,CHANGES}.rst

* Mon Feb 25 2013 Ralph Bean <rbean@redhat.com> - 4.0.2-2
- Fix python3 conditional

* Mon Feb 25 2013 Ralph Bean <rbean@redhat.com> - 4.0.2-1
- Latest upstream.

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

* Mon Dec 03 2012 Tomas Dabasinskas <tomas@redhat.com> - 4.0.1-2
- Fixed python3 package files section
- Removed exclude *.txt for pyhon2 package as no txt files are generated during install

* Thu Nov 29 2012 Ralph Bean <rbean@redhat.com> - 4.0.1-1
- Updated to latest upstream.
- Included python3 subpackage.

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

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

* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.10.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Sun Jan  2 2011 Robin Lee <cheeselee@fedoraproject.org> - 3.10.0-2
- Get rid of the utility script

* Sun Jan  2 2011 Robin Lee <cheeselee@fedoraproject.org> - 3.10.0-1
- Update to 3.10.0
- Include a utility script to build Sphinx documents

* Mon Sep 20 2010 Robin Lee <robinlee.sysu@gmail.com> - 3.9.5-2
- Rearrange the documents

* Sun Sep  5 2010 Robin Lee <robinlee.sysu@gmail.com> - 3.9.5-1
- Update to 3.9.5
- Don't move documents
- Requires: python-zope-filesystem and python-setuptools removed
- Spec cleaned up

* Wed Jun 16 2010 Robin Lee <robinlee.sysu@gmail.com> - 3.9.4-1
- Initial packaging