# # Conditional build: # %bcond_without doc # don't build doc %bcond_without tests # do not perform "make test" %bcond_without python2 # CPython 2.x module %bcond_without python3 # CPython 3.x module %define module speaklater Summary: Implements a lazy string for python Summary(pl.UTF-8): Implementacja wartoĊ›ciowania leniwego dla Pythona # Name must match the python module/package name (as in 'import' statement) Name: python-%{module} Version: 1.3 Release: 11 License: BSD-like Group: Libraries/Python Source0: https://pypi.python.org/packages/source/s/%{module}/%{module}-%{version}.tar.gz # Source0-md5: e8d5dbe36e53d5a35cff227e795e8bbf URL: http://github.com/mitsuhiko/speaklater BuildRequires: rpmbuild(macros) >= 1.710 BuildRequires: rpm-pythonprov %if %{with python2} BuildRequires: python-distribute %endif %if %{with python3} BuildRequires: python3-modules %endif Requires: python-modules BuildArch: noarch BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description A module that provides lazy strings for translations. Basically you get an object that appears to be a string but changes the value every time the value is evaluated based on a callable you provide. # %description -l pl.UTF-8 %package -n python3-%{module} Summary: - Summary(pl.UTF-8): - Group: Libraries/Python Requires: python3-modules %description -n python3-%{module} %description -n python3-%{module} -l pl.UTF-8 %package apidocs Summary: %{module} API documentation Summary(pl.UTF-8): Dokumentacja API %{module} Group: Documentation %description apidocs API documentation for %{module}. %description apidocs -l pl.UTF-8 Dokumentacja API %{module}. %prep %setup -q -n %{module}-%{version} %build %if %{with python2} %py_build %{?with_tests:test} %endif %if %{with python3} %py3_build %{?with_tests:test} %endif %install rm -rf $RPM_BUILD_ROOT %if %{with python2} %py_install %py_postclean %endif %if %{with python3} %py3_install %endif %clean rm -rf $RPM_BUILD_ROOT %if %{with python2} %files %defattr(644,root,root,755) %doc LICENSE README %{py_sitescriptdir}/*.py[co] %if "%{py_ver}" > "2.4" %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info %endif %endif %if %{with python3} %files -n python3-%{module} %defattr(644,root,root,755) %doc LICENSE README %{py3_sitescriptdir}/%{module}.py %{py3_sitescriptdir}/__pycache__/*.py[co] %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info %endif