How do I setup a build environment to duplicate a CentOS RPM build?

General support questions
Post Reply
mike73923
Posts: 1
Joined: 2019/05/20 15:15:54

How do I setup a build environment to duplicate a CentOS RPM build?

Post by mike73923 » 2019/05/20 15:31:48

If this is an easy question please point me in the right direction. I haven't been able to find detailed documentation on how the official CentOS RPMs are built.

I'm trying to setup a clean reproducible build environment for CentOS 7. To verify my environment is correct, I rebuilt the grep RPM from source. I was hoping the output binary included in the RPM would be an exact match, however they are different. Can someone tell me what I need to do to create the correct CentOS environment that can reproduce binaries as delivered with the DVD?

I started with a fresh minimal install of latest CentOS7 from DVD. I added the grep source RPM that matched the version on the DVD and built with rpmbuild. Then I only installed additional RPMs, from the DVD, that are required for rpmbuild to complete. The resulting grep binary is different from the one included on the DVD (built by CentOS).

Built binary does not match the binary delivered with CentOS.

User avatar
TrevorH
Forum Moderator
Posts: 26331
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: How do I setup a build environment to duplicate a CentOS RPM build?

Post by TrevorH » 2019/05/20 16:55:20

Use mock not rpmbuild. And no rpm will ever be identical to the point where it will checksum the same: it contains time sensitive metadata embedded in it - e.g Build Date etc.
CentOS 5 died in March 2017 - migrate NOW!
CentOS 6 goes EOL sooner rather than later, get upgrading!
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply