1

All the information I can find about building RPMs seems to pre-date CentOS 6, and as a complete package-building novice running CentOS 6.5, I'm rather stuck.

All the tutorials I've read mention one BUILD directory and state that during the %install the files are copied from from their native location (/usr/bin/whatever) and packaged up.

However, in the CentOS 6.5 image I'm building on, a new BUILDROOT directory appears which I think is designed to avoid you having to install the binaries at their native locations, and hence also avoid the use of sudo with make install.

However, it seems this isn't optional. When trying to package various sources written by other people rpmbuild completes the make install successfully, but then dies when it doesn't find the binaries under the BUILDROOT, because they weren't installed there.

After some digging, it seems that some Makefiles can take a DESTDIR argument, but only if the author supported it, and if they haven't I'm stuck. I've also read it's a bad idea to use --prefix

So, my question is:

How can I build and install any third-party sources into the BUILDROOT location? Is there something rpmbuild can do for me that doesn't requiring patching someone else's code I don't understand?

2
  • You use whatever method was provided by the developer. If they didn't provide any method, you yell very loudly at them. The thing you do not do is to install to your system as you will contaminate the build server, and quite likely the package. Apr 21, 2014 at 15:05
  • Understood. I've altered my question slightly
    – Tim
    Apr 21, 2014 at 15:13

1 Answer 1

1

How can I build and install any third-party sources into the BUILDROOT location? Is there something rpmbuild can do for me [...]?

Not really. rpmbuild is a essentially a wrapper, and does rely on instructions provided by the Makefile, etc. The onus is on the developer(s) of the source, not on rpmbuild.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .