rpmpack: skip SOURCERPM tag for source RPMs#105
Open
alexma233 wants to merge 1 commit into
Open
Conversation
When building a source RPM, the SOURCERPM tag (1044) must be absent. rpm utilities treat its presence as indicating a binary (non-source) RPM. `rpmbuild -bs` does not write this tag. Add a `SourceRPM` field to `RPMMetaData`. When true, writeGenIndexes skips the SOURCERPM tag. Default (false) preserves existing behaviour. Fixes compatibility with build services (e.g. Fedora COPR) that reject source RPMs containing the SOURCERPM tag.
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
caarlos0
approved these changes
May 1, 2026
Author
|
Hi @jarondl , gentle ping on this PR. It has an approval and is mergeable. This fixes SRPM compatibility with Fedora COPR by skipping the SOURCERPM tag when building source RPMs, matching rpmbuild -bs behavior. Could you take a look when you have a chance? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When building a source RPM, the
SOURCERPM(RPMTAG_SOURCERPM, 1044) tag should be absent. RPM utilities treat the presence of this tag as indicating that the package is a binary (non-source) RPM —rpmbuild -bsnever writes it. The comment inwriteGenIndexeseven documents this: "rpm utilities look for the sourcerpm tag to deduce if this is not a source rpm (if it has a sourcerpm, it is NOT a source rpm)."Build services like Fedora COPR reject source RPMs that contain
SOURCERPM. Even though such an SRPM is accepted for import (SRPMResults finish), the presence of the tag prevents the service from scheduling downstream binary chroot builds.This PR:
SourceRPMfield toRPMMetaData(defaults tofalse, no breaking change).SourceRPM: true,writeGenIndexesskips theSOURCERPMtag.Downstream consumers (nFPM's
srpmpackager, GoReleaser's srpm pipe) can setSourceRPM: trueto produce SRPMs compatible with COPR and other RPM build infrastructure.