How to override CONFIG_SITE in a spec file (best practice)
If a user attempting to build an rpm from a specfile has CONFIG_SITE set in the environment when running rpmbuild, and the specfile builds with "./configure --prefix=/usr && make", then the user's settings in the CONFIG_SITE can completely mangle the build. (As a concrete example, suppose /usr/share/config.site has the line "prefix=/bar". Then the spec file's file manifest will be completely wrong and the rpmbuild will fail.)
What is the best practice for dealing with this issue? It seems like common practice is to ignore it. I've decided to set CONFIG_SITE=true in the specfile:
CONFIG_SITE=true ./configure --prefix=/usr ...
Is it more common to assume a pristine environment when invoking rpmbuild, and that there is no silliness like resetting prefix in /usr/share/config.site? Or is the maintainer responsible for ensuring that the spec file will 开发者_运维知识库build the rpm as expected?
I think if users set up a stupid config.site
file, it's their own fault. There are certainly countless other ways besides this one to cripple a system; I wouldn't worry about it. I have never seen an rpm or deb build script that worries about this. So that's perhaps your "best practice".
What you can see occasionally is that a package brings along its own config.site
file, but that is then usually supplied by the packager to override what a perhaps broken configure check in the original package would produce.
精彩评论