%global upstream_name pythondialog %global upstream_name2 python2-pythondialog Name: python-dialog Version: 3.4.0 Release: %mkrel 3 Summary: Python interface to the Unix dialog utility Group: Development/Python License: LGPLv2+ URL: http://pythondialog.sourceforge.net # Upstream releases two tarballs from the same sources Source0: https://files.pythonhosted.org/packages/source/p/%{upstream_name}/%{upstream_name}-%{version}.tar.bz2 Source1: https://files.pythonhosted.org/packages/source/p/%{upstream_name2}/%{upstream_name2}-%{version}.tar.bz2 BuildArch: noarch BuildRequires: pkgconfig(python2) BuildRequires: python3-devel Requires: dialog %{?python_provide:%python_provide python-dialog} %{!?py2_build: %global py2_build CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build} %{!?py2_install: %global py2_install %{__python} setup.py install --skip-build --root %{buildroot}} %{!?python2_sitelib: %global python2_sitelib %{python_sitelib}} %{!?_licensedir:%global license %doc} %description A Python interface to the Unix dialog utility, designed to provide an easy, pythonic and as complete as possible way to use the dialog features from Python code. %package -n python3-dialog Requires: dialog Summary: %{summary} Group: Development/Python %{?python_provide:%python_provide python3-dialog} %description -n python3-dialog A Python interface to the Unix dialog utility, designed to provide an easy, pythonic and as complete as possible way to use the dialog features from Python code. %prep %setup -q -n %{upstream_name}-%{version} tar -xvf %{SOURCE1} %build %py3_build pushd %{upstream_name2}-%{version} %py2_build popd %install %py3_install pushd %{upstream_name2}-%{version} %py2_install popd %files %license %{upstream_name2}-%{version}/COPYING %doc %{upstream_name2}-%{version}/README.rst %{upstream_name2}-%{version}/examples/ %{python2_sitelib}/dialog.py* %{python2_sitelib}/python2_pythondialog-*.egg-info %files -n python3-dialog %license COPYING %doc README.rst examples/ %{python3_sitelib}/dialog.py* %{python3_sitelib}/__pycache__/ %{python3_sitelib}/pythondialog-*.egg-info