%if 0%{?fedora} > 12 %bcond_without python3 %else %bcond_with python3 %endif %global pypi_name lppinstru Name: python-%{pypi_name} Version: 1.0.0 Release: 1%{?dist} Summary: LPP's instrumentation library License: Python URL: http://www.lpp.fr Source0: http://www.lpp.fr/%{pypi_name}/%{pypi_name}-%{version}.zip BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-setuptools BuildRequires: numpy BuildRequires: python-matplotlib BuildRequires: pyserial BuildRequires: /usr/*/libdwf.so %if %{with python3} BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-numpy BuildRequires: python3-matplotlib BuildRequires: python3-pyserial %endif %description LPP's instrumentation library %if %{with python3} %package -n python3-%{pypi_name} Summary: Integer to Roman numerals converter %description -n python3-%{pypi_name} Integer to Roman numerals converter %endif %prep %setup -q -n %{pypi_name}-%{version} # Remove bundled egg-info rm -rf %{pypi_name}.egg-info %if %{with python3} rm -rf %{py3dir} cp -a . %{py3dir} %endif %build %{__python2} setup.py build %if %{with python3} pushd %{py3dir} %{__python3} setup.py build popd %endif %install %if %{with python3} pushd %{py3dir} %{__python3} setup.py install -O1 --skip-build --root %{buildroot} popd %endif %{__python2} setup.py install --skip-build --root %{buildroot} %files %doc %{python2_sitelib}/%{pypi_name}* %if %{with python3} %files -n python3-%{pypi_name} %{python3_sitelib}/%{pypi_name}* %endif %changelog * Mon Nov 16 2015 Alexis Jeandet - 1.0.0 - First build