.. _srpm:

srpm
====

.. program:: srpm

Synopsis
--------

::

    Create a source rpm

Description
-----------


This command wraps "rpmbuild -bs", roughly equivalent to:

  rpmbuild -bs mypackage.spec \
    --define "_topdir ." \
    --define "_sourcedir ." \
    --define "_srcrpmdir ." \
    --define "dist .el8"

To include files in the SRPM, the files must be in the current
working directory (this depends on the package layout used),
and you must reference each file with SourceXXXX: or PatchXXXX:
directives in your .spec file.


Arguments
---------

.. option:: extra_args

   Custom arguments that are passed to the 'rpmbuild'. Use '--' to separate them from other arguments.



Options
-------

.. option:: -h --help

   show this help message and exit

.. option:: --builddir

   Define an alternate builddir

.. option:: --buildrootdir

   Define an alternate buildrootdir

.. option:: --arch

   Prep for a specific arch

.. option:: --define

   Pass custom macros to rpmbuild, may specify multiple times

.. option:: --md5

   Use md5 checksums (for older rpm hosts)

.. option:: --srpm-mock

   Create source rpm in 'mock' instead of 'rpmbuild'

.. option:: --no-clean -n

   Only for ``--srpm-mock``: Do not clean chroot before building package

.. option:: --no-cleanup-after

   Only for ``--srpm-mock``: Do not clean chroot after building if automatic cleanup is enabled

.. option:: --no-clean-all -N

   Only for ``--srpm-mock``: Alias for both ``--no-clean`` and ``--no-cleanup-after``