mb2 === mb2 does ``rpm`` builds inside a qemu environement. Typically invoked by :doc:`sb2 `. ((???) Executes a subset of build commands in the context of an ``rpmbuild``. Typically called from QtCreator to perform ``qmake``/``make`` phases of a project. Note that any other build steps in the ``.spec`` file will also be run. The mb2 tool is developed at the sailfishos Github organization under `sailfishos/sdk-setup `_. ``mb2`` is part of the :doc:`Sailfish SDK suite ` and resides at ``/usr/bin/mb2`` in the SDK chroot. Command Synopsis ^^^^^^^^^^^^^^^^ .. code:: usage: mb2 [-t ] [-s ] [-d ] [-o ] [-p ] [-f ] [-i] [-P] [-x[=] | -X] [-c[=]] build [-p] [-d] [-j ] [] | qmake [] | make [] | ssh install [] | installdeps | rpm [] | deploy prep | apply [-R] | run mb2 --version Usage ^^^^^ Executes a subset of build commands in the context of an ``rpmbuild``. Typically called from QtCreator to perform ``qmake``/``make`` phases of a project. Note that any other build steps in the ``.spec`` file will also be run. ```` will be looked for in the current ``rpm/`` dir. If there is more than one it must be provided. ``CWD`` is used as a base dir for ``installroot/`` and ``RPMS/`` to allow for shadowbuilds. ``mb2`` is aware of spectacle and will update the spec file if there is an obvious ``yaml`` file which is newer. If a file exists with ``.changes`` extension, otherwise matching the spec file name, the effect will be the same as having a ``%changelog`` section in the spec file. If a file with ``.changes.run`` extension is found instead, this file will be executed and its output treated as the actual changelog. Operations ^^^^^^^^^^ +---------------------+---------------------------------------------------------+ | Command | Explanation | +=====================+=========================================================+ | prep | Runs ``rpmbuild`` for ``%prep`` phase of the spec file. | | | Can use ``-n`` | +---------------------+---------------------------------------------------------+ | build | runs rpmbuild for the given spec file in the | [-p|--doprep] | given sb2 target. Produces an rpm package. | [-d|--enable-debug] | | [-j ] | [] | : | | : -p run %prep phase as well when building | : -d enable debug build | : -j use only 'n' CPUs to build | : can use -s -t -p -i -x -X -c -n +---------------------+---------------------------------------------------------+ mb2 qmake [] : runs qmake in the 'build' phase Note that this also verifies target build dependencies are up to date : can use -s -t -p -n mb2 make [] : run make in the 'build' phase : can use -s -t -p mb2 deploy --zypper|--pkcon|--rsync|--sdk : runs the install or rpm-creation phase and then copies/installs the relevant files to the device : can use -s -t -p -d -i -f -x -X -c mb2 run|ssh [] : runs a command (on device if --device given); intended for running gdb and a gdb server : can use -s -t -p -d mb2 install [] : runs the 'install' phase to install to $buildroot : can use -s -t -p mb2 installdeps [] : refresh the zypper cache of the given target and if required installs build-dependencies : can use -s -t -p mb2 rpm [] : runs the install & rpm-creation phases : can use -s -t -p -i -x -X -c mb2 apply [-R] : applies all patches defined in spec from rpm directory : to the source tree, or if detected, submodule : source tree : -R reverse apply patches (patch -R) : can use -m Option Arguments ^^^^^^^^^^^^^^^^ -i | --increment : increment release number in spec file -t | --target : specify the sb2 target to use -d | --device : specify the device -o | --outputdir : where to place produced RPM files. Defaults to ./RPMS directory. With this option existing files in the output directory are preserved -p | --projectdir : when running shadow build/deploy from another dir -s | --specfile : if the specfile is not in rpm/*.spec and cannot be found using -p -f | --shared-folder : the folder where QtCreator shares devices.xml and ssh keys this option is useful if deploy option is used outside of virtual machine -P | --pedantic : do extra checks -x[=] | --fix-version[=] : this option is implied when used inside a Git working tree (use -X to override). Within Application SDK it is only implied if the version recorded in the spec file is exactly "0". Use the latest tag from the current git branch as package version or the given . If the current HEAD, index or working tree differs from the tree denoted by the tag, a suffix composed from the current branch name, time stamp and a commit SHA1 will be added to the package version. If git-state is not clean a git-stash will be created and its SHA1 will be used instead of HEAD. -X | --no-fix-version : override --fix-version option. -n | --no-deps : don't update target dependencies -c[=] | --git-change-log[=] : include change log generated from Git history with 'git-change-log' command, forwarding any . This option is not intended for regular use - create a script file named after the spec file but with '.changes.run' extension to instruct mb2 to generate changelog with 'git-change-log ' instead. -m | --submodule : use specified directory as submodule when applying patches