diff --git a/.gitignore b/.gitignore index 202636b..fa21653 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ dpkt-1.8.tar.gz /v1.8.7.tar.gz /v1.8.8.tar.gz +/v1.9.1.tar.gz diff --git a/python-dpkt.spec b/python-dpkt.spec index b1ade01..effc268 100644 --- a/python-dpkt.spec +++ b/python-dpkt.spec @@ -1,7 +1,14 @@ +%if 0%{?fedora} +%bcond_without python3 +%else +%bcond_with python3 +%endif +%global sum Simple packet creation/parsing library + Name: python-dpkt -Version: 1.8.8 -Release: 2%{?dist} -Summary: Simple packet creation/parsing library +Version: 1.9.1 +Release: 1%{?dist} +Summary: %{sum} Group: Development/Libraries License: BSD @@ -18,32 +25,86 @@ 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. +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 +#%patch0 -p1 +#%patch1 -p1 + +%if %{with python3} +rm -rf %{py3dir} +cp -a . %{py3dir} +%endif %build -%{__python} setup.py build +%py2_build + +%if %{with python3} +pushd %{py3dir} +%py3_build +%endif %install -%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT +%py2_install + +%if %{with python3} +pushd %{py3dir} +%py3_install +popd +%endif %check #tox -e py27 --sitepackages -%files -%doc AUTHORS CHANGES LICENSE README.rst README.md examples -%{python_sitelib}/* +%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 - 1.9.1-1 +- New upstream release +- Build python3 packages + * Thu Jul 27 2017 Fedora Release Engineering - 1.8.8-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild diff --git a/sources b/sources index 5eda9c0..ba043e7 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (v1.8.8.tar.gz) = 1775d4a2c87f1ff9cfc550382f20d8c183e8d714cfd64ce10868065af9c88407260795d07bd687113ad4baea10467d81e2cd3b3f630953f538ebdde4b9949c90 +SHA512 (v1.9.1.tar.gz) = 5c4e3e5819a91b7e936e7e9418eba2f35df2d7266e80fb8a55cea4682236dedae1f88a340e421bcd3dd6b51ef578a4c231e14416457a666e26cef57f42b05e95