From Fedora Project Wiki
(Initial draft) |
mNo edit summary |
||
Line 7: | Line 7: | ||
* <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>)}} |
Revision as of 08:43, 12 October 2016
Guidelines for Ninja
This document provides best-practices for usage of ninja in packaging RPMs for Fedora.
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