Skip to content

rpmpack: skip SOURCERPM tag for source RPMs#105

Open
alexma233 wants to merge 1 commit into
google:masterfrom
alexma233:feat/source-rpm-skip-sourcerpm-tag
Open

rpmpack: skip SOURCERPM tag for source RPMs#105
alexma233 wants to merge 1 commit into
google:masterfrom
alexma233:feat/source-rpm-skip-sourcerpm-tag

Conversation

@alexma233
Copy link
Copy Markdown

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 -bs never writes it. The comment in writeGenIndexes even 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:

  • Adds a SourceRPM field to RPMMetaData (defaults to false, no breaking change).
  • When SourceRPM: true, writeGenIndexes skips the SOURCERPM tag.
  • Includes a test verifying the tag is present for binary RPMs and absent for source RPMs.

Downstream consumers (nFPM's srpm packager, GoReleaser's srpm pipe) can set SourceRPM: true to produce SRPMs compatible with COPR and other RPM build infrastructure.

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.
@google-cla
Copy link
Copy Markdown

google-cla Bot commented May 1, 2026

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.

@alexma233
Copy link
Copy Markdown
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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants