rpkg man page

rpkg — RPM Packaging utility

Synopsis

rpkg [ global_options ] command [ command_options ] [ command_arguments ]
rpkg help
rpkg command --help

Description

rpkg is a script to interact with the RPM Packaging system.

Global Options

 --config CONFIG, -C CONFIG
                       Specify a config file to use
 --release RELEASE     Override the discovered release from current branch,
                       which is used to determine the build target and value
                       of dist macro. Generally, release is the name of a
                       branch created in your package repository. --release
                       is an alias of --dist, hence --release should be
                       instead.
 --dist DIST           Deprecated. Use --release instead. You can use --dist
                       for a while for backward-compatibility. It will be
                       disabled in future version.
 --module-name MODULE_NAME
                       Override the module name. Otherwise it is discovered
                       from: Git push URL or Git URL (last part of path with
                       .git extension removed) or from name macro in spec
                       file. In that order.
 --user USER           Override the discovered user name
 --password PASSWORD   Password for Koji login
 --runas RUNAS         Run Koji commands as a different user
 --path PATH           Define the directory to work in (defaults to cwd)
 --verbose, -v         Run with verbose debug output
 --debug, -d           Run with debug output
 -q                    Run quietly only displaying errors

Command Overview

rpkg build [-h] [--arches [ARCHES [ARCHES ...]]] [--md5] [--nowait] [--target TARGET] [--background] [--skip-nvr-check] [--skip-tag] [--scratch] [--srpm [SRPM]]

Request build

rpkg chain-build [-h] [--arches [ARCHES [ARCHES ...]]] [--md5] [--nowait] [--target TARGET] [--background] package [package ...]

Build current package in order with other packages

rpkg ci [-h] [-m MESSAGE] [--with-changelog] [-c] [--raw] [-t] [-F FILE] [-p] [-s] [files [files ...]]

Alias for commit

rpkg clean [-h] [--dry-run] [-x]

Remove untracked files

rpkg clog [-h] [--raw]

Make a clog file containing top changelog entry

rpkg clone [-h] [--branches] [--branch BRANCH] [--anonymous] module [clone_target]

Clone and checkout a module

rpkg co [-h] [--branches] [--branch BRANCH] [--anonymous] module [clone_target]

Alias for clone

rpkg commit [-h] [-m MESSAGE] [--with-changelog] [-c] [--raw] [-t] [-F FILE] [-p] [-s] [files [files ...]]

Commit changes

rpkg compile [-h] [--builddir BUILDDIR] [--arch ARCH] [--short-circuit] [--nocheck]

Local test rpmbuild compile

rpkg container-build [-h] [--repo-url [URL [URL ...]]] [--osbs-config PATH] [--instance SECTION] [--scratch] [--target TARGET] [--build-with {koji,osbs}] [--nowait]

build a container

rpkg container-build-setup [-h] (--get-autorebuild | --set-autorebuild {true,false})

set options for container-build

rpkg copr-build [-h] [--nowait] project

Build package in Copr

rpkg diff [-h] [--cached] [files [files ...]]

Show changes between commits, commit and working tree, etc

rpkg gimmespec [-h]

Print the spec file name

rpkg gitbuildhash [-h] build

Print the git hash used to build the provided n-v-r

rpkg giturl [-h]

Print the git url for building

rpkg help [-h]

Show usage

rpkg import [-h] [--skip-diffs] srpm

Import srpm content into a module

rpkg install [-h] [--builddir BUILDDIR] [--arch ARCH] [--short-circuit] [--nocheck]

Local test rpmbuild install

rpkg lint [-h] [--info] [--rpmlintconf RPMLINTCONF]

Run rpmlint against local spec and build output if present.

rpkg local [-h] [--builddir BUILDDIR] [--arch ARCH] [--md5]

Local test rpmbuild binary

rpkg mock-config [-h] [--target TARGET] [--arch ARCH]

Generate a mock config

rpkg mockbuild [-h] [--root CONFIG] [--md5] [--no-clean] [--no-cleanup-after] [--no-clean-all]

Local test build using mock

rpkg new [-h]

Diff against last tag

rpkg new-sources [-h] files [files ...]

Upload new source files

rpkg patch [-h] [--rediff] suffix

Create and add a gendiff patch file

rpkg prep [-h] [--builddir BUILDDIR] [--arch ARCH]

Local test rpmbuild prep

rpkg pull [-h] [--rebase] [--no-rebase]

Pull changes from the remote repository and update the working copy.

rpkg push [-h] [--force]

Push changes to remote repository

rpkg scratch-build [-h] [--arches [ARCHES [ARCHES ...]]] [--md5] [--nowait] [--target TARGET] [--background] [--srpm [SRPM]]

Request scratch build

rpkg sources [-h] [--outdir OUTDIR]

Download source files

rpkg srpm [-h] [--md5]

Create a source rpm

rpkg switch-branch [-h] [-l] [--fetch] [branch]

Work with branches

rpkg tag [-h] [-f] [-m MESSAGE] [-c] [--raw] [-F FILE] [-l] [-d] [tag]

Management of git tags

rpkg unused-patches [-h]

Print list of patches not referenced by name in the specfile

rpkg upload [-h] files [files ...]

Upload source files

rpkg verify-files [-h] [--builddir BUILDDIR] [--arch ARCH]

Locally verify %%files section

rpkg verrel [-h]

Print the name-version-release

Command Reference

rpkg build

 usage: rpkg build [-h] [--arches [ARCHES [ARCHES ...]]] [--md5] [--nowait]
                   [--target TARGET] [--background] [--skip-nvr-check]
                   [--skip-tag] [--scratch] [--srpm [SRPM]]
 
 This command requests a build of the package in the build system. By default
 it discovers the target to build for based on branch data, and uses the latest
 commit as the build source.
 
 optional arguments:
   -h, --help            show this help message and exit
   --arches [ARCHES [ARCHES ...]]
                         Build for specific arches
   --md5                 Use md5 checksums (for older rpm hosts)
   --nowait              Don't wait on build
   --target TARGET       Define build target to build into
   --background          Run the build at a low priority
   --skip-nvr-check      Submit build to buildsystem without check if NVR was
                         already build. NVR is constructed locally and may be
                         different from NVR constructed during build on
                         builder.
   --skip-tag            Do not attempt to tag package
   --scratch             Perform a scratch build
   --srpm [SRPM]         Build from an srpm. If no srpm is provided with this
                         option an srpm will be generated from current module
                         content.
 

rpkg chain-build

 usage: rpkg chain-build [-h] [--arches [ARCHES [ARCHES ...]]] [--md5]
                         [--nowait] [--target TARGET] [--background]
                         package [package ...]
 
 Build current package in order with other packages.
 
 example: rpkg chain-build libwidget libgizmo
 
 The current package is added to the end of the CHAIN list.
 Colons (:) can be used in the CHAIN parameter to define groups of
 packages.  Packages in any single group will be built in parallel
 and all packages in a group must build successfully and populate
 the repository before the next group will begin building.
 
 For example:
 
 rpkg chain-build libwidget libaselib : libgizmo :
 
 will cause libwidget and libaselib to be built in parallel, followed
 by libgizmo and then the current directory package. If no groups are
 defined, packages will be built sequentially.
 
 positional arguments:
   package               List the packages and order you want to build in
 
 optional arguments:
   -h, --help            show this help message and exit
   --arches [ARCHES [ARCHES ...]]
                         Build for specific arches
   --md5                 Use md5 checksums (for older rpm hosts)
   --nowait              Don't wait on build
   --target TARGET       Define build target to build into
   --background          Run the build at a low priority
 

