Bug 200446

Summary: Expanding macro undefines other macro
Product: [Fedora] Fedora Reporter: Alexander Larsson <alexl>
Component: rpmAssignee: Paul Nasrat <nobody+pnasrat>
Status: CLOSED WORKSFORME QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: toshio
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-07-28 11:03:20 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Test case none

Description Alexander Larsson 2006-07-27 18:45:47 UTC
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.

Comment 1 Alexander Larsson 2006-07-27 18:46:45 UTC
Created attachment 133185 [details]
Test case

Comment 2 Alexander Larsson 2006-07-27 18:53:28 UTC
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.

Comment 3 Toshio Kuratomi 2006-07-27 22:45:03 UTC
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.

Comment 4 Jeff Johnson 2006-07-28 11:03:20 UTC
Using %global apears to solve the preoblem.