Blame SPECS/scapy.spec

6bb5ae
Name:           scapy
6bb5ae
Version:        2.4.4
6bb5ae
Release:        5%{?dist}
6bb5ae
Summary:        Interactive packet manipulation tool and network scanner
6bb5ae
6bb5ae
%global         gituser         secdev
6bb5ae
%global         gitname         scapy
6bb5ae
%global         commit          95ba5b8504152a1f820bbe679ccf03668cb5118f
6bb5ae
%global         shortcommit     %(c=%{commit}; echo ${c:0:7})
6bb5ae
6bb5ae
License:        GPLv2
6bb5ae
URL:            http://www.secdev.org/projects/scapy/
6bb5ae
#               https://github.com/secdev/scapy/releases
6bb5ae
#               https://bitbucket.org/secdev/scapy/pull-request/80
6bb5ae
#               https://scapy.readthedocs.io/en/latest/introduction.html
6bb5ae
Source0:        https://github.com/%{gituser}/%{gitname}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
6bb5ae
Patch1:         scapy-2.4.3-libc.patch
6bb5ae
6bb5ae
%global         common_desc %{expand:
6bb5ae
Scapy is a powerful interactive packet manipulation program built on top
6bb5ae
of the Python interpreter. It can be used to forge or decode packets of
6bb5ae
a wide number of protocols, send them over the wire, capture them, match
6bb5ae
requests and replies, and much more.}
6bb5ae
6bb5ae
6bb5ae
# By default build with python3 subpackage
6bb5ae
%bcond_without     python3
6bb5ae
6bb5ae
# Build also the python2 package on releases up to fc31 and rhel8
6bb5ae
%if (0%{?fedora} && 0%{?fedora} <= 31 ) || ( 0%{?rhel} && 0%{?rhel} <= 8 )
6bb5ae
%bcond_without     python2
6bb5ae
%else
6bb5ae
%bcond_with        python2
6bb5ae
%endif
6bb5ae
6bb5ae
# Build the documentation only on Fedora due to cc-by-nc-sa license
6bb5ae
%if 0%{?fedora}
6bb5ae
%bcond_without     doc
6bb5ae
%else
6bb5ae
%bcond_with        doc
6bb5ae
%endif
6bb5ae
6bb5ae
6bb5ae
6bb5ae
6bb5ae
BuildArch:      noarch
6bb5ae
6bb5ae
BuildRequires:  make
6bb5ae
BuildRequires:  sed
6bb5ae
6bb5ae
%if 0%{?with_python2}
6bb5ae
BuildRequires:  python2-devel
6bb5ae
BuildRequires:  python2-setuptools
6bb5ae
%endif
6bb5ae
6bb5ae
%if 0%{?with_python3}
6bb5ae
BuildRequires:  python%{python3_pkgversion}-devel
6bb5ae
BuildRequires:  python%{python3_pkgversion}-setuptools
6bb5ae
%endif
6bb5ae
6bb5ae
# Recommends only supported on fedora and rhel8+
6bb5ae
%if (0%{?fedora}) || ( 0%{?rhel} && 0%{?rhel} >= 8 )
6bb5ae
Recommends:     tcpdump
6bb5ae
# Using database of manufactures /usr/share/wireshark/manuf
6bb5ae
Recommends:     wireshark-cli
6bb5ae
%endif
6bb5ae
6bb5ae
%description %{common_desc}
6bb5ae
6bb5ae
%if 0%{?with_python2}
6bb5ae
%package -n python2-%{name}
6bb5ae
Summary:        Interactive packet manipulation tool and network scanner
6bb5ae
6bb5ae
%{?python_provide:%python_provide python2-%{name}}
6bb5ae
6bb5ae
%if (0%{?fedora}) || ( 0%{?rhel} && 0%{?rhel} >= 8 ) 
6bb5ae
Recommends:     python2-pyx
6bb5ae
Recommends:     python2-matplotlib
6bb5ae
Recommends:     ipython2
6bb5ae
%endif
6bb5ae
6bb5ae
%description -n python2-%{name}
6bb5ae
%{common_desc}
6bb5ae
6bb5ae
%endif
6bb5ae
6bb5ae
6bb5ae
%if 0%{?with_python3}
6bb5ae
%package -n python%{python3_pkgversion}-%{name}
6bb5ae
Summary:        Interactive packet manipulation tool and network scanner
6bb5ae
6bb5ae
%{?python_provide:%python_provide python%{python3_pkgversion}-%{name}}
6bb5ae
Provides:       %{name} = %{version}-%{release}
6bb5ae
6bb5ae
%if (0%{?fedora}) || ( 0%{?rhel} && 0%{?rhel} >= 8 ) 
6bb5ae
Recommends:     PyX
6bb5ae
Recommends:     python%{python3_pkgversion}-matplotlib
6bb5ae
Recommends:     ipython3
6bb5ae
%endif
6bb5ae
6bb5ae
%description -n python%{python3_pkgversion}-%{name}
6bb5ae
%{common_desc}
6bb5ae
%endif
6bb5ae
6bb5ae
%if 0%{?with_doc}
6bb5ae
%package doc
6bb5ae
Summary:        Interactive packet manipulation tool and network scanner
6bb5ae
6bb5ae
BuildRequires:  python%{python3_pkgversion}-sphinx
6bb5ae
BuildRequires:  python%{python3_pkgversion}-sphinx_rtd_theme
6bb5ae
6bb5ae
%description doc
6bb5ae
%{common_desc}
6bb5ae
%endif
6bb5ae
6bb5ae
6bb5ae
6bb5ae
%prep
6bb5ae
%autosetup -p 1 -n %{name}-%{version}
6bb5ae
6bb5ae
# Remove shebang
6bb5ae
# https://github.com/secdev/scapy/pull/2332
6bb5ae
SHEBANGS=$(find ./scapy -name '*.py' -print | xargs grep -l -e '^#!.*env python')
6bb5ae
for FILE in $SHEBANGS ; do
6bb5ae
    sed -i.orig -e 1d "${FILE}"
6bb5ae
    touch -r "${FILE}.orig" "${FILE}"
6bb5ae
    rm "${FILE}.orig"
6bb5ae
done
6bb5ae
6bb5ae
6bb5ae
6bb5ae
%build
6bb5ae
%if 0%{?with_python2}
6bb5ae
%py2_build
6bb5ae
%endif
6bb5ae
6bb5ae
%if 0%{?with_python3}
6bb5ae
%py3_build
6bb5ae
%endif
6bb5ae
6bb5ae
%if 0%{?with_doc}
6bb5ae
# the following commands are copied from tox.ini to avoid a dependency on tox
6bb5ae
pushd doc/scapy
6bb5ae
sphinx-apidoc-%python3_version -f --no-toc --separate --module-first --output-dir api ../../scapy ../../scapy/modules/ ../../scapy/libs/ ../../scapy/tools/ ../../scapy/arch/ ../../scapy/contrib/cansocket* ../../scapy/contrib/scada/* ../../scapy/all.py ../../scapy/layers/all.py
6bb5ae
%{python3} sphinx_apidoc_postprocess.py
6bb5ae
make html BUILDDIR=_build_doc SCAPY_APITREE=0 SPHINXBUILD=sphinx-build-%python3_version
6bb5ae
6bb5ae
rm -f _build_doc/html/.buildinfo
6bb5ae
rm -f _build_doc/html/_static/_dummy
6bb5ae
popd
6bb5ae
%endif
6bb5ae
6bb5ae
6bb5ae
6bb5ae
%install
6bb5ae
install -dp -m0755 %{buildroot}%{_mandir}/man1
6bb5ae
install -Dp -m0644 doc/scapy.1* %{buildroot}%{_mandir}/man1/
6bb5ae
6bb5ae
%if 0%{?with_python2}
6bb5ae
%py2_install
6bb5ae
rm -f %{buildroot}%{python2_sitelib}/*egg-info/requires.txt
6bb5ae
6bb5ae
6bb5ae
# Rename the executables
6bb5ae
mv -f %{buildroot}%{_bindir}/scapy   %{buildroot}%{_bindir}/scapy2
6bb5ae
mv -f %{buildroot}%{_bindir}/UTscapy %{buildroot}%{_bindir}/UTscapy2
6bb5ae
6bb5ae
%if ! 0%{?with_python3}
6bb5ae
# Link the default to the py2 version of executables if py3 not built
6bb5ae
ln -s %{_bindir}/scapy2   %{buildroot}%{_bindir}/scapy
6bb5ae
ln -s %{_bindir}/UTscapy2 %{buildroot}%{_bindir}/UTscapy
6bb5ae
%endif
6bb5ae
%endif
6bb5ae
6bb5ae
%if 0%{?with_python3}
6bb5ae
%py3_install
6bb5ae
rm -f %{buildroot}%{python3_sitelib}/*egg-info/requires.txt
6bb5ae
6bb5ae
# Rename the executables
6bb5ae
mv -f %{buildroot}%{_bindir}/scapy   %{buildroot}%{_bindir}/scapy3
6bb5ae
mv -f %{buildroot}%{_bindir}/UTscapy %{buildroot}%{_bindir}/UTscapy3
6bb5ae
6bb5ae
# Link the default to the python3 version of executables
6bb5ae
ln -s %{_bindir}/scapy3   %{buildroot}%{_bindir}/scapy
6bb5ae
ln -s %{_bindir}/UTscapy3 %{buildroot}%{_bindir}/UTscapy
6bb5ae
%endif
6bb5ae
6bb5ae
6bb5ae
6bb5ae
# check
6bb5ae
# TODO: Need to fix/remove slow/failed test
6bb5ae
# cd test/
6bb5ae
# ./run_tests_py2 || true
6bb5ae
# ./run_tests_py3 || true
6bb5ae
6bb5ae
6bb5ae
6bb5ae
%if 0%{?with_python2}
6bb5ae
%files -n python2-%{name}
6bb5ae
%license LICENSE
6bb5ae
%if ! 0%{?with_python3}
6bb5ae
%doc %{_mandir}/man1/scapy.1*
6bb5ae
%{_bindir}/scapy
6bb5ae
%{_bindir}/UTscapy
6bb5ae
%endif
6bb5ae
%{_bindir}/scapy2
6bb5ae
%{_bindir}/UTscapy2
6bb5ae
%{python2_sitelib}/scapy/
6bb5ae
%{python2_sitelib}/scapy-*.egg-info
6bb5ae
%endif
6bb5ae
6bb5ae
6bb5ae
6bb5ae
%if 0%{?with_python3}
6bb5ae
%files -n python%{python3_pkgversion}-%{name}
6bb5ae
%license LICENSE
6bb5ae
%doc %{_mandir}/man1/scapy.1*
6bb5ae
%{_bindir}/scapy
6bb5ae
%{_bindir}/UTscapy
6bb5ae
%{_bindir}/scapy3
6bb5ae
%{_bindir}/UTscapy3
6bb5ae
%{python3_sitelib}/scapy/
6bb5ae
%{python3_sitelib}/scapy-*.egg-info
6bb5ae
%endif
6bb5ae
6bb5ae
6bb5ae
%if 0%{?with_doc}
6bb5ae
%files doc
6bb5ae
%doc doc/scapy/_build_doc/html
6bb5ae
%endif
6bb5ae
6bb5ae
6bb5ae
%changelog
6bb5ae
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 2.4.4-5
6bb5ae
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
6bb5ae
  Related: rhbz#1991688
6bb5ae
6bb5ae
* Fri Jul 23 2021 Andrea Claudi <aclaudi@redhat.com> - [2.4.4-4.el9]
6bb5ae
- Don't build scapy-doc package on rhel (Andrea Claudi) [1973720]
6bb5ae
- Enable gating test on RHEL9 (Jianwen Ji) [1974642]
6bb5ae
6bb5ae
* Mon May 31 2021 Miro Hrončok <mhroncok@redhat.com> - 2.4.4-3
6bb5ae
- Drop build dependency on tox
6bb5ae
- Resolves: rhbz#1956399
6bb5ae
6bb5ae
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 2.4.4-2
6bb5ae
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
6bb5ae
6bb5ae
* Fri Mar 12 2021 Michal Ambroz <rebus _AT seznam.cz> - 2.4.4-1
6bb5ae
- bump to 2.4.4 release
6bb5ae
6bb5ae
* Thu Mar 11 2021 W. Michael Petullo <mike@flyn.org> - 2.4.3-8
6bb5ae
- Patch to fix loading libc.a; see https://bugs.python.org/issue42580
6bb5ae
6bb5ae
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.3-7
6bb5ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
6bb5ae
6bb5ae
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.3-6
6bb5ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
6bb5ae
6bb5ae
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 2.4.3-5
6bb5ae
- Rebuilt for Python 3.9
6bb5ae
6bb5ae
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.3-4
6bb5ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
6bb5ae
6bb5ae
* Fri Nov 08 2019 Michal Ambroz <rebus _AT seznam.cz> - 2.4.3-3
6bb5ae
- remove colliding manpage from python2 package
6bb5ae
- add license files
6bb5ae
- add doc subpackage
6bb5ae
- remove shebangs
6bb5ae
6bb5ae
* Sun Oct 06 2019 Michal Ambroz <rebus _AT seznam.cz> - 2.4.3-2
6bb5ae
- change to recommended python build dependencies for EPEL7 - thanks Miro Hroncok
6bb5ae
6bb5ae
* Thu Sep 26 2019 Michal Ambroz <rebus _AT seznam.cz> - 2.4.3-1
6bb5ae
- bump to 2.4.3 release
6bb5ae
- change the python2 to conditional build to be able to keep one spec for all
6bb5ae
- add Recommends for dependencies, except for EPEL7
6bb5ae
6bb5ae
* Fri Sep 20 2019 Miro Hrončok <mhroncok@redhat.com> - 2.4.0-8
6bb5ae
- Subpackage python2-scapy has been removed
6bb5ae
  See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
6bb5ae
6bb5ae
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 2.4.0-7
6bb5ae
- Rebuilt for Python 3.8
6bb5ae
6bb5ae
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.0-6
6bb5ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
6bb5ae
6bb5ae
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.0-5
6bb5ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
6bb5ae
6bb5ae
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.0-4
6bb5ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
6bb5ae
6bb5ae
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 2.4.0-3
6bb5ae
- Rebuilt for Python 3.7
6bb5ae
6bb5ae
* Mon Apr 30 2018 Michal Ambroz <rebus _AT seznam.cz> - 2.4.0-2
6bb5ae
- disable the test for now - there is too many failing (network) tests
6bb5ae
6bb5ae
* Mon Apr 30 2018 Michal Ambroz <rebus _AT seznam.cz> - 2.4.0-1
6bb5ae
- bump to 2.4.0 release
6bb5ae
6bb5ae
* Fri Mar 9 2018 Michal Ambroz <rebus _AT seznam.cz> - 2.4.0-0.rc5.1
6bb5ae
- bump to upstream 2.4.0 release candidate 5
6bb5ae
- enable separate python3 and python2 build
6bb5ae
6bb5ae
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.3-4
6bb5ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
6bb5ae
6bb5ae
* Wed Jan 31 2018 Iryna Shcherbina <ishcherb@redhat.com> - 2.3.3-3
6bb5ae
- Update Python 2 dependency declarations to new packaging standards
6bb5ae
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
6bb5ae
6bb5ae
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.3-2
6bb5ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
6bb5ae
6bb5ae
* Tue May 23 2017 Michal Ambroz <rebus _AT seznam.cz> - 2.3.3-1
6bb5ae
- bump to upstream 2.3.3
6bb5ae
6bb5ae
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.1-4
6bb5ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
6bb5ae
6bb5ae
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.3.1-3
6bb5ae
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
6bb5ae
6bb5ae
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.1-2
6bb5ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
6bb5ae
6bb5ae
* Sat Dec 26 2015 Sven Lankes <athmane@fedoraproject.org> - 2.3.1-1
6bb5ae
- update to latest upstream release (2.3.1)
6bb5ae
- Update to 2.3.1
6bb5ae
- Remove upstreamed patch
6bb5ae
- Some spec fixes
6bb5ae
- Thanks to Athmane Madjoudj for the patch
6bb5ae
6bb5ae
* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.0-6
6bb5ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
6bb5ae
6bb5ae
* Thu Oct 02 2014 Lubomir Rintel <lkundrak@v3.sk> - 2.2.0-5
6bb5ae
- Fix psdump()/pdfdump()
6bb5ae
6bb5ae
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.0-4
6bb5ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
6bb5ae
6bb5ae
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.0-3
6bb5ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
6bb5ae
6bb5ae
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.0-2
6bb5ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
6bb5ae
6bb5ae
* Sun Jul 22 2012 Sven Lankes <sven@lank.es> - 2.2.0-1
6bb5ae
- Update to Scapy 2.2.0
6bb5ae
- Fixes rhbz #788659 - thanks to Thiébaud Weksteen
6bb5ae
6bb5ae
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.0.10-7
6bb5ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
6bb5ae
6bb5ae
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.0.10-6
6bb5ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
6bb5ae
6bb5ae
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.0.10-5
6bb5ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
6bb5ae
6bb5ae
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 2.0.0.10-4
6bb5ae
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
6bb5ae
6bb5ae
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.0.10-3
6bb5ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
6bb5ae
6bb5ae
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.0.10-2
6bb5ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
6bb5ae
6bb5ae
* Mon Dec 22 2008 Devan Goodwin <dgoodwin@dangerouslyinc.com> 2.0.0.10-1
6bb5ae
- Update to Scapy 2.0.0.10.
6bb5ae
6bb5ae
* Sun Dec 07 2008 Devan Goodwin <dgoodwin@dangerouslyinc.com> 2.0.0.9-2
6bb5ae
- Update for Scapy 2.0.0.9.
6bb5ae
6bb5ae
* Tue Jan 22 2008 Devan Goodwin <dgoodwin@dangerouslyinc.com> 1.1.1-4
6bb5ae
- Switch to using rm macro.
6bb5ae
6bb5ae
* Mon Jan 21 2008 Devan Goodwin <dgoodwin@dangerouslyinc.com> 1.1.1-2
6bb5ae
- Spec file cleanup.
6bb5ae
6bb5ae
* Fri Jan 18 2008 Devan Goodwin <dgoodwin@dangerouslyinc.com> 1.1.1-1
6bb5ae
- Initial packaging for Fedora.
6bb5ae