rpkg ci

 usage: rpkg ci [-h] [-m MESSAGE] [--with-changelog] [-c] [--raw] [-t]
                [-F FILE] [-p] [-s]
                [files [files ...]]
 
 Alias for commit.
 
 positional arguments:
   files                 Optional list of specific files to commit
 
 optional arguments:
   -h, --help            show this help message and exit
   -m MESSAGE, --message MESSAGE
                         Use the given <msg> as the commit message summary
   --with-changelog      Get the last changelog from SPEC as commit message
                         content. This option must be used with -m together.
   -c, --clog            Generate the commit message from the Changelog section
   --raw                 Make the clog raw
   -t, --tag             Create a tag for this commit
   -F FILE, --file FILE  Take the commit message from the given file
   -p, --push            Commit and push as one action
   -s, --signoff         Include a signed-off-by
 

rpkg clean

 usage: rpkg clean [-h] [--dry-run] [-x]
 
 This command can be used to clean up your working directory. By default it
 will follow .gitignore rules.
 
 optional arguments:
   -h, --help     show this help message and exit
   --dry-run, -n  Perform a dry-run
   -x             Do not follow .gitignore rules
 

rpkg clog

 usage: rpkg clog [-h] [--raw]
 
 This will create a file named "clog" that contains the latest rpm changelog
 entry. The leading "- " text will be stripped.
 
 optional arguments:
   -h, --help  show this help message and exit
   --raw       Generate a more "raw" clog without twiddling the contents
 

rpkg clone

 usage: rpkg clone [-h] [--branches] [--branch BRANCH] [--anonymous]
                   module [clone_target]
 
 This command will clone the named module from the configured repository base
 URL. By default it will also checkout the master branch for your working copy.
 
 positional arguments:
   module                Name of the module to clone
   clone_target          Directory in which to clone the module
 
 optional arguments:
   -h, --help            show this help message and exit
   --branches, -B        Do an old style checkout with subdirs for branches
   --branch BRANCH, -b BRANCH
                         Check out a specific branch
   --anonymous, -a       Check out a module anonymously
 

rpkg co

 usage: rpkg co [-h] [--branches] [--branch BRANCH] [--anonymous]
                module [clone_target]
 
 Alias for clone.
 
 positional arguments:
   module                Name of the module to clone
   clone_target          Directory in which to clone the module
 
 optional arguments:
   -h, --help            show this help message and exit
   --branches, -B        Do an old style checkout with subdirs for branches
   --branch BRANCH, -b BRANCH
                         Check out a specific branch
   --anonymous, -a       Check out a module anonymously
 

rpkg commit

 usage: rpkg commit [-h] [-m MESSAGE] [--with-changelog] [-c] [--raw] [-t]
                    [-F FILE] [-p] [-s]
                    [files [files ...]]
 
 This invokes a git commit. All tracked files with changes will be committed
 unless a specific file list is provided. $EDITOR will be used to generate a
 changelog message unless one is given to the command. A push can be done at
 the same time.
 
 positional arguments:
   files                 Optional list of specific files to commit
 
 optional arguments:
   -h, --help            show this help message and exit
   -m MESSAGE, --message MESSAGE
                         Use the given <msg> as the commit message summary
   --with-changelog      Get the last changelog from SPEC as commit message
                         content. This option must be used with -m together.
   -c, --clog            Generate the commit message from the Changelog section
   --raw                 Make the clog raw
   -t, --tag             Create a tag for this commit
   -F FILE, --file FILE  Take the commit message from the given file
   -p, --push            Commit and push as one action
   -s, --signoff         Include a signed-off-by
 

rpkg compile

 usage: rpkg compile [-h] [--builddir BUILDDIR] [--arch ARCH] [--short-circuit]
                     [--nocheck]
 
 This command calls rpmbuild to compile the source. By default the prep and
 configure stages will be done as well, unless the short-circuit option is
 used.
 
 optional arguments:
   -h, --help           show this help message and exit
   --builddir BUILDDIR  Define an alternate builddir
   --arch ARCH          Prep for a specific arch
   --short-circuit      short-circuit compile
   --nocheck            nocheck compile
 

rpkg container-build

 usage: rpkg container-build [-h] [--repo-url [URL [URL ...]]]
                             [--osbs-config PATH] [--instance SECTION]
                             [--scratch] [--target TARGET]
                             [--build-with {koji,osbs}] [--nowait]
 
 build a container.
 
 optional arguments:
   -h, --help            show this help message and exit
   --repo-url [URL [URL ...]]
                         URL of yum repo file
   --target TARGET       Override the default target
   --build-with {koji,osbs}
                         Build container with specified builder type. Default
                         is koji
   --nowait              Don't wait on build
 
 osbs:
   --osbs-config PATH    path to file with configuration of osbs
   --instance SECTION    use specific instance specified by section name in
                         config
 
 koji:
   --scratch             Scratch build
 

rpkg container-build-setup

 usage: rpkg container-build-setup [-h]
                                   (--get-autorebuild | --set-autorebuild {true,false})
 
 set options for container-build.
 
 optional arguments:
   -h, --help            show this help message and exit
   --get-autorebuild     Get autorebuild value
   --set-autorebuild {true,false}
                         Turn autorebuilds on/off
 

rpkg copr-build

 usage: rpkg copr-build [-h] [--nowait] project
 
 Build package in Copr.
 
 Note: you need to have set up correct api key. For more information
 see API KEY section of copr-cli(1) man page.
 
 positional arguments:
   project     Name of the project in format USER/PROJECT
 
 optional arguments:
   -h, --help  show this help message and exit
   --nowait    Don't wait on build
 

rpkg diff

 usage: rpkg diff [-h] [--cached] [files [files ...]]
 
 Use git diff to show changes that have been made to tracked files. By default
 cached changes (changes that have been git added) will not be shown.
 
 positional arguments:
   files       Optionally diff specific files
 
 optional arguments:
   -h, --help  show this help message and exit
   --cached    View staged changes
 

rpkg gimmespec

 usage: rpkg gimmespec [-h]
 
 Print the spec file name.
 
 optional arguments:
   -h, --help  show this help message and exit
 

rpkg gitbuildhash

 usage: rpkg gitbuildhash [-h] build
 
 This will show you the commit hash string used to build the provided build
 n-v-r
 
 positional arguments:
   build       name-version-release of the build to query.
 
 optional arguments:
   -h, --help  show this help message and exit
 

rpkg giturl

 usage: rpkg giturl [-h]
 
 This will show you which git URL would be used in a build command. It uses the
 git hashsum of the HEAD of the current branch (which may not be pushed).
 
 optional arguments:
   -h, --help  show this help message and exit
 

rpkg help

 usage: rpkg help [-h]
 
 Show usage.
 
 optional arguments:
   -h, --help  show this help message and exit
 

rpkg import

 usage: rpkg import [-h] [--skip-diffs] srpm
 
 This will extract sources, patches, and the spec file from an srpm and update
 the current module accordingly. It will import to the current branch by
 default.
 
 positional arguments:
   srpm          Source rpm to import
 
 optional arguments:
   -h, --help    show this help message and exit
   --skip-diffs  Don't show diffs when import srpms
 

rpkg install

 usage: rpkg install [-h] [--builddir BUILDDIR] [--arch ARCH] [--short-circuit]
                     [--nocheck]
 
 This will call rpmbuild to run the install section. All leading sections will
 be processed as well, unless the short-circuit option is used.
 
 optional arguments:
   -h, --help           show this help message and exit
   --builddir BUILDDIR  Define an alternate builddir
   --arch ARCH          Prep for a specific arch
   --short-circuit      short-circuit install
   --nocheck            nocheck install
 

rpkg lint

 usage: rpkg lint [-h] [--info] [--rpmlintconf RPMLINTCONF]
 
 Rpmlint can be configured using the --rpmlintconf/-r option or by setting a
 .rpmlint file in the working directory
 
 optional arguments:
   -h, --help            show this help message and exit
   --info, -i            Display explanations for reported messages
   --rpmlintconf RPMLINTCONF, -r RPMLINTCONF
                         Use a specific configuration file for rpmlint
 

rpkg local

 usage: rpkg local [-h] [--builddir BUILDDIR] [--arch ARCH] [--md5]
 
 Locally test run of rpmbuild producing binary RPMs. The rpmbuild output will
 be logged into a file named .build-%{version}-%{release}.log
 
 optional arguments:
   -h, --help           show this help message and exit
   --builddir BUILDDIR  Define an alternate builddir
   --arch ARCH          Prep for a specific arch
   --md5                Use md5 checksums (for older rpm hosts)
 

rpkg mock-config

 usage: rpkg mock-config [-h] [--target TARGET] [--arch ARCH]
 
 This will generate a mock config based on the buildsystem target
 
 optional arguments:
   -h, --help       show this help message and exit
   --target TARGET  Override target used for config
   --arch ARCH      Override local arch
 

rpkg mockbuild

 usage: rpkg mockbuild [-h] [--root CONFIG] [--md5] [--no-clean]
                       [--no-cleanup-after] [--no-clean-all]
 
 This will use the mock utility to build the package for the distribution
 detected from branch information. This can be overridden using the global
 --dist option. Your user must be in the local "mock" group.
 
 optional arguments:
   -h, --help            show this help message and exit
   --root CONFIG, --mock-config CONFIG
                         Override mock configuration (like mock -r)
   --md5                 Use md5 checksums (for older rpm hosts)
   --no-clean, -n        Do not clean chroot before building package
   --no-cleanup-after    Do not clean chroot after building (if automatic
                         cleanup is enabled
   --no-clean-all, -N    Alias for both --no-clean and --no-cleanup-after
 
 If config file for mock isn't found in the /etc/mock directory, a temporary
 config directory for mock is created and populated with a config file created
 with mock-config.
 

rpkg new

 usage: rpkg new [-h]
 
 This will use git to show a diff of all the changes (even uncommitted changes)
 since the last git tag was applied.
 
 optional arguments:
   -h, --help  show this help message and exit
 

rpkg new-sources

 usage: rpkg new-sources [-h] files [files ...]
 
 This will upload new source files to the lookaside cache and remove any
 existing ones. The "sources" and .gitignore files will be updated with the new
 uploaded file(s).
 
 positional arguments:
   files
 
 optional arguments:
   -h, --help  show this help message and exit
 

rpkg patch

 usage: rpkg patch [-h] [--rediff] suffix
 
 Create and add a gendiff patch file.
 
 positional arguments:
   suffix      Look for files with this suffix to diff
 
 optional arguments:
   -h, --help  show this help message and exit
   --rediff    Recreate gendiff file retaining comments Saves old patch file
               with a suffix of ~
 
 Patch file will be named: package-version-suffix.patch and the file will be
 added to the repo index
 

rpkg prep

 usage: rpkg prep [-h] [--builddir BUILDDIR] [--arch ARCH]
 
 Use rpmbuild to "prep" the sources (unpack the source archive(s) and apply any
 patches.)
 
 optional arguments:
   -h, --help           show this help message and exit
   --builddir BUILDDIR  Define an alternate builddir
   --arch ARCH          Prep for a specific arch
 

rpkg pull

 usage: rpkg pull [-h] [--rebase] [--no-rebase]
 
 This command uses git to fetch remote changes and apply them to the current
 working copy. A rebase option is available which can be used to avoid merges.
 
 optional arguments:
   -h, --help   show this help message and exit
   --rebase     Rebase the locally committed changes on top of the remote
                changes after fetching. This can avoid a merge commit, but does
                rewrite local history.
   --no-rebase  Do not rebase, overriding .git settings to the contrary
 
 See git pull --help for more details
 

rpkg push

 usage: rpkg push [-h] [--force]
 
 Push changes to remote repository.
 
 optional arguments:
   -h, --help   show this help message and exit
   --force, -f  Force push
 

rpkg scratch-build

 usage: rpkg scratch-build [-h] [--arches [ARCHES [ARCHES ...]]] [--md5]
                           [--nowait] [--target TARGET] [--background]
                           [--srpm [SRPM]]
 
 This command will request a scratch build of the package. Without providing an
 srpm, it will attempt to build the latest commit, which must have been pushed.
 By default all appropriate arches will be built.
 
 optional arguments:
   -h, --help            show this help message and exit
   --arches [ARCHES [ARCHES ...]]
                         Build for specific arches
   --md5                 Use md5 checksums (for older rpm hosts)
   --nowait              Don't wait on build
   --target TARGET       Define build target to build into
   --background          Run the build at a low priority
   --srpm [SRPM]         Build from an srpm. If no srpm is provided with this
                         option an srpm will be generated from the current
                         module content.
 

rpkg sources

 usage: rpkg sources [-h] [--outdir OUTDIR]
 
 Download source files
 
 optional arguments:
   -h, --help       show this help message and exit
   --outdir OUTDIR  Directory to download files into (defaults to pwd)
 

rpkg srpm

 usage: rpkg srpm [-h] [--md5]
 
 Create a source rpm
 
 optional arguments:
   -h, --help  show this help message and exit
   --md5       Use md5 checksums (for older rpm hosts)
 

rpkg switch-branch

 usage: rpkg switch-branch [-h] [-l] [--fetch] [branch]
 
 This command can switch to a local git branch. If provided with a remote
 branch name that does not have a local match it will create one. It can also
 be used to list the existing local and remote branches.
 
 positional arguments:
   branch      Branch name to switch to
 
 optional arguments:
   -h, --help  show this help message and exit
   -l, --list  List both remote-tracking branches and local branches
   --fetch     Fetch new data from remote before switch
 

rpkg tag

 usage: rpkg tag [-h] [-f] [-m MESSAGE] [-c] [--raw] [-F FILE] [-l] [-d] [tag]
 
 This command uses git to create, list, or delete tags.
 
 positional arguments:
   tag                   Name of the tag
 
 optional arguments:
   -h, --help            show this help message and exit
   -f, --force           Force the creation of the tag
   -m MESSAGE, --message MESSAGE
                         Use the given <msg> as the tag message
   -c, --clog            Generate the tag message from the spec changelog
                         section
   --raw                 Make the clog raw
   -F FILE, --file FILE  Take the tag message from the given file
   -l, --list            List all tags with a given pattern, or all if not
                         pattern is given
   -d, --delete          Delete a tag
 

rpkg unused-patches

 usage: rpkg unused-patches [-h]
 
 Print list of patches not referenced by name in the specfile.
 
 optional arguments:
   -h, --help  show this help message and exit
 

rpkg upload

 usage: rpkg upload [-h] files [files ...]
 
 This command will add a new source archive to the lookaside cache. The sources
 and .gitignore file will be updated with the new file(s).
 
 positional arguments:
   files
 
 optional arguments:
   -h, --help  show this help message and exit
 

rpkg verify-files

 usage: rpkg verify-files [-h] [--builddir BUILDDIR] [--arch ARCH]
 
 Locally run 'rpmbuild -bl' to verify the spec file's %files sections. This
 requires a successful run of 'rpkg install' in advance.
 
 optional arguments:
   -h, --help           show this help message and exit
   --builddir BUILDDIR  Define an alternate builddir
   --arch ARCH          Prep for a specific arch
 

rpkg verrel

 usage: rpkg verrel [-h]
 
 Print the name-version-release.
 
 optional arguments:
   -h, --help  show this help message and exit
 

See Also

https://fedorahosted.org/rpkg/

Info

2017-02-22 rpm-packager