From Fedora Project Wiki
(Initial draft) |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 2: | Line 2: | ||
This document provides best-practices for usage of [https://ninja-build.org/ ninja] in packaging RPMs for Fedora. | This document provides best-practices for usage of [https://ninja-build.org/ ninja] in packaging RPMs for Fedora. | ||
== BuildRequires == | |||
You '''MUST''' add following BuildRequires: | |||
<pre> | |||
BuildRequires: ninja-build | |||
</pre> | |||
== RPM Macros == | == RPM Macros == | ||
Line 7: | Line 15: | ||
* <code>%__ninja</code> -- ninja executable ('''NOTE''': it is <tt>/usr/bin/ninja-build</tt>) | * <code>%__ninja</code> -- ninja executable ('''NOTE''': it is <tt>/usr/bin/ninja-build</tt>) | ||
* <code>%__ninja_common_opts</code> -- common options for all commands below (for example, verbose mode and <tt>%{?_smp_mflags}</tt>) | * <code>%__ninja_common_opts</code> -- common options for all commands below (for example, verbose mode and <tt>%{?_smp_mflags}</tt>) | ||
* <code>%ninja_build -- run default target (ninja without arugments) | * <code>%ninja_build</code> -- run default target (ninja without arugments) | ||
* <code>%ninja_install -- set <tt>DESTDIR</tt> shell variable run <tt>install</tt> target within ninja | * <code>%ninja_install</code> -- set <tt>DESTDIR</tt> shell variable run <tt>install</tt> target within ninja | ||
* <code>%ninja_test -- run <tt>test</tt> target | * <code>%ninja_test</code> -- run <tt>test</tt> target | ||
{{admon/important|Custom commands|Usually it's enough to use macro above (e.g. <code>%ninja_build vapigen -C %{_target_platform}</code>, but if you need something more custom, don't forget to inherit <tt>%__ninja_common_opts</tt>.}} | {{admon/important|Custom commands|Usually it's enough to use macro above (e.g. <code>%ninja_build vapigen -C %{_target_platform}</code>, but if you need something more custom, don't forget to inherit <tt>%__ninja_common_opts</tt>.}} | ||
{{admon/tip|For more information see source code|<tt>%{rpmmacrodir}/macros.ninja</tt> (<tt>/usr/lib/rpm/macros.d/macros.ninja</tt>)}} | {{admon/tip|For more information see source code|<tt>%{rpmmacrodir}/macros.ninja</tt> (<tt>/usr/lib/rpm/macros.d/macros.ninja</tt>)}} |
Latest revision as of 08:46, 12 October 2016
Guidelines for Ninja
This document provides best-practices for usage of ninja in packaging RPMs for Fedora.
BuildRequires
You MUST add following BuildRequires:
BuildRequires: ninja-build
RPM Macros
%__ninja
-- ninja executable (NOTE: it is /usr/bin/ninja-build)%__ninja_common_opts
-- common options for all commands below (for example, verbose mode and %{?_smp_mflags})%ninja_build
-- run default target (ninja without arugments)%ninja_install
-- set DESTDIR shell variable run install target within ninja%ninja_test
-- run test target