%global modname zope.component
%if 0%{?fedora}
%global with_python3 1
%endif
Summary: Zope Component Architecture
Name: python-zope-component
Version: 4.2.1
Release: 1%{?dist}
Source0: http://pypi.python.org/packages/source/z/%{modname}/%{modname}-%{version}.tar.gz
License: ZPLv2.1
Group: Development/Libraries
BuildArch: noarch
URL: http://pypi.python.org/pypi/zope.component
BuildRequires: python2-devel
BuildRequires: python-setuptools
BuildRequires: python-sphinx
%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-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
Requires: python-zope-interface
# python-zope-event is noarch
Requires: python-zope-event
%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.
%if 0%{?with_python3}
%package -n python3-zope-component
Summary: Zope Component Architecture
Group: Development/Libraries
Requires: python3-zope-interface
Requires: python3-zope-event
%description -n python3-zope-component
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.
%endif
%prep
%setup -q -n %{modname}-%{version}
rm -rf %{modname}.egg-info
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif
%build
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif
%{__python} setup.py build
# build Sphinx documents
COPYRIGHT=`grep Author: PKG-INFO |sed -e 's/Author: //'`
cat >src/zope/component/conf.py <<END
templates_path = ['_templates']
source_suffix = '.txt'
master_doc = 'index'
project = '%{modname}'
copyright = '$COPYRIGHT'
version = '%{version}'
release = '%{version}'
pygments_style = 'sphinx'
html_static_path = ['_static']
extensions = []
END
sphinx-build -b html src/zope/component/ html
rm -fr html/{.buildinfo,.doctrees}
%install
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install --root=$RPM_BUILD_ROOT
popd
%endif
%{__python} setup.py install --root=$RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc LICENSE.txt CHANGES.rst COPYRIGHT.txt README.rst
%doc html/
%{python_sitelib}/zope/component/
%{python_sitelib}/%{modname}-*.egg-info
%{python_sitelib}/%{modname}-*-nspkg.pth
%if 0%{?with_python3}
%files -n python3-zope-component
%doc LICENSE.txt CHANGES.rst COPYRIGHT.txt README.rst
%doc html/
%{python3_sitelib}/zope/component/
%exclude %{python3_sitelib}/zope/component/*.txt
%{python3_sitelib}/%{modname}-*.egg-info
%{python3_sitelib}/%{modname}-*-nspkg.pth
%endif
%changelog
* 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