Question

I am pulling my hair out over an issue I am having with building rpms through LTIB. I am trying to write my own spec file and for some reason It seems as though simple macros I have defined will not expand within the %Files section.

For example, at the top of my spec file I have the following:

%define myfilepath %{pfx}/lib/python%{pyver}/site-packages/wx-2.8-gtk2-unicode/

and my %Files section looks like this:

%Files
%defattr(-,root,root)
%{myfilepath}

Yet when I run ./ltib -m scdeploy -p I get the following error

RPM build errors: File must begin with "/": %{myfilepath} Build time for wxPython: 0 seconds

Is there something I'm missing? Nowhere in the documentation do I see that macros are dissallowed in the %Files section. predefined macros seem to expand fine within the %files section but any macro I have defined with %define in the header of my spec file acts as though its undefined when I am running ltib with the scdeploy option. Macros all work as expected when executing ltib withprep, scbuild and scinstall modes.

Edit: Using ltib version 9.1.1, rpmbuild version 4.0.4

Was it helpful?

Solution

Managed to figure it out after looking at the ltib source. It turns out ltib fabricates a spec file when running in scdeploy mode. This fabricated spec file only preserves the contents of the %files section in the spec file you wrote so the header and all of the macros you defined there are lost.

Not sure why LTIB behaves this way for scdeploy and not sbuild, scinstall, etc. I have a question out to the LTIB mailing list.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top