|
Thomas Spura |
ca3f1c9 |
%py_setup setup.py
|
|
Thomas Spura |
ca3f1c9 |
%py_shbang_opts -s
|
|
Thomas Spura |
ca3f1c9 |
|
|
Thomas Spura |
ca3f1c9 |
%py_build() %{expand:\
|
|
Thomas Spura |
ca3f1c9 |
CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args} build --executable="%{__python2} %{py_shbang_opts}" %{?1}\
|
|
Thomas Spura |
ca3f1c9 |
}
|
|
Thomas Spura |
ca3f1c9 |
|
|
Thomas Spura |
ca3f1c9 |
%py_install() %{expand:\
|
|
Thomas Spura |
ca3f1c9 |
CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?1}\
|
|
Thomas Spura |
ca3f1c9 |
}
|
|
Thomas Spura |
ca3f1c9 |
|
|
Thomas Spura |
ca3f1c9 |
%python_provide() %{lua:\
|
|
Thomas Spura |
ca3f1c9 |
function string.starts(String,Start)\
|
|
Thomas Spura |
ca3f1c9 |
return string.sub(String,1,string.len(Start))==Start\
|
|
Thomas Spura |
ca3f1c9 |
end\
|
|
Thomas Spura |
ca3f1c9 |
str = rpm.expand("%{?1:%{1}}");\
|
|
Thomas Spura |
0fea7cf |
vr = rpm.expand("%{?epoch:%{epoch}:}%{version}-%{release}")
|
|
Thomas Spura |
ca3f1c9 |
if (string.starts(str, "python2-")) then\
|
|
Thomas Spura |
ca3f1c9 |
print("Provides: python-");\
|
|
Thomas Spura |
ca3f1c9 |
print(string.sub(str,9,string.len(str)));\
|
|
Thomas Spura |
dbd604e |
print(" = ");\
|
|
Thomas Spura |
dbd604e |
print(vr);\
|
|
Orion Poplawski |
4d16a15 |
--Obsoleting the previous default python package\
|
|
Orion Poplawski |
dbbd127 |
print("\\nObsoletes: python-");\
|
|
Orion Poplawski |
4d16a15 |
print(string.sub(str,9,string.len(str)));\
|
|
Orion Poplawski |
4d16a15 |
print(" < ");\
|
|
Orion Poplawski |
4d16a15 |
print(vr);\
|
|
Thomas Spura |
ca3f1c9 |
elseif (string.starts(str, "python3-")) then\
|
|
Thomas Spura |
ca3f1c9 |
--No unversioned provides as python3 is not default\
|
|
Thomas Spura |
ca3f1c9 |
elseif (string.starts(str, "pypy-")) then\
|
|
Thomas Spura |
ca3f1c9 |
--No unversioned provides as pypy is not default\
|
|
Thomas Spura |
ca3f1c9 |
elseif (string.starts(str, "pypy3-")) then\
|
|
Thomas Spura |
ca3f1c9 |
--No unversioned provides as pypy is not default\
|
|
Thomas Spura |
ca3f1c9 |
elseif (string.starts(str, "python-")) then\
|
|
Thomas Spura |
ca3f1c9 |
--Providing the current default python\
|
|
Thomas Spura |
ca3f1c9 |
print("Provides: python2-");\
|
|
Orion Poplawski |
4d16a15 |
print(string.sub(str,8,string.len(str)));\
|
|
Thomas Spura |
dbd604e |
print(" = ");\
|
|
Thomas Spura |
dbd604e |
print(vr);\
|
|
Thomas Spura |
ca3f1c9 |
else\
|
|
Thomas Spura |
ca3f1c9 |
print("ERROR: ");\
|
|
Thomas Spura |
ca3f1c9 |
print(str);\
|
|
Thomas Spura |
ca3f1c9 |
print("not recognized.");\
|
|
Thomas Spura |
ca3f1c9 |
end\
|
|
Thomas Spura |
ca3f1c9 |
}
|