Blob Blame History Raw
%if 0%{?fedora}
%bcond_without python3
%else
%bcond_with python3
%endif
%global sum Simple packet creation/parsing library

Name:           python-dpkt
Version:        1.9.1
Release:        1%{?dist}
Summary:        %{sum}

Group:          Development/Libraries
License:        BSD
URL:            https://github.com/kbandla/dpkt
Source0:        https://github.com/kbandla/dpkt/archive/v%{version}.tar.gz
Patch0:         nostdeb-1.8.8.patch
Patch1:         python3-fixes-1.8.8.patch


BuildArch:      noarch
BuildRequires:  pytest
BuildRequires:  python-pytest-cov
BuildRequires:  python-devel
BuildRequires:  python-tox
BuildRequires:  python2-coverage

%if %{with python3}
BuildRequires:  python3-devel
BuildRequires:  python3-pytest-cov
BuildRequires:  python3-tox
BuildRequires:  python3-pytest
%endif

%description
Fast, simple packet creation and parsing library
with definitions for the basic TCP/IP protocols.

%package -n python2-dpkt
Summary:        %{sum}
%{?python_provide:%python_provide python2-dpkt}

%description -n python2-dpkt
Fast, simple packet creation and parsing library
with definitions for the basic TCP/IP protocols.

%if %{with python3}
%package -n python3-dpkt
Summary:        %{sum}
%{?python_provide:%python_provide python3-dpkt}

%description -n python3-dpkt
Fast, simple packet creation and parsing library
with definitions for the basic TCP/IP protocols.
%endif


%prep
%setup -q -n dpkt-%{version}
#%patch0 -p1
#%patch1 -p1

%if %{with python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif

%build
%py2_build

%if %{with python3}
pushd %{py3dir}
%py3_build
%endif

%install
%py2_install

%if %{with python3}
pushd %{py3dir}
%py3_install
popd
%endif

%check
#tox -e py27 --sitepackages


%files -n python2-dpkt
%doc AUTHORS CHANGES LICENSE README.rst examples
%{python2_sitelib}/dpkt
%{python2_sitelib}/dpkt-%{version}-*.egg-info

%if %{with python3}
%files -n python3-dpkt
%license LICENSE 
%doc AUTHORS CHANGES LICENSE README.rst examples
%{python3_sitelib}/dpkt
%{python3_sitelib}/dpkt*.egg-info
%endif


%changelog
* Wed Aug 02 2017 Michele Baldessari <michele@acksyn.org> - 1.9.1-1
- New upstream release
- Build python3 packages

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.8-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Fri Feb 17 2017 Michele Baldessari <michele@acksyn.org> - 1.8.8-1
- New upstream + fix rawhide build error (BZ#1424142) for now by disabling tox

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.7-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.8.7-2
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Sun Apr 10 2016 Michele Baldessari <michele@acksyn.org> - 1.8.7-1
- New upstream
- New homepage
- Add check section in order to run tests

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.8-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.8-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.8-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Fri Jan 17 2014 Yanko Kaneti <yaneti@declera.com> - 1.8-1
- Update to 1.8. Drop patch. Drop ancient obsolete

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Wed Jul 28 2010 Yanko Kaneti <yaneti@declera.com> - 1.7-1
- python-dpkt previously known as dpkt
- Incorporated feedback from the new review