bump to 2.4.0 release candidate 5, enable separate python2 and python3 builds

This commit is contained in:
Michal Ambroz 2018-03-11 03:53:45 +01:00
parent 29a77475ba
commit 165de32ff6
3 changed files with 114 additions and 32 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@ scapy-2.0.0.10.tar.gz
/scapy-2.2.0.tar.gz
/scapy-2.3.1.zip
/scapy-2.3.3.tar.gz
/scapy-2.4.0rc5.tar.gz

View File

@ -1,65 +1,146 @@
%global gituser secdev
%global gitname scapy
%global commit 6c331b78aaeef7af53035760698b1d7d6afeb9a7
%global commit e42ecdc54556c4852ca06b1a6da6c1ccbf3f522e
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%global rcversion rc5
Name: scapy
Version: 2.3.3
Release: 4%{?dist}
Summary: Interactive packet manipulation tool and network scanner
Name: scapy
Version: 2.4.0
Release: 0.%{rcversion}.1%{?dist}
Summary: Interactive packet manipulation tool and network scanner
Group: Applications/Internet
License: GPLv2
URL: http://www.secdev.org/projects/scapy/
#Source0: http://www.secdev.org/projects/scapy/files/scapy-%{version}.zip
# https://bitbucket.org/secdev/scapy/pull-request/80
Source0: https://github.com/%{gituser}/%{gitname}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Patch0: scapy-2.2.0-xdg-open.patch
Group: Applications/Internet
License: GPLv2
URL: http://www.secdev.org/projects/scapy/
# https://github.com/secdev/scapy/releases
# https://bitbucket.org/secdev/scapy/pull-request/80
Source0: https://github.com/%{gituser}/%{gitname}/archive/v%{version}%{rcversion}.tar.gz#/%{name}-%{version}%{rcversion}.tar.gz
Patch0: scapy-2.2.0-xdg-open.patch
BuildArch: noarch
BuildRequires: python2 >= 2.5
BuildRequires: python2-devel >= 2.5
BuildArch: noarch
BuildRequires: python2 >= 2.5
BuildRequires: python2-devel >= 2.5
BuildRequires: sed
Requires: python2 >= 2.5
Requires: python2 >= 2.5
%description
Scapy is a powerful interactive packet manipulation program built on top
of the Python interpreter. It can be used to forge or decode packets of
a wide number of protocols, send them over the wire, capture them, match
Scapy is a powerful interactive packet manipulation program built on top
of the Python interpreter. It can be used to forge or decode packets of
a wide number of protocols, send them over the wire, capture them, match
requests and replies, and much more.
%package -n python2-%{name}
Summary: Interactive packet manipulation tool and network scanner
%{?python_provide:%python_provide python2-%{name}}
%description -n python2-%{name}
Scapy is a powerful interactive packet manipulation program built on top
of the Python interpreter. It can be used to forge or decode packets of
a wide number of protocols, send them over the wire, capture them, match
requests and replies, and much more.
%package -n python%{python3_pkgversion}-%{name}
Summary: Interactive packet manipulation tool and network scanner
%{?python_provide:%python_provide python%{python3_pkgversion}-%{name}}
Provides: %{name}
%description -n python%{python3_pkgversion}-%{name}
Scapy is a powerful interactive packet manipulation program built on top
of the Python interpreter. It can be used to forge or decode packets of
a wide number of protocols, send them over the wire, capture them, match
requests and replies, and much more.
%prep
%setup -q
%setup -q -n %{name}-%{version}%{rcversion}
%patch0 -p1
%build
%{__python} setup.py build
%py2_build
%py3_build
%install
%{__install} -Dp -m0644 doc/scapy.1.gz %{buildroot}%{_mandir}/man1/scapy.1.gz
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
%{__rm} -f %{buildroot}%{python2_sitelib}/*egg-info/requires.txt
install -Dp -m0644 doc/scapy.1.gz %{buildroot}%{_mandir}/man1/scapy.1.gz
%py2_install
rm -f %{buildroot}%{python2_sitelib}/*egg-info/requires.txt
# Remove shebang
for Files in %{buildroot}%{python2_sitelib}/scapy/contrib/*.py %{buildroot}%{python2_sitelib}/scapy/pipetool.py %{buildroot}%{python2_sitelib}/scapy/layers/inet6.py %{buildroot}%{python2_sitelib}/scapy/tools/check_asdis.py; do
%{__sed} -i.orig -e 1d ${Files}
sed -i.orig -e 1d ${Files}
touch -r ${Files}.orig ${Files}
%{__rm} ${Files}.orig
rm ${Files}.orig
done
#Rename the executables
mv -f %{buildroot}%{_bindir}/scapy %{buildroot}%{_bindir}/scapy2
mv -f %{buildroot}%{_bindir}/UTscapy %{buildroot}%{_bindir}/UTscapy2
%py3_install
rm -f %{buildroot}%{python3_sitelib}/*egg-info/requires.txt
# Remove shebang
for Files in %{buildroot}%{python3_sitelib}/scapy/contrib/*.py %{buildroot}%{python3_sitelib}/scapy/pipetool.py %{buildroot}%{python3_sitelib}/scapy/layers/inet6.py %{buildroot}%{python3_sitelib}/scapy/tools/check_asdis.py; do
sed -i.orig -e 1d ${Files}
touch -r ${Files}.orig ${Files}
rm ${Files}.orig
done
#Rename the executables
mv -f %{buildroot}%{_bindir}/scapy %{buildroot}%{_bindir}/scapy3
mv -f %{buildroot}%{_bindir}/UTscapy %{buildroot}%{_bindir}/UTscapy3
ln -s %{_bindir}/scapy3 %{buildroot}%{_bindir}/scapy
ln -s %{_bindir}/UTscapy3 %{buildroot}%{_bindir}/UTscapy
%check
#TODO: Need to fix/remove slow/failed test
#cd test/
#./run_tests
cd test/
./run_tests_py2 || true
./run_tests_py3 || true
%files
%files -n python2-%{name}
%doc %{_mandir}/man1/scapy.1*
%{_bindir}/scapy
%{_bindir}/UTscapy
%{_bindir}/scapy2
%{_bindir}/UTscapy2
%{python2_sitelib}/scapy/*
%{python2_sitelib}/scapy-*.egg-info
%files -n python%{python3_pkgversion}-%{name}
%doc %{_mandir}/man1/scapy.1*
%{_bindir}/scapy
%{_bindir}/UTscapy
%{_bindir}/scapy3
%{_bindir}/UTscapy3
%{python3_sitelib}/scapy/*
%{python3_sitelib}/scapy-*.egg-info
%changelog
* Fri Mar 9 2018 Michal Ambroz <rebus _AT seznam.cz> - 2.4.0-0.rc5.1
- bump to upstream 2.4.0 release candidate 5
- enable separate python3 and python2 build
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

View File

@ -1 +1 @@
SHA512 (scapy-2.3.3.tar.gz) = 47ca2eceafe7b693c569a92c106782037d869c323aaaec41cace07dfdeb3c6a7e9f7bc8ca1150b3c0daea54e6665f93eb1dfc3c511419cfa28eb2e0753bf9ba4
SHA512 (scapy-2.4.0rc5.tar.gz) = 943604feb25a682b1ef68e42ecdbe7abc2e95d062a812628bd3fda8d644b4a53376aef8da69fd82ef1aad9031b7b6b768052e10e9b54f345088dede366718f48