Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to change "Build Host" in rpm

Tags:

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/

like image 241
sandejai Avatar asked Jul 27 '16 05:07

sandejai


People also ask

What is Buildroot in RPM spec file?

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.

What are sources in RPM build directory?

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.

What is Linux RPM build?

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.


1 Answers

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.

like image 167
Paul afk Avatar answered Sep 28 '22 02:09

Paul afk