diff options
author | CoprDistGit <infra@openeuler.org> | 2024-10-25 04:05:38 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2024-10-25 04:05:38 +0000 |
commit | 1c9bc9fe83710a20ddc0c309d76bab69e3da924e (patch) | |
tree | 31c517dd2707ecbb87f7f91a86e9ca9fc942d325 /python3.spec | |
parent | 4a955f59f266357b08717e0130ec7552fa3f3a3e (diff) |
automatic import of python3
Diffstat (limited to 'python3.spec')
-rw-r--r-- | python3.spec | 21 |
1 files changed, 19 insertions, 2 deletions
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 |