%global realname pycollada
%global with_python3 1
Name: python-collada
Version: 0.4
Release: 11%{?dist}
Summary: A python module for creating, editing and loading COLLADA
Group: Development/Languages
License: BSD
URL: https://github.com/pycollada/pycollada
# https://github.com/pycollada/pycollada/archive/v0.4.tar.gz
Source0: %{realname}-%{version}.tar.gz
# Disable pypi downloads in setup.py to guarantee use of only system libs
Patch0: python-collada-0.4-disable_unittest_downloads.patch
Patch1: python-collada-0.4-python3.patch
BuildArch: noarch
# Python 2
BuildRequires: python2-devel
BuildRequires: python-setuptools
# unit test requirements
BuildRequires: python-dateutil
BuildRequires: python-unittest2
BuildRequires: python-six
BuildRequires: numpy
%if 0%{?with_python3}
# Python 3
%if 0%{?rhel}
BuildRequires: python34-devel
%else
BuildRequires: python3-devel
%endif
BuildRequires: python3-setuptools
BuildRequires: python3-dateutil
BuildRequires: python3-six
BuildRequires: python3-numpy
%endif
%description
pycollada is a python module for creating, editing and loading COLLADA, which
is a COLLAborative Design Activity for establishing an interchange file format
for interactive 3D applications.
The library allows you to load a COLLADA file and interact with it as a python
object. In addition, it supports creating a collada python object from scratch,
as well as in-place editing.
%package -n python2-collada
Summary: A python 2 module for creating, editing and loading COLLADA
Requires: python-dateutil
Requires: python-numpy
%{?python_provide: %python_provide python2-collada}
%description -n python2-collada
pycollada is a python 3 module for creating, editing and loading COLLADA, which
is a COLLAborative Design Activity for establishing an interchange file format
for interactive 3D applications.
The library allows you to load a COLLADA file and interact with it as a python
object. In addition, it supports creating a collada python object from scratch,
as well as in-place editing.
%if 0%{?with_python3}
%package -n python3-collada
Summary: A python 3 module for creating, editing and loading COLLADA
Requires: python3-dateutil
Requires: python3-numpy
%{?python_provide: %python_provide python3-collada}
%description -n python3-collada
pycollada is a python 3 module for creating, editing and loading COLLADA, which
is a COLLAborative Design Activity for establishing an interchange file format
for interactive 3D applications.
The library allows you to load a COLLADA file and interact with it as a python
object. In addition, it supports creating a collada python object from scratch,
as well as in-place editing.
%endif
%prep
%setup -q -n %{realname}-%{version}
%patch0 -p1 -z .no_downloads
%patch1 -p1
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif # with_python3
%build
%{__python2} setup.py build
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif
%install
# Must do the python3 install first because the scripts in /usr/bin are
# overwritten with every setup.py install (and we want the python2 version
# to be the default for now).
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
popd
%endif
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
%check
%{__python2} setup.py test
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py test
popd
%endif
%files -n python2-collada
%doc AUTHORS.md CHANGELOG.rst COPYING README.markdown
%{python2_sitelib}/*
%if 0%{?with_python3}
%files -n python3-collada
%doc AUTHORS.md CHANGELOG.rst COPYING README.markdown
%{python3_sitelib}/*
%endif
%changelog
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.4-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4-10
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
* Mon Jul 6 2015 Richard Shaw <hobbes1069@gmail.com> - 0.4-9
- Fix FTBFS on rawhide, fixes BZ#1239822.
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Wed Oct 1 2014 Richard Shaw <hobbes1069@gmail.com> - 0.4-7
- Fix error for Python 3.4.
* Mon Sep 8 2014 Richard Shaw <hobbes1069@gmail.com> - 0.4-6
- Add Python 3 support.
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Sat Mar 9 2013 John Morris <john@zultron.com> - 0.4-3
- Rename disable_unittest_downloads patch to silence fedora-review
warning and add patch description in a comment
* Fri Jan 25 2013 John Morris <john@zultron.com> - 0.4-2
- Add check section
- Add extra BRs for check and build
- Remove unneeded python site{lib,arch} macros
* Wed Jan 23 2013 Richard Shaw <hobbes1069@gmail.com> - 0.4-1
- Initial packaging.