#150 new guideline proposal: Scripting inside of spec files
Closed: Fixed None Opened 12 years ago by notting.

Moving here from list discussion.

Scripting inside of spec files

Sometimes it is necessary to write a short script (perhaps a one-liner) that
is executed in the %setup, %build, or %install sections of a spec file to
get some information about the build environment. In Fedora, spec
files may in general only use the following languages for this purpose:

  1. Python
  2. Perl
  3. Standard programs used in shell programing, for instance gawk or sed

Additionally, if your package cannot build without a specific scripting
language (such as Ruby, or Tcl), and therefore already has a
BuildRequires on that language, it may also be called from the spec file.

Note: If you call perl or python in your spec file, make sure to add
BuildRequires for perl or python.

Rationale: Use of fringe scripting languages, or languages unrelated to the package being built, leads to a more complex dependency graph and causes problems when bootstrapping or rebuilding the OS. Also, limiting the languages used makes working on Fedora spec files more uniform, and easier for more packagers.


Scripting inside of spec files

Sometimes it is necessary to write a short script (perhaps a one-liner) that is executed in the %setup, %build, or %install sections of a spec file to get some information about the build environment. In Fedora, spec files should only use the following languages for this purpose:

1. Python
2. Perl
3. Standard programs used in shell programing, for instance gawk or sed 
4. Lua (as supported by the native lua interpreter in rpm)

Additionally, if your package cannot build without a specific scripting language (such as Ruby, or Tcl), and therefore already has a BuildRequires? on that language, it may also be called from the spec file.

Note: If you call perl or python in your spec file (and it is not already a BuildRequires for the package), you need to explicitly add a BuildRequires? for perl or python.

Rationale: Use of fringe scripting languages, or languages unrelated to the package being built, leads to a more complex dependency graph and causes problems when bootstrapping or rebuilding the OS. Also, limiting the languages used makes working on Fedora spec files more uniform, and easier for more packagers.

Worded as a SHOULD, this is approved. (+1:7, 0:0, -1:0)

Announcetext:

Rules involving appropriate scripting within Fedora Package spec files were added to the Guidelines:

https://fedoraproject.org/wiki/Packaging:Guidelines#Scripting_inside_of_spec_files

Metadata Update from @spot:
- Issue assigned to spot

7 years ago

Login to comment on this ticket.

Metadata