# # $Id$ # # Used if virtual name != real name (perl, ...) - replace python-formats by python-formats in the line below %define srcname python-formats %define shortname formats %define py3 1 %define py2 1 %define python3_sitelib %(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") Summary: PBSUMMARY Name: python-formats Version: 0.1.0a3 Release: 1%{dist} License: PBLIC Group: PBGRP Url: PBURL Source: ftp://ftp.project-builder.org//src/%{srcname}-%{version}.tar.gz BuildArch: noarch #PBPATCHSRC %if %py2 Requires: PBDEP BuildRequires: python-setuptools,python3-setuptools %description PBDESC python2 version %endif %if %py3 %if %py2 %package -n python3-%{shortname} %endif Requires: PBDEP BuildRequires: python-setuptools,python3-setuptools %if %py2 Summary: PBSUMMARY / Python3 version %description -n python3-%{shortname} %else %description %endif PBDESC python3 version %endif %prep %setup -q -n python-formats-%{version} %if %py3 cd .. cp -fr python-formats-%{version} python3 cd - %endif #PBPATCHCMD %build %if %py2 %{__python} setup.py build %endif %if %py3 cd ../python3 python3 setup.py build cd - %endif %install %{__rm} -rf %{buildroot} %if %py2 %{__python} setup.py install -O1 --skip-build --root %{buildroot} %endif %if %py3 cd ../python3 python3 setup.py install -O1 --skip-build --root %{buildroot} cd - %endif %if %py2 %files %doc README.rst %{python_sitelib}/* %endif %if %py3 %if %py2 %files -n python3-%{shortname} %else %files %endif %doc README.rst %{python3_sitelib}/* %endif %changelog * Sat Jan 01 2050 Bruno Cornec 0.1.0a3-1 - Updated to 0.1.0a3 - Packaged from upstream (Bruno Cornec)