The attached testcase doesn't build, because the "%{python_sitelib}/foo2" line isn't expanded. However, if you remove the "%python_source /foo1" line, or make the python_source macro not take any argument, or make python_sitelib not be conditionally defined it works.
Created attachment 133185 [details] Test case
The end goal is to use this macro: %define python_source(source) %{python_sitelib}/%{name}/%{1}.py \ %{python_sitelib}/%{name}/%{1}.pyc \ %ghost %{python_sitelib}/%{name}/%{1}.pyo \ %{nil} to avoid duplication for python spec files where i can't use *.pyc.
This is caused by Bug #147238 which jbj closed as WONTFIX earlier this year. alexl: The workaround there is to use %global instead of %define. I had success using this line to set sitelib: %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} nasrat: Hope the information in that bug helps you track it down.
Using %global apears to solve the preoblem.