From f19b39c2cd32ea6f9e3440e0b02ff7bbc9f45b82 Mon Sep 17 00:00:00 2001 From: Avram Lubkin Date: Mon, 1 Feb 2016 12:30:51 +0800 Subject: [PATCH] Changed Python2 package name to python2-dns for Fedora 24+ --- python-dns.spec | 61 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 53 insertions(+), 8 deletions(-) diff --git a/python-dns.spec b/python-dns.spec index 50847c3..d60d429 100644 --- a/python-dns.spec +++ b/python-dns.spec @@ -13,16 +13,28 @@ %{!?python26_sitelib: %global python26_sitelib %(%{__python26} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %endif +# __python2 macro doesn't exist for el5 and 6 +%if 0%{?rhel} == 5 || 0%{?rhel} == 6 + %define __python2 %{__python} + %define python2_sitelib %{python_sitelib} +%endif + %if 0%{?fedora} > 12 || 0%{?epel} > 6 %global with_python3 1 %undefine py3dir %global py3dir %{_builddir}/dnspython/dnspython3-%{version} %global py3unpack -a 2 +%{!?python3_pkgversion: %global python3_pkgversion 3} +%endif + +# Rename to python2-dns after Fedora 23 +%if 0%{?fedora} > 23 + %global with_p2subpkg 1 %endif Name: python-dns Version: 1.12.0GIT465785f -Release: 3%{?dist} +Release: 4%{?dist} Summary: DNS toolkit for Python Group: Development/Languages @@ -64,8 +76,11 @@ BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-crypto %endif +%if ! 0%{?with_p2subpkg} +Provides: python2-dns = %{version}-%{release} # for DNSSEC support Requires: python-crypto +%endif %description dnspython is a DNS toolkit for Python. It supports almost all record @@ -77,6 +92,26 @@ level classes perform queries for data of a given name, type, and class, and return an answer set. The low level classes allow direct manipulation of DNS zones, messages, names, and records. +%if 0%{?with_p2subpkg} +%package -n python2-dns +Summary: DNS toolkit for Python 2 +Group: Development/Languages +%{?python_provide:%python_provide python2-dns} + +# for DNSSEC support +Requires: python2-crypto + +%description -n python2-dns +dnspython is a DNS toolkit for Python. It supports almost all record +types. It can be used for queries, zone transfers, and dynamic +updates. It supports TSIG authenticated messages and EDNS0. + +dnspython provides both high and low level access to DNS. The high +level classes perform queries for data of a given name, type, and +class, and return an answer set. The low level classes allow direct +manipulation of DNS zones, messages, names, and records. +%endif + %if 0%{?with_python26} %package -n python26-dns Summary: DNS toolkit for Python 2.6 @@ -100,6 +135,7 @@ manipulation of DNS zones, messages, names, and records. %package -n python%{python3_pkgversion}-dns Summary: DNS toolkit for Python 3 Group: Development/Languages +%{?python_provide:%python_provide python%{python3_pkgversion}-dns} # for DNSSEC support Requires: python%{python3_pkgversion}-crypto @@ -143,9 +179,9 @@ popd %build pushd %{py2dir} %if 0%{?rhel} == 5 -%{__python} -c 'import setuptools; execfile("setup.py")' build +%{__python2} -c 'import setuptools; execfile("setup.py")' build %else -%{__python} setup.py build +%{__python2} setup.py build %endif popd @@ -166,9 +202,9 @@ rm -rf %{buildroot} pushd %{py2dir} %if 0%{?rhel} == 5 -%{__python} -c 'import setuptools; execfile("setup.py")' install --skip-build --root %{buildroot} +%{__python2} -c 'import setuptools; execfile("setup.py")' install --skip-build --root %{buildroot} %else -%{__python} setup.py install --skip-build --root %{buildroot} +%{__python2} setup.py install --skip-build --root %{buildroot} %endif popd @@ -197,7 +233,7 @@ do if [ $py != test_resolver.py ] %endif then - PYTHONPATH=%{buildroot}%{python_sitelib} %{__python} $py + PYTHONPATH=%{buildroot}%{python2_sitelib} %{__python2} $py fi done popd @@ -237,12 +273,18 @@ popd %clean rm -rf %{buildroot} +# For Fedora > 23 builds +%if 0%{?with_p2subpkg} +%files -n python2-dns +%else %files +%endif + %defattr(-,root,root,-) %doc dnspython-%{version}/{ChangeLog,LICENSE,README,examples} -%{python_sitelib}/*egg-info -%{python_sitelib}/dns +%{python2_sitelib}/*egg-info +%{python2_sitelib}/dns %if 0%{?with_python26} %files -n python26-dns @@ -263,6 +305,9 @@ rm -rf %{buildroot} %endif %changelog +* Mon Feb 01 2016 Avram Lubkin - 1.12.0GIT465785f-4 +- Changed Python2 package name to python2-dns for Fedora 24+ + * Fri Jan 22 2016 Avram Lubkin - 1.12.0GIT465785f-3 - Using python3_pkgversion to support python34 package in el7 - Build Python3 package for el7+