From: Jan Palus Date: Sat, 6 Mar 2021 11:44:36 +0000 (+0100) Subject: fix shebang; use python3 in bin by default; rel 3 X-Git-Tag: auto/th/python-netaddr-0.7.19-3 X-Git-Url: http://git.pld-linux.org/gitweb.cgi?a=commitdiff_plain;h=390271c06c798528e00dd798e43aabf26b210ca9;p=packages%2Fpython-netaddr.git fix shebang; use python3 in bin by default; rel 3 --- diff --git a/python-netaddr.spec b/python-netaddr.spec index 022d0d0..f4c6d02 100644 --- a/python-netaddr.spec +++ b/python-netaddr.spec @@ -7,11 +7,12 @@ Summary: A pure Python network address representation and manipulation library Name: python-netaddr Version: 0.7.19 -Release: 2 +Release: 3 License: BSD Group: Development/Languages/Python Source0: https://pypi.python.org/packages/source/n/netaddr/%{module}-%{version}.tar.gz # Source0-md5: 51019ef59c93f3979bcb37d3b8527e07 +Patch0: script-shebang.patch URL: https://github.com/drkjam/netaddr/ BuildRequires: rpmbuild(macros) >= 1.710 BuildRequires: python-modules @@ -68,13 +69,21 @@ Included are routines for: %package -n netaddr Summary: An interactive shell for the Python netaddr library Group: Development/Languages/Python +%if %{with python3} +Requires: python3-netaddr = %{version}-%{release} +%else Requires: %{name} = %{version}-%{release} +%endif %description -n netaddr Interactive shell for the python-netaddr library. %prep %setup -q -n %{module}-%{version} +%patch0 -p1 + +%{__sed} -i -e '1s,/usr/bin/env python,%{?with_python3:%{__python3}}%{!?with_python3:%{__python}},' \ + netaddr/tools/netaddr %build %py_build diff --git a/script-shebang.patch b/script-shebang.patch new file mode 100644 index 0000000..60cf66b --- /dev/null +++ b/script-shebang.patch @@ -0,0 +1,14 @@ +--- netaddr-0.7.19/setup.py.orig 2017-01-12 00:42:52.000000000 +0100 ++++ netaddr-0.7.19/setup.py 2021-03-06 12:37:29.685301598 +0100 +@@ -174,11 +174,6 @@ + scripts=['netaddr/tools/netaddr'], + url='https://github.com/drkjam/netaddr/', + version=netaddr.__version__, +- options={ +- 'build_scripts': { +- 'executable': '/usr/bin/env python', +- }, +- }, + ) + + setup(**setup_options)