diff --git a/macros.pybytecompile3.4 b/macros.pybytecompile3.4 deleted file mode 100644 index a8b79b2..0000000 --- a/macros.pybytecompile3.4 +++ /dev/null @@ -1,12 +0,0 @@ -# Note that the path could itself be a python file, or a directory - -# Python's compile_all module only works on directories, and requires a max -# recursion depth - -%py_byte_compile()\ -python_binary="%1"\ -bytecode_compilation_path="%2"\ -find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("$RPM_BUILD_ROOT")[2]) for f in sys.argv[1:]]' || :\ -\ -find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("$RPM_BUILD_ROOT")[2]) for f in sys.argv[1:]]' || :\ -%{nil} diff --git a/macros.pybytecompile3.5 b/macros.pybytecompile3.5 new file mode 100644 index 0000000..a8b79b2 --- /dev/null +++ b/macros.pybytecompile3.5 @@ -0,0 +1,12 @@ +# Note that the path could itself be a python file, or a directory + +# Python's compile_all module only works on directories, and requires a max +# recursion depth + +%py_byte_compile()\ +python_binary="%1"\ +bytecode_compilation_path="%2"\ +find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("$RPM_BUILD_ROOT")[2]) for f in sys.argv[1:]]' || :\ +\ +find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("$RPM_BUILD_ROOT")[2]) for f in sys.argv[1:]]' || :\ +%{nil} diff --git a/macros.python3.4 b/macros.python3.4 deleted file mode 100644 index a633c72..0000000 --- a/macros.python3.4 +++ /dev/null @@ -1,16 +0,0 @@ -%__python3 /usr/bin/python3 -%python3_sitelib %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") -%python3_sitearch %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") -%python3_version %(%{__python3} -c "import sys; sys.stdout.write(sys.version[:3])") -%python3_version_nodots %(%{__python3} -c "import sys; sys.stdout.write(sys.version[:3].replace('.',''))") -%py3dir %{_builddir}/python3-%{name}-%{version}-%{release} - -%py3_shbang_opts -s - -%py3_build() %{expand:\ -CFLAGS="%{optflags}" %{__python3} %{py_setup} %{?py_setup_args} build --executable="%{__python3} %{py3_shbang_opts}" %{?1}\ -} - -%py3_install() %{expand:\ -CFLAGS="%{optflags}" %{__python3} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?1}\ -} diff --git a/macros.python3.5 b/macros.python3.5 new file mode 100644 index 0000000..a633c72 --- /dev/null +++ b/macros.python3.5 @@ -0,0 +1,16 @@ +%__python3 /usr/bin/python3 +%python3_sitelib %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") +%python3_sitearch %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") +%python3_version %(%{__python3} -c "import sys; sys.stdout.write(sys.version[:3])") +%python3_version_nodots %(%{__python3} -c "import sys; sys.stdout.write(sys.version[:3].replace('.',''))") +%py3dir %{_builddir}/python3-%{name}-%{version}-%{release} + +%py3_shbang_opts -s + +%py3_build() %{expand:\ +CFLAGS="%{optflags}" %{__python3} %{py_setup} %{?py_setup_args} build --executable="%{__python3} %{py3_shbang_opts}" %{?1}\ +} + +%py3_install() %{expand:\ +CFLAGS="%{optflags}" %{__python3} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?1}\ +}