diff --git a/dnsyo.spec b/dnsyo.spec index 08a5241..3bcd7d3 100644 --- a/dnsyo.spec +++ b/dnsyo.spec @@ -1,10 +1,10 @@ %if 0%{?fedora} -%global with_python3 1 +%bcond_without python3 %endif Name: dnsyo Version: 2.0.7 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Check DNS against many global DNS servers Group: Applications/Internet @@ -12,24 +12,13 @@ License: MIT URL: http://samarudge.github.io/dnsyo/ Source0: https://pypi.python.org/packages/source/d/%{name}/%{name}-%{version}.tar.gz BuildArch: noarch -BuildRequires: python2-devel -BuildRequires: python2-setuptools - -# For manpage -BuildRequires: python2-dns -BuildRequires: python2-requests -BuildRequires: python2-pyyaml -BuildRequires: help2man - -Requires: python2-dns -Requires: python2-requests -Requires: python2-pyyaml -%if 0%{?with_python3} +%if %{with python3} BuildRequires: python3-devel -Buildrequires: python3-setuptools +BuildRequires: python3-setuptools # For manpage. +BuildRequires: help2man BuildRequires: python3-requests BuildRequires: python3-dns BuildRequires: python3-PyYAML @@ -37,22 +26,21 @@ BuildRequires: python3-PyYAML Requires: python3-requests Requires: python3-dns Requires: python3-PyYAML -%endif -%description -Query over 1500 global DNS servers and colate their results. -Track the propagation of your domains around the world. +%else +BuildRequires: python2-devel +BuildRequires: python2-setuptools -%if 0%{?with_python3} -%package -n python3-dnsyo -Summary: Check DNS against many global DNS servers -Group: Applications/Internet +Requires: python2-dns +Requires: python2-requests +Requires: PyYAML +%endif -%description -n python3-dnsyo +%description Query over 1500 global DNS servers and colate their results. Track the propagation of your domains around the world. -%endif + %prep %setup -q @@ -64,53 +52,44 @@ sed -i -e '/_requires/s/==/>=/g' setup.py # 'dnspython3' distribution on Fedora any more sed -i -e 's/dnspython3/dnspython/g' setup.py -%build -%{__python} setup.py build - -%if 0%{?with_python3} -cp -r . %{py3dir} -pushd %{py3dir} -%{__python3} setup.py build -popd +%build +%if %{with python3} +%py3_build +%else +%py2_build %endif -%install +%install # For manpage. -export PYTHONPATH=%{buildroot}%{python_sitelib}:%{buildroot}%{python3_sitelib} +export PYTHONPATH=%{buildroot}%{python2_sitelib}:%{buildroot}%{python3_sitelib} mkdir -p %{buildroot}/%{_mandir}/man1 -%if 0%{?with_python3} -pushd %{py3dir} -%{__python3} setup.py install --skip-build --root %{buildroot} -mv %{buildroot}/%{_bindir}/%{name} %{buildroot}/%{_bindir}/python3-%{name} -popd - -help2man -N --version-string=%{version} %{buildroot}/%{_bindir}/python3-%{name} > %{buildroot}/%{_mandir}/man1/python3-%{name}.1 -%endif - -%{__python} setup.py install --skip-build --root %{buildroot} -%if 0%{?fedora} +%if %{with python3} +%py3_install help2man -N --version-string=%{version} %{buildroot}/%{_bindir}/%{name} > %{buildroot}/%{_mandir}/man1/%{name}.1 +%else +%py2_install %endif + %files -%if 0%{?fedora} -%{_mandir}/man1/%{name}.1* -%endif -%{python_sitelib}/%{name}/ -%{python_sitelib}/%{name}-%{version}* %{_bindir}/%{name} - -%if 0%{?with_python3} -%{_mandir}/man1/python3-%{name}.1* +%if %{with python3} +%{_mandir}/man1/%{name}.1* %{python3_sitelib}/%{name}/ %{python3_sitelib}/%{name}-%{version}* -%{_bindir}/python3-%{name} +%else +%{python2_sitelib}/%{name}/ +%{python2_sitelib}/%{name}-%{version}* %endif + %changelog +* Fri Apr 13 2018 Iryna Shcherbina - 2.0.7-7 +- Switch to Python 3 in Fedora (rhbz#1314043) + * Wed Feb 07 2018 Iryna Shcherbina - 2.0.7-6 - Update Python 2 dependency declarations to new packaging standards (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)