[build2] Set RPM epoch

Boris Kolpackov boris at codesynthesis.com
Wed Jun 4 13:27:36 UTC 2025


Paul Stath via users <users at build2.org> writes:

> To set the epoch, I added the  "fedora-version" to the project manifest
> file ("fedora-version: 1:1.2.3") Regenerate the RPM files using the
> "bpkg bindist -wipe-output -keep-output <project>" command. I expected
> this to result in the "Epoch:" line being added to the generated spec
> file, but no such luck.

This comment from the source code I believe explains why this is:

    // <epoch>
    //
    //   On one hand, if we keep the epoch, it won't necessarily match
    //   Fedora's native package epoch. But on the other it will allow our
    //   binary packages from different epochs to co-exist. Seeing that this
    //   can be easily overridden with a custom distribution version, let's
    //   keep it.
    //
    //   Note that while the Fedora start/default epoch is 0, ours is 1 (we
    //   use the 0 epoch for stub packages). So we will need to shift this
    //   value range.

So try `fedora-version: 2:1.2.3`.

> Also, can the "fedora-version" attribute in the package manifest file
> use the bpkg "version"? Since all I want to do is set the epoch of the
> RPM, is it possible to specify the "fedora-version" attribute in a DRY
> fashion so that it uses the bpkg "version" ? Something like:
> "fedora-version: 1:$version"   or "fedora-version: 1:"

No, not quite. The details are here:

https://build2.org/bpkg/doc/build2-package-manager-manual.xhtml#manifest-package-distribution

We could probably support something like 1:$ with a bit of effort so
feel free to file an issue for that.



More information about the users mailing list