# # $Id$ # # Used if virtual name != real name (perl, ...) - replace PBPKG by PBREALPKG in the line below %define srcname PBPKG %define shortname formats %define py3 PBPY3 %define py2 PBPY2 %define python3_sitelib %(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") Summary: PBSUMMARY Name: PBPKG Version: PBVER Release: PBTAGPBSUF License: PBLIC Group: PBGRP Url: PBURL Source: PBREPO/PBSRC BuildArch: noarch #PBPATCHSRC %if %py2 #Requires: PBDEP BuildRequires: PBBDEP %description PBDESC python2 version %endif %if %py3 %if %py2 %package -n python3-%{shortname} %endif #Requires: PBDEP BuildRequires: PBBDEP %if %py2 Summary: PBSUMMARY / Python3 version %description -n python3-%{shortname} %else %description %endif PBDESC python3 version %endif %prep %setup -q -n PBPKG-%{version}PBEXTDIR %if %py3 cd .. cp -fr PBPKG-%{version}PBEXTDIR 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 PBLOG