I need to change the "Build Host" name to other that actual host-name , fqdn(picked from /etc/hosts)
During the rpm generation,We set rpm properties via .spec file, but I understand "Build Host" values can't be set via .spec file.
Is there a way to change the "Build Host" value in rpm without actually changing the hostname of linux machine.
i.e. No change in /etc/sysconfig/network or
https://www.onyxpoint.com/spoofing-the-build-hostname-in-mock/
By using Buildroot: in your spec file you are indicating that your package can be built (installed into and packaged from) a user-definable directory. This helps package building by normal users. RPM will use the buildroot listed in the spec file as the default buildroot.
The BUILD directory is where the software is unpacked and built. The RPMS directory is where the newly created binary package files are written. The SOURCES directory contains the original sources, patches, and icon files. The SPECS directory contains the spec files for each package to be built.
rpmbuild is used to build both binary and source software packages. A package consists of an archive of files and meta- data used to install and erase the archive files. The meta-data includes helper scripts, file attributes, and descriptive information about the package.
Before typing rpmbuild -ba something.spec
I've changed the first line in /etc/hosts
:
From :127.0.0.1 localhost my.local.domain.com
To :127.0.0.1 'what-I-want-to-appear-on-build-host' localhost my.local.domain.com
It worked just fine for me and I didn't change anything on the .spec
file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With