URL source
Provide direct HTTP/HTTPS URLs to SRPM or spec files.SRPM URLs
Provide URLs to.src.rpm or .nosrc.rpm files:
Spec file URLs
Provide a URL to a.spec file. Copr will download sources specified in the spec during the build:
Multiple URLs
Submit multiple builds at once by separating URLs with spaces or newlines:Upload source
Upload SRPM or spec files directly from your local machine.- CLI
- Web UI
SCM source
Build from Git, DistGit, or SVN repositories containing RPM spec files.Basic usage
SCM options
Type SCM type:git or svn
/ for absolute repository paths:
SRPM build methods
Copr supports four methods for generating SRPMs from SCM repositories.rpkg (default)
rpkg (default)
The default method using rpkg-util. Supports Git, SVN, and DistGit repositories.
Starting from December 2021, Copr uses rpkg-util v3. Your spec files need to use
{{{ }}} templates. See the rpkg-util documentation for details.tito
tito
Uses Tito to build SRPM from the latest Git tag.
The repository must be initialized with
tito init first. The spec file field is ignored when using Tito.tito_test
tito_test
Uses Tito with the
--test flag to build from a specific committish instead of the latest tag.make_srpm
make_srpm
Executes a user-provided Makefile to generate the SRPM. Create a The Makefile is invoked as:Parameters:
.copr/Makefile in your repository with an srpm target.Example .copr/Makefile:outdir: Where to place the resulting SRPMspec: The spec file path (can be ignored if not needed)
Complete SCM example
DistGit source
Simplified interface for building from Fedora or CentOS DistGit repositories.Building from Fedora DistGit
Building from CentOS DistGit
DistGit options
Name Package name in DistGit:fedora):
The SRPM is downloaded once per build, regardless of the number of chroots. All chroots build from the same SRPM, which may cause incompatibilities if building for multiple OS versions.
Workaround for multiple OS versions
Submit separate builds for different branches:PyPI source
Build Python packages directly from PyPI.PyPI options
Package name PyPI package name:pyp2rpm(legacy)pyp2spec(default, recommended)
defaultfedoraepel7mageiapld
Example PyPI build
RubyGems source
Build Ruby gems from RubyGems.org.RubyGems options
Gem name Gem name from RubyGems.org:Example RubyGems build
Custom source (script)
Use a custom script to generate sources for building SRPMs.Creating a custom source package
Custom source options
Script The script that generates sources. Must be executable and start with a shebang:fedora-latest-x86_64):
Environment variables
COPR_RESULTDIR Directory where you must place the spec file and sources. hook_data For custom webhook builds, POST data is available in thehook_data file in the current directory.
Complete custom source example
script.sh:The custom script runs with root privileges inside a mock chroot and has internet access.
Choosing a source type
When to use URL source
When to use URL source
Use URL source when:
- You already have built SRPMs hosted somewhere
- You want to quickly test a build without setting up package definitions
- You’re building from a one-time URL
When to use Upload source
When to use Upload source
Use Upload source when:
- You have SRPMs or spec files on your local machine
- You’re doing quick tests or one-off builds
- You want to build locally-modified packages
When to use SCM source
When to use SCM source
Use SCM source when:
- Your package sources are in Git or SVN
- You want to rebuild automatically via webhooks
- You use tito or rpkg for package management
- You need fine-grained control over the build process
When to use DistGit source
When to use DistGit source
Use DistGit source when:
- You’re building from Fedora or CentOS DistGit
- You want a simpler interface than SCM
- You’re building Fedora packages in Copr
When to use PyPI source
When to use PyPI source
Use PyPI source when:
- You’re packaging Python projects from PyPI
- You want automatic spec file generation
- You’re creating RPMs for Python modules
When to use RubyGems source
When to use RubyGems source
Use RubyGems source when:
- You’re packaging Ruby gems from RubyGems.org
- You want automatic spec file generation
- You’re creating RPMs for Ruby gems
When to use Custom source
When to use Custom source
Use Custom source when:
- You need a completely custom build process
- Existing source types don’t fit your workflow
- You need to perform complex preparation steps
- You want to integrate with external systems