[python-nmap/f21] * Wed Dec 17 2014 Fabian Affolter <mail at fabian-affolter.ch> - 0.3.4-2 - Fix package naming (rhbz#117

Fabian Affolter fab at fedoraproject.org
Wed Dec 17 19:18:00 UTC 2014


commit 99144b7d960a7ae3840a7d18c79535baf32bb59c
Author: Fabian Affolter <fabian at affolter-engineering.ch>
Date:   Wed Dec 17 20:17:31 2014 +0100

    * Wed Dec 17 2014 Fabian Affolter <mail at fabian-affolter.ch> - 0.3.4-2
    - Fix package naming (rhbz#1174115)

 python-nmap.spec |   50 +++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 47 insertions(+), 3 deletions(-)
---
diff --git a/python-nmap.spec b/python-nmap.spec
index 0ac72d4..b78e24a 100644
--- a/python-nmap.spec
+++ b/python-nmap.spec
@@ -1,6 +1,13 @@
+%if 0%{?fedora} > 12
+%global with_python3 1
+%else
+%{!?__python2: %global __python2 /usr/bin/python2}
+%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
+%endif
+
 Name:           python-nmap
 Version:        0.3.4
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        A python library which helps in using nmap port scanner
 
 License:        GPLv3+
@@ -13,28 +20,65 @@ BuildRequires:  python3-setuptools
 
 Requires:       nmap
 
+%if 0%{?with_python3}
+BuildRequires:  python3-devel
+BuildRequires:  python3-setuptools
+
+Requires:       nmap
+%endif
+
 %description
 python-nmap is a python library which helps in using nmap port scanner. It
 allows to easily manipulate nmap scan results and will be a perfect tool
 for systems administrators who want to automatize scanning task and reports.
 It also supports nmap script outputs. 
 
+%if 0%{?with_python3}
+%package -n python3-%{srcname}
+Summary:        A python library which helps in using nmap port scanner
+
+%description -n python3-%{srcname}
+python3-nmap is a python library which helps in using nmap port scanner. It
+allows to easily manipulate nmap scan results and will be a perfect tool
+for systems administrators who want to automatize scanning task and reports.
+It also supports nmap script outputs. 
+%endif
+
 %prep
-%setup -q
+%setup -q -n %{srcname}-%{version}
+rm -rf %{srcname}.egg-info
 sed -i -e '/^#!\//, 1d' nmap/nmap.py example.py
+%if 0%{?with_python3}
+rm -rf %{py3dir}
+cp -a . %{py3dir}
+find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
+%endif
 
 %build
+%if 0%{?with_python3}
+pushd %{py3dir}
 %{__python3} setup.py build
+popd
+%endif
 
 %install
+%if 0%{?with_python3}
+pushd %{py3dir}
 %{__python3} setup.py install --skip-build --root %{buildroot}
+popd
+%endif
 
-%files
+%if 0%{?with_python3}
+%files -n python3-%{srcname}
 %doc CHANGELOG gpl-3.0.txt README.txt example.py
 %{python3_sitelib}/nmap/
 %{python3_sitelib}/*.egg-info
+%endif
 
 %changelog
+* Wed Dec 17 2014 Fabian Affolter <mail at fabian-affolter.ch> - 0.3.4-2
+- Fix package naming (rhbz#1174115)
+
 * Wed Aug 06 2014 Fabian Affolter <mail at fabian-affolter.ch> - 0.3.4-1
 - Switch to py3
 - Update the URL and the source URL


More information about the scm-commits mailing list