Jump to: navigation, search

Rpm-packaging/ReviewGuidelines

< Rpm-packaging
Revision as of 06:32, 16 March 2016 by IYozhikov (talk | contribs) (Removed syntax overview due update of documentation for renderspec)

Purpose

The main goal to use templates instead of SPEC - flexibility and unification. Templates made in Jinja2 format.
It means that templates made in one way after processing by renderspec tool will fit all supported Linux vendors(SUSE, Fedora, CentOS).

Tool-set

openstack-macros - sub-project which allows to add or substitute required RPM macro used in SPEC template.
pymod2pkg - project used for translation of python source name aka pypi name into Linux package name.
renderspec - main tool used for transformation from SPEC template into SPEC file.


Common rules

Head

  • Versions:

Lower bounds should be specified in both cases - for Requires and for BuildRequires entries at least for projects with versions set in requirements.txt and test-requirements.txt files
Example:

BuildRequires: {{ py2pkg('netaddr', ('>=', '0.7.12')) }}
Requires:  {{ py2pkg('netaddr', ('>=', '0.7.12')) }}

In case of unset - un-managed versions - rendering should be executed with --requirements global-requirements.txt cli arguments to fill up resulting spec file with proper versions.

Documentation

For *-doc package should be specified additional section which describes all meta-data for doc package.
BuildRequires: - populated only with projects required for documentation build.
Please use %bcond_with docs in case of necessity!
Exmaple:

%if %{with docs}
%package doc
....
%endif

%if %{with docs}
%files doc
...
%endif

Tests

Useful but not mandatory. All directives for unit tests must be set under %check section.
All required for tests projects should be specified as BuildRequires: in the top of template.
Please use %bcond_with test in case of necessity!
Exmaple:

%if %{with test}
BuildRequires: required for test projects
....
%endif

%if %{with test}
%check
...
%endif

Misc but important!

Under %files section for each package in SPEC template:

  • Section %doc should not include: HACKING*, CONTRIBUTING* and AUTHORS
  • Section %license should be specified in case of LICENCE file availability in source code