Jump to: navigation, search

Difference between revisions of "Rpm-packaging/ReviewGuidelines"

(add link to renderspec docs)
(Head)
Line 11: Line 11:
 
=Common rules=
 
=Common rules=
 
==Head==
 
==Head==
* '''Versions''':
+
* '''Group''':
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<br />
+
Setting up proper group for package is a requirement.<br>
 +
* '''Source0''':
 +
Source0 must points to existing tarball location, even if url constructed using macro.<br />
 
''Example:''<br />
 
''Example:''<br />
  BuildRequires: &#123;&#123; py2pkg('netaddr', ('>=', '0.7.12')) &#125;&#125;
+
  Group:     Development/Libraries
  Requires: &#123;&#123; py2pkg('netaddr', ('>=', '0.7.12')) &#125;&#125;
+
  Source0:    https://pypi.python.org/packages/source/o/%{sname}/%{sname}-%{version}.tar.gz
 
 
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==
 
==Documentation==

Revision as of 19:54, 13 April 2016

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. documentaion


Common rules

Head

  • Group:

Setting up proper group for package is a requirement.

  • Source0:

Source0 must points to existing tarball location, even if url constructed using macro.
Example:

Group:      Development/Libraries
Source0:    https://pypi.python.org/packages/source/o/%{sname}/%{sname}-%{version}.tar.gz

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