On Fri, Feb 17, 2012 at 09:16:40AM -0500, Bill Nottingham wrote:
Jon Masters (jcm@redhat.com) said:
I hope everyone is having a good day. Here in the Fedora ARM project, we're having a great time overall, but we've run up against a familiar foe in our preparation for Fedora 17 and rawhide: superfluous deps in SPEC files. Today's example is a shell-escaped call to Ruby just to determine some gcc flags for an unrelated package build, but that's just today's example. There are many others, so some standard would help.
This isn't codified in current Guidelines that I know of. I do recall one thread on it from the very early days of Fedora (possibly before the FPC).
OK, so how about:
... Scripting inside of spec files
Inside of a spec file, sometimes it is necessary to call a programming or scripting language during %setup, %build, or %install. In Fedora, spec files may in general only use the following languages for this purpose:
- Python
- Perl
- awk/sed
Also, if your package already BuildRequires a specific scripting language (such as Ruby, or Tcl) as part of its normal compile process, it may also be called from the spec file.
That seems about right. Maybe be a little looser and allow using languages that are either BuildRequires or Requires already.
For instance, take a language that doesn't byte compile itself. If you had a package where upstream consists of a single file that you then have to cp to the right filesystem location to become a module for that language it wouldn't need the interpreter to compile. However, the best way to determine the filesystem location might be something like:: "foolanguage -e 'print libpath'"
It seems appropriate to use that in a spec file.
Also, #3 might be better if it was a little more vague::
"Standard programs used in shell programming, for instance awk and sed"
Another clarificaation might be to make the initial paragraph a little more specific:
"Sometimes it is necessary to write a short script (perhaps a one-liner) that's executed in %setup, %build, or %install to get some information about the build environment. In Fedora, spec files may in general only use the following languages for this purpose: [...]"
-Toshio