From 1c9bc9fe83710a20ddc0c309d76bab69e3da924e Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Fri, 25 Oct 2024 04:05:38 +0000 Subject: automatic import of python3 --- python3.spec | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'python3.spec') diff --git a/python3.spec b/python3.spec index f9eee58..740bccc 100644 --- a/python3.spec +++ b/python3.spec @@ -1,3 +1,19 @@ +%global __extension_strip_flags() %{lua: +--the only argument to this macro is the "name" of the flags we strip (e.g. cflags, ldflags, etc.) +local name = rpm.expand("%{1}") +--store all the individual flags in a variable as a continuous string +local flags = rpm.expand("%{build_" .. name .. "}") +--create an empty table for the minimal set of flags we wanna preserve +local stripped_flags = { } +--iterate over the individual flags and store the ones we want in the table as unique keys +for flag in flags:gmatch("%%S+") do + if flag:find("^%%-fexceptions") or flag:find("^%%-fcf%%-protection") then + stripped_flags[flag] = true end + end +--print out the finalized set of flags for use by the extension builders +for k,_ in pairs(stripped_flags) do print(k .. " ") end +} + Name: python3 Summary: Interpreter of the Python3 programming language URL: https://www.python.org/ @@ -187,8 +203,9 @@ rm -r Modules/expat rm Lib/ensurepip/_bundled/*.whl rm configure pyconfig.h.in + %global extra_cflags -O2 -%trace +#trace export CFLAGS="%{extension_cflags} %{?extra_cflags} -D_GNU_SOURCE -fPIC -fwrapv -fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2" export CFLAGS_NODIST="%{build_cflags} %{?extra_cflags} -D_GNU_SOURCE -fPIC -fwrapv" @@ -847,7 +864,7 @@ export BEP_GTDLIST="$BEP_GTDLIST_TMP" %undefine _debuginfo_subpackages -%files help +#%files help %{_mandir}/*/* %changelog -- cgit v1.2.3