| |
@@ -20,6 +20,31 @@
|
| |
%python2 %__python2
|
| |
%python3 %__python3
|
| |
|
| |
+ # Users can use %%python only if they redefined %%__python (e.g. to %%__python3)
|
| |
+ %python() %{lua:\
|
| |
+ __python = rpm.expand("%__python")\
|
| |
+ if __python == "/usr/bin/python" then\
|
| |
+ rpm.expand("%{error:Cannot use %%python if %%__python wasn't redefined to something other than /usr/bin/python.}")\
|
| |
+ else\
|
| |
+ print(__python)\
|
| |
+ end\
|
| |
+ }
|
| |
+
|
| |
+ # This only supports Python 3.5+ and will never work with Python 2.
|
| |
+ # Hence, it has no Python version in the name.
|
| |
+ %pycached() %{lua:
|
| |
+ path = rpm.expand("%{?1}")
|
| |
+ if (string.sub(path, "-3") ~= ".py") then
|
| |
+ rpm.expand("%{error:%%pycached can only be used with paths explicitly ending with .py}")
|
| |
+ else
|
| |
+ print(path)
|
| |
+ pyminor = path:match("/python3.(%d+)/") or "*"
|
| |
+ dirname = path:match("(.*/)")
|
| |
+ modulename = path:match(".*/([^/]+).py")
|
| |
+ print("\\n" .. dirname .. "__pycache__/" .. modulename .. ".cpython-3" .. pyminor .. "{,.opt-?}.pyc")
|
| |
+ end
|
| |
+ }
|
| |
+
|
| |
# gpgverify verifies signed sources. There is documentation in the script.
|
| |
%gpgverify %{_rpmconfigdir}/gpgverify
|
| |
|
| |
Whoever merges this, please backport properly to playground, I still haven't grasped this thing.