diff --git a/netcdf4-python.spec b/netcdf4-python.spec index 71d220c..f481961 100644 --- a/netcdf4-python.spec +++ b/netcdf4-python.spec @@ -32,6 +32,8 @@ BuildRequires: numpy %if 0%{?with_python3} BuildRequires: python3-devel BuildRequires: python3-numpy +# For 2to3 +BuildRequires: python-tools %endif # if with_python3 BuildRequires: netcdf-devel @@ -95,6 +97,7 @@ containing vlens, and vlens containing compound types) are not supported. %if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} +2to3 --write --nobackups %{py3dir} find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' %endif # with_python3