%global with_python3 1 Name: python-rst Summary: Module to create rst document Version: 0.1 Release: 1%{?dist} License: MIT Group: System Environment/Libraries URL: http://rst.rtfd.org/ Source0: https://pypi.python.org/packages/source/r/rst/rst-%{version}.tar.gz BuildArch: noarch BuildRequires: python-devel python-setuptools Requires: python-six %if 0%{?with_python3} BuildRequires: python3-devel python3-setuptools Requires: python3-six %endif # if with_python3 %description rst is a python module to create reStructuredText documents through code. %if 0%{?with_python3} %package -n python3-rst Summary: Module to create rst document Group: System Environment/Libraries %description -n python3-rst rst is a python module to create reStructuredText documents through code. %endif # with_python3 %prep %setup -q -n rst-%{version} %if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!/usr/bin/python|#!%{__python3}|' %endif # with_python3 %build %{__python} setup.py build %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py build popd %endif # with_python3 %install rm -rf $RPM_BUILD_ROOT %{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT popd %endif # with_python3 %files %defattr(-,root,root,-) %doc README.rst LICENSE %{python_sitelib}/rst* %if 0%{?with_python3} %files -n python3-rst %defattr(-,root,root,-) %doc README.rst LICENSE %{python3_sitelib}/rst* %endif # with_python3 %changelog * Wed Mar 27 2013 Kushal Das 0.1-1 - Initial package for Fedora