bae5b12
%global modname DNS
bae5b12
%global distname py3dns
bae5b12
bae5b12
Name:               python3-py3dns
bae5b12
Version:            3.0.4
1b46057
Release:            4%{?dist}
bae5b12
Summary:            Python3 DNS library
bae5b12
bae5b12
Group:              Development/Libraries
bae5b12
License:            Python
c114d82
URL:                https://launchpad.net/py3dns/
bae5b12
Source0:            http://pypi.python.org/packages/source/p/%{distname}/%{distname}-%{version}.tar.gz
bae5b12
bae5b12
# At buildtime, py3dns tries to read in /etc/resolv.conf and crashes if it
bae5b12
# doesn't exist.  Our koji builders don't have that file.  This patch just
bae5b12
# avoids the crash if that file is absent.
bae5b12
Patch0:             python3-py3dns-handle-absent-resolv.patch
bae5b12
bae5b12
BuildArch:          noarch
bae5b12
bae5b12
BuildRequires:      python3-devel
bae5b12
bae5b12
%description
c114d82
This Python 3 module provides a DNS API for looking up DNS entries from
c114d82
within Python 3 modules and applications. This module is a simple,
c114d82
lightweight implementation.
c114d82
bae5b12
bae5b12
%prep
bae5b12
%setup -q -n %{distname}-%{version}
bae5b12
%patch0 -p1
bae5b12
bae5b12
# Remove bundled egg-info in case it exists
bae5b12
rm -rf %{distname}.egg-info
bae5b12
bae5b12
# Some files are latin-1 encoded but are incorrectly labelled as UTF-8 by
bae5b12
# upstream (see rhbz:620265)
bae5b12
#
bae5b12
# Convert them to actually be UTF-8, preserving the (now-correct) encoding
bae5b12
# declaration (preserving timestamps):
bae5b12
for file in DNS/Lib.py DNS/Type.py ; do
bae5b12
    iconv -f ISO-8859-1 -t UTF-8 -o $file.new $file && \
bae5b12
    touch -r $file $file.new && \
bae5b12
    mv $file.new $file
bae5b12
done
bae5b12
bae5b12
%build
bae5b12
%{__python3} setup.py build
bae5b12
bae5b12
%install
bae5b12
%{__python3} setup.py install -O1 --skip-build --root=%{buildroot}
bae5b12
bae5b12
# We cannot actually run the tests in koji because they require network access.
bae5b12
#%%check
bae5b12
#PYTHONPATH=$(pwd) %%{__python3} tests/test.py
bae5b12
#PYTHONPATH=$(pwd) %%{__python3} tests/test2.py
bae5b12
#PYTHONPATH=$(pwd) %%{__python3} tests/test4.py
bae5b12
##PYTHONPATH=$(pwd) %%{__python3} tests/test5.py somedomain.com
bae5b12
#PYTHONPATH=$(pwd) %%{__python3} tests/testPackers.py
bae5b12
#PYTHONPATH=$(pwd) %%{__python3} tests/testsrv.py
bae5b12
bae5b12
%files
bae5b12
%doc README.txt README-guido.txt LICENSE CREDITS.txt CHANGES
bae5b12
%{python3_sitelib}/%{modname}/
bae5b12
%{python3_sitelib}/%{distname}-%{version}*
bae5b12
bae5b12
%changelog
1b46057
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.4-4
1b46057
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
1b46057
e2ef385
* Tue May 27 2014 Kalev Lember <kalevlember@gmail.com> - 3.0.4-3
e2ef385
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
e2ef385
c114d82
* Tue Sep 24 2013 Ralph Bean <rbean@redhat.com> - 3.0.4-2
c114d82
- Update with comments from review.
c114d82
bae5b12
* Mon Sep 23 2013 Ralph Bean <rbean@redhat.com> - 3.0.4-1
bae5b12
- Initial package for Fedora