# sitelib for noarch packages, sitearch for others (remove the unneeded one) %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} %if 0%{?fedora} || 0%{?rhel} > 6 %global with_python3 1 %endif %global srcname yaku Name: python-%{srcname} Version: 0.0.1 Release: 0.1.20110721git57aba7b%{?dist} Summary: Simple build system to build python C extensions Group: Development/Languages License: BSD URL: https://github.com/cournape/yaku # Yaku is still in highly active development # Packaging a snapshot for now # git clone https://github.com/cournape/yaku.git # git checkout -r 57aba7b # cd yaku # patch -p1 < ../yaku-sdist.patch # python setup.py sdist # The tarball will be in dist/yaku-%%{version}.tar.gz Source0: %{srcname}-%{version}.tar.gz # This is actually meant to be applied before the tarball is created from the # snapshot Patch100: yaku-sdist.patch Patch0: yaku-test.patch Patch1: yaku-examples-subst.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch BuildRequires: python2-devel # For tests BuildRequires: python-jinja2 BuildRequires: gcc-gfortran %if %{with_python3} BuildRequires: python3-devel BuildRequires: python3-jinja2 %endif %description Yaku is a simple system (think make) in python, aimed at building python extensions, although it could be used for other tasks if python is your thing. Yaku aims to be simple, easy to extend, understand dependencies for determining whether to rebuild a file, and be usable as a python library. %if %{with_python3} %package -n python3-%{srcname} Summary: Simple build system to build python3 C extensions Group: Development/Languages %description -n python3-%{srcname} Yaku is a simple system (think make) in python, aimed at building python extensions, although it could be used for other tasks if python is your thing. Yaku aims to be simple, easy to extend, understand dependencies for determining whether to rebuild a file, and be usable as a python library. This package provides the python3 yaku module %endif %prep %setup -q -n %{srcname}-%{version} %patch0 -p1 -b .tst %patch1 -p1 -b .subst %if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} %endif %build %{__python} setup.py build %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py build popd %endif %install rm -rf %{buildroot} %{__python} setup.py install --skip-build --root %{buildroot} %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py install --root %{buildroot} popd %endif %clean rm -rf %{buildroot} %check # For now, do this as the tests for python2 and 3 are both run from the same # test.sh %if 0%{?with_python3} PYTHON2=python2 PYTHON3=python3 export PYTHON2 PYTHON3 # Two failing PY3 tests due to no cython module in py3 /bin/sh test.sh | grep 'PY2 errors: 0/14 | PY3 errors: 2/14' %endif # setup.py is the only thing that has the license terms in it %files %defattr(-,root,root,-) %doc NOTES README setup.py # For noarch packages: sitelib %{python_sitelib}/* %if 0%{?with_python3} %files -n python3-%{srcname} %defattr(-,root,root,-) %doc setup.py %{python3_sitelib}/* %endif %changelog * Thu Jul 21 2011 Toshio Kuratomi - 0.0.1-0.1.20110721git57aba7b% - Initial Fedora packaging