Hello, All!
I'm want share some rpm macros across few packages. Try add it in separate file as source and install as devel file in package.
For example simple file, say testmacros as Source1 with next content: %define testmacro() %{expand:%( echo TEST )}
Then, in spec file include it: source %{SOURCE1}
but get error: + source testmacros testmacros: line 1: syntax error near unexpected token `('
I think because macroses should be included before it processed as shell script. Is there some variant of %include or similar?
Pavel Alexeev (aka Pahan-Hubbitus) wrote:
I think because macroses should be included before it processed as shell script. Is there some variant of %include or similar?
AFAIK, no. E.g. in kde-filesystem, we end up defining things twice, once for the specfile itself and once for the .macros file: http://cvs.fedoraproject.org/viewvc/rpms/kde-filesystem/devel/kde-filesystem...
Kevin Kofler
On Fri, 21 May 2010, Kevin Kofler wrote:
Pavel Alexeev (aka Pahan-Hubbitus) wrote:
I think because macroses should be included before it processed as shell script. Is there some variant of %include or similar?
AFAIK, no. E.g. in kde-filesystem, we end up defining things twice, once for the specfile itself and once for the .macros file: http://cvs.fedoraproject.org/viewvc/rpms/kde-filesystem/devel/kde-filesystem...
And neither of you actually thought to try whether %include works? :D Hint: it does, in spec files.
- Panu -
21.05.2010 20:58, Panu Matilainen ?????:
On Fri, 21 May 2010, Kevin Kofler wrote:
Pavel Alexeev (aka Pahan-Hubbitus) wrote:
I think because macroses should be included before it processed as shell script. Is there some variant of %include or similar?
AFAIK, no. E.g. in kde-filesystem, we end up defining things twice, once for the specfile itself and once for the .macros file: http://cvs.fedoraproject.org/viewvc/rpms/kde-filesystem/devel/kde-filesystem...
And neither of you actually thought to try whether %include works? :D Hint: it does, in spec files.
- Panu -
Thanks for the answers. Panu, you are sure? I try, and rpmbuild encountered error - https://bugzilla.redhat.com/show_bug.cgi?id=597835
30.05.2010 21:19, Pavel Alexeev (aka Pahan-Hubbitus) ?????:
21.05.2010 20:58, Panu Matilainen ?????:
On Fri, 21 May 2010, Kevin Kofler wrote:
Pavel Alexeev (aka Pahan-Hubbitus) wrote:
I think because macroses should be included before it processed as shell script. Is there some variant of %include or similar?
AFAIK, no. E.g. in kde-filesystem, we end up defining things twice, once for the specfile itself and once for the .macros file: http://cvs.fedoraproject.org/viewvc/rpms/kde-filesystem/devel/kde-filesystem...
And neither of you actually thought to try whether %include works? :D Hint: it does, in spec files.
- Panu -
Thanks for the answers. Panu, you are sure? I try, and rpmbuild encountered error - https://bugzilla.redhat.com/show_bug.cgi?id=597835
Sorry for the answer to themselves. Now, when bug fixed and rpm hit rawhide I can continue test it suggestion. And it does not work on strange manner - it is not produce any error, but also does nothing! So, in minimal spec file was attached in the bug I have now in %prep: %include %{SOURCE0} %{testmacros} exit 102
And at build time no TEST appeared: $ LANG=C rpmbuild -ba test.spec + umask 022 + cd /home/pasha/SOFT/rpmbuild/BUILD + LANG=C + export LANG + unset DISPLAY + exit 102 error: Bad exit status from /home/pasha/SOFT/rpmbuild/BUILD/_tmp/rpm-tmp.ECc7qg (%prep) Bad exit status from /home/pasha/SOFT/rpmbuild/BUILD/_tmp/rpm-tmp.ECc7qg (%prep)
Please, can you more describe how it should work? What is prerequisites? May be link on detailed explanation?