| |
@@ -1,6 +1,6 @@
|
| |
Name: python-impacket
|
| |
- Version: 0.9.19
|
| |
- %global rel 2
|
| |
+ Version: 0.9.20
|
| |
+ %global baserelease 1
|
| |
|
| |
License: ASL 1.1 and zlib
|
| |
URL: https://github.com/SecureAuthCorp/impacket
|
| |
@@ -22,35 +22,31 @@
|
| |
|
| |
%global sum Collection of Python classes providing access to network packets
|
| |
|
| |
- %global with_python3 0
|
| |
- %global with_python27 1
|
| |
- %global with_tests 0
|
| |
-
|
| |
- #Python sitearch/sitelib macros for RHEL6
|
| |
- %if 0%{?rhel} && 0%{?rhel} <= 6
|
| |
- %{!?__python2: %global __python2 /usr/bin/python2}
|
| |
- %{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
|
| |
- %{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
|
| |
+ %if 0%{?rhel} < 8 && 0%{?fedora} < 32
|
| |
+ %global __python %{__python2}
|
| |
+ %global pyprefix python2
|
| |
+ %else
|
| |
+ %global __python %{__python3}
|
| |
+ %global pyprefix python%{python3_pkgversion}
|
| |
%endif
|
| |
|
| |
- #Python build/install macros for older platforms
|
| |
- %if 0%{?fedora} <= 21
|
| |
- %{!?py2_build: %global py2_build %{__python2} setup.py build --executable="%{__python2} -s"}
|
| |
- %{!?py2_install: %global py2_install %{__python2} setup.py install -O1 --skip-build --root %{buildroot}}
|
| |
- %{!?py3_build: %global py3_build %{__python3} setup.py build --executable="%{__python3} -s"}
|
| |
- %{!?py3_install: %global py3_install %{__python3} setup.py install -O1 --skip-build --root %{buildroot}}
|
| |
+ %if 0%{?rhel} == 8
|
| |
+ # https://bugzilla.redhat.com/show_bug.cgi?id=1757833
|
| |
+ %global __python2 %{__python3}
|
| |
%endif
|
| |
|
| |
+ %global with_tests 0
|
| |
+
|
| |
%global pkgver %(echo %{version} | sed 's/\\./_/g')
|
| |
|
| |
# Build source is github release=1 or git commit=0
|
| |
%global build_release 1
|
| |
|
| |
%if 0%{?build_release} > 0
|
| |
- Release: %{rel}%{?dist}
|
| |
+ Release: %{baserelease}%{?dist}
|
| |
Source0: https://github.com/%{gituser}/%{gitname}/releases/download/%{gitname}_%{pkgver}/%{gitname}-%{version}.tar.gz
|
| |
%else:
|
| |
- Release: %{rel}.%{gitdate}git%{shortcommit}%{?dist}
|
| |
+ Release: %{baserelease}.%{gitdate}git%{shortcommit}%{?dist}
|
| |
Source0: https://github.com/%{gituser}/%{gitname}/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz
|
| |
%endif #Build_release
|
| |
|
| |
@@ -68,16 +64,8 @@
|
| |
BuildRequires: sed
|
| |
BuildRequires: grep
|
| |
|
| |
- %if 0%{?with_python27}
|
| |
- BuildRequires: python2
|
| |
- BuildRequires: python2-devel
|
| |
- BuildRequires: python2-setuptools
|
| |
- %endif # with_python27
|
| |
-
|
| |
- %if 0%{?with_python3}
|
| |
- BuildRequires: python%{python3_pkgversion}-devel
|
| |
- BuildRequires: python%{python3_pkgversion}-setuptools
|
| |
- %endif # with_python3
|
| |
+ BuildRequires: %{pyprefix}-devel
|
| |
+ BuildRequires: %{pyprefix}-setuptools
|
| |
|
| |
|
| |
|
| |
@@ -91,52 +79,42 @@
|
| |
|
| |
|
| |
|
| |
- #===== the python2 package definition
|
| |
- %if 0%{?with_python27}
|
| |
- %package -n python2-%{gitname}
|
| |
+ #===== the python package definition
|
| |
+ %package -n %{pyprefix}-%{gitname}
|
| |
Summary: %{sum}
|
| |
- %{?python_provide:%python_provide python2-%{gitname}}
|
| |
+ %{?python_provide:%python_provide %{pyprefix}-%{gitname}}
|
| |
Provides: %{name} = %{version}-%{release}
|
| |
Provides: impacket = %{version}-%{release}
|
| |
|
| |
# Used by many
|
| |
- Requires: python2-pycryptodomex
|
| |
+ Requires: %{pyprefix}-pycryptodomex
|
| |
|
| |
# Used by /usr/bin/npsexec.py
|
| |
- Requires: python2-crypto
|
| |
- Requires: python2-pyasn1
|
| |
+ Requires: %{pyprefix}-crypto
|
| |
+ Requires: %{pyprefix}-pyasn1
|
| |
|
| |
# Used by /usr/bin/nsplit.py
|
| |
- Requires: pcapy
|
| |
+ Requires: %{pyprefix}-pcapy
|
| |
# Used by /usr/bin/ntlmrelayx.py
|
| |
- Requires: python2-pyOpenSSL
|
| |
- Requires: python2-ldap3
|
| |
- # Used by impacket/examples/ntlmrelayx/servers/socksserver.py
|
| |
- Recommends: python2-httplib2
|
| |
- Recommends: python2-flask
|
| |
-
|
| |
+ Requires: %{pyprefix}-pyOpenSSL
|
| |
+ Requires: %{pyprefix}-ldap3
|
| |
|
| |
+ # Used by impacket/examples/ntlmrelayx/servers/socksserver.py
|
| |
+ %if 0%{?fedora} || 0%{?rhel} >= 8
|
| |
+ Recommends: %{pyprefix}-httplib2
|
| |
+ Recommends: %{pyprefix}-flask
|
| |
+ %else
|
| |
+ Requires: %{pyprefix}-httplib2
|
| |
+ Requires: %{pyprefix}-flask
|
| |
+ %endif
|
| |
|
| |
- %description -n python2-%{gitname}
|
| |
- Python2 package of %{name}.
|
| |
- Impacket is a collection of Python classes focused on providing access to
|
| |
- network packets. Impacket allows Python developers to craft and decode network
|
| |
- packets in simple and consistent manner. it is highly effective when used in
|
| |
- conjunction with a packet capture utility or package such as Pcapy. Packets
|
| |
- can be constructed from scratch, as well as parsed from raw data. Furthermore,
|
| |
- the object oriented API makes it simple to work with deep protocol hierarchies.
|
| |
-
|
| |
- %endif # with_python27
|
| |
-
|
| |
+ %if 0%{?rhel} < 8 && 0%{?fedora} < 32
|
| |
+ Obsoletes: python2-%{gitname} < 0.9.20-1
|
| |
+ %endif
|
| |
|
| |
- #===== the python3 package definition
|
| |
- %if 0%{?with_python3}
|
| |
- %package -n python%{python3_pkgversion}-%{gitname}
|
| |
- Summary: %{sum}
|
| |
- %{?python_provide:%python_provide python%{python3_pkgversion}-%{gitname}}
|
| |
|
| |
- %description -n python%{python3_pkgversion}-%{gitname}
|
| |
- Python3 package of %{name}.
|
| |
+ %description -n %{pyprefix}-%{gitname}
|
| |
+ Python package of %{name}.
|
| |
Impacket is a collection of Python classes focused on providing access to
|
| |
network packets. Impacket allows Python developers to craft and decode network
|
| |
packets in simple and consistent manner. it is highly effective when used in
|
| |
@@ -145,12 +123,6 @@
|
| |
the object oriented API makes it simple to work with deep protocol hierarchies.
|
| |
|
| |
|
| |
- Requires: python3-ldap3
|
| |
-
|
| |
- %endif # with_python3
|
| |
-
|
| |
-
|
| |
-
|
| |
#===== Preparation
|
| |
%prep
|
| |
%if 0%{?build_release} > 0
|
| |
@@ -164,9 +136,8 @@
|
| |
|
| |
# Clean-up
|
| |
|
| |
- # Use explicit python2 shabeng instead of generic env python
|
| |
- # to get prepared for switch the default to python3
|
| |
- sed -i -e 's|#!/usr/bin/env python|#!/usr/bin/python2|' \
|
| |
+ # Use explicit pythonX shabeng instead of generic env python
|
| |
+ sed -i -e 's|#!/usr/bin/env python|#!%{__python}|' \
|
| |
impacket/mqtt.py \
|
| |
impacket/examples/ntlmrelayx/servers/socksserver.py
|
| |
|
| |
@@ -178,63 +149,34 @@
|
| |
|
| |
#===== Build
|
| |
%build
|
| |
- %if 0%{?with_python27}
|
| |
- %py2_build
|
| |
- %endif # with_python27
|
| |
-
|
| |
- %if 0%{?with_python3}
|
| |
- %py3_build
|
| |
- %endif # with_python3
|
| |
-
|
| |
+ %py_build
|
| |
|
| |
|
| |
#===== Install
|
| |
%install
|
| |
- %if 0%{?with_python27}
|
| |
- %py2_install
|
| |
- %endif # with_python27
|
| |
-
|
| |
- %if 0%{?with_python3}
|
| |
- %py3_install
|
| |
- %endif # with_python3
|
| |
+ %py_install
|
| |
|
| |
#now in license directory
|
| |
rm -f %{buildroot}%{_defaultdocdir}/%{name}/LICENSE
|
| |
|
| |
|
| |
|
| |
- #===== files for python2 package
|
| |
- %if 0%{?with_python27}
|
| |
- %files -n python2-%{gitname}
|
| |
+ #===== files for python package
|
| |
+ %files -n %{pyprefix}-%{gitname}
|
| |
%license LICENSE
|
| |
%doc ChangeLog README.md
|
| |
- %{python2_sitelib}/%{gitname}/
|
| |
- %{python2_sitelib}/%{gitname}*.egg-info
|
| |
+ %{python_sitelib}/%{gitname}/
|
| |
+ %{python_sitelib}/%{gitname}*.egg-info/
|
| |
%exclude %{_defaultdocdir}/%{gitname}
|
| |
- %exclude %{_defaultdocdir}/%{gitname}/testcases/*
|
| |
%exclude %{_defaultdocdir}/%{gitname}/README.md
|
| |
%{_bindir}/*.py
|
| |
- %endif # with_python27
|
| |
-
|
| |
|
| |
|
| |
- #===== files for python3 package
|
| |
- %if 0%{?with_python3}
|
| |
-
|
| |
- %files -n python%{python3_pkgversion}-%{gitname}
|
| |
- %license LICENSE
|
| |
- %doc ChangeLog README.md
|
| |
- %{python3_sitelib}/%{gitname}*.egg-info
|
| |
- %{python3_sitelib}/__pycache__/*
|
| |
- %exclude %{_defaultdocdir}/%{gitname}
|
| |
- %exclude %{_defaultdocdir}/%{gitname}/testcases/*
|
| |
- %exclude %{_defaultdocdir}/%{gitname}/README.md
|
| |
- %{_bindir}/*.py
|
| |
-
|
| |
- %endif # with_python3
|
| |
-
|
| |
|
| |
%changelog
|
| |
+ * Wed Oct 09 2019 Miro Hrončok <mhroncok@redhat.com> - 0.9.20-1
|
| |
+ - Update to 0.9.20, switch to Python 3 on RHEL 8+ and Fedora 32+
|
| |
+
|
| |
* Tue Sep 17 2019 Miro Hrončok <mhroncok@redhat.com> - 0.9.19-2
|
| |
- Only recommend packages needed for examples
|
| |
|
| |
I went with only one Python version - The tools are more important than the Python module, hence it IMHO brings no benefit to build both python2-impacket and python3-impacket on one Fedora/EPEL version.
The logic is simple: For EPEL 8+ and Fedora 32+, build python3-impacket, for anything older, keep just python2-impacket.
This successfully builds on F29, F30, F31, f32, EPEL6, EPEL7 and EPEL8. I haven't really tested installing it and running it, but it builds.
If you push this to epel6 / epel7, a joined update with pcapy-0.10.5-7.el6 / pcapy-0.10.8-6.el7 is needed. Let me know if you need provenpackager rights.