[opensuse-packaging] Generating parts of spec
Hello I want to ask, if is possible generate parts of spec file. I tried to experiment with macros but not luck (or bad hands) Idea is, in package where is very very much repeting work, do that work in loop. I am trying to do package with new Tesseract, which has about 32 supported languages, which are packed separately in previous package. I wanna continue with that. Yes, first possibility is use brute force and create huge spec. It is quickest and simplest. But I am donig packages for fun and want some inteligence in it. My idea is something about this (not exactly Python, would fight with bash if needed) languages = ("deu", "ell", "eng", ...) count = 1 for lang in languages: return "Source"+str(count)+": "+lang+".data.tar.gz" count = count + 1 and later the same with header, and description for subpackage, files etc. So supported languages could be added only with editing languages variable languages. Thank you Michal Smrž -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On 20/10/10 09:31, Michal Smrž wrote:
Hello
I want to ask, if is possible generate parts of spec file. I tried to experiment with macros but not luck (or bad hands)
Idea is, in package where is very very much repeting work, do that work in loop.
I am trying to do package with new Tesseract, which has about 32 supported languages, which are packed separately in previous package. I wanna continue with that.
Yes, first possibility is use brute force and create huge spec. It is quickest and simplest. But I am donig packages for fun and want some inteligence in it.
My idea is something about this (not exactly Python, would fight with bash if needed)
languages = ("deu", "ell", "eng", ...) count = 1 for lang in languages: return "Source"+str(count)+": "+lang+".data.tar.gz" count = count + 1
and later the same with header, and description for subpackage, files etc. So supported languages could be added only with editing languages variable languages.
Thank you
Michal Smrž Look at e.g. kde4-l10n which generates a spec file through a combination of perl and bash. https://build.opensuse.org/package/files?package=kde4-l10n&project=KDE%3ADistro%3AFactory.
Regards, Tejas -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Look at e.g. kde4-l10n which generates a spec file through a combination of perl and bash. https://build.opensuse.org/package/files?package=kde4-l10n&project=KDE%3ADistro%3AFactory.
Regards, Tejas
Thats it, and it's not too. If I get it right. It's not possible to generate parts of spec online during build. Instead I should do scripts, which creates huge spec (as in example above) offline and upload it (with that script of course)? -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Le mercredi 20 octobre 2010 à 12:17 +0200, Michal Smrž a écrit :
Look at e.g. kde4-l10n which generates a spec file through a combination of perl and bash. https://build.opensuse.org/package/files?package=kde4-l10n&project=KDE%3ADistro%3AFactory.
Regards, Tejas
Thats it, and it's not too. If I get it right. It's not possible to generate parts of spec online during build. Instead I should do scripts, which creates huge spec (as in example above) offline and upload it (with that script of course)?
You could use rpm macro to "expand" a specfile at build time. You can look at an example here (sorry, I don't have a openSUSE example handy) : http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/mandriva-theme/current/SPECS/mandriva-theme.spec?revision=548706&view=markup -- Frederic Crozat <fcrozat@novell.com> Novell -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
participants (3)
-
Frederic Crozat
-
Michal Smrž
-
Tejas Guruswamy