To build a piece of software I normally do

rpmbuild -ta slurm*.tar.bz2

However I now need to configure the software with the option


Is this possible using rpmbuild or do I need to go through the standard configure/make/make install proceedure?


What you can do is to create SPEC file and make rpmbuild to use it. In this file you can incorporate different parameters in build process. You can check here for example usage of SPEC file

  1. In a shell prompt, go into the buildroot and create a new spec file for your package.
  2. Open the spec file in a text editor. The spec file should be similar to the following example:
make %{?_smp_mflags} 


  1. Edit the BuildRequires tag with requirements that are needed to build the package. BuildRequires can contain either a list of required packages or files. For example, the eject package requires the gettext and libtool packages. ....
  • Coming back a bit late to this, but how does the SPEC file that I create interact with the SPEC file which is already included in the source RPM? Do I copy the original file, modify it and pass it as an argument to rpmbuild, or can I somehow just overwrite theconfigure step? – loris Feb 7 at 14:21
  • 1
    You can create totally new SPEC file and point it to the rpmbuild command. Or you can edit the original SPEC file. – Romeo Ninov Feb 7 at 14:25
  • This is something I will probably have to do on a regular basis, so I do want to just modify the SPEC file included in the SRPM. Is there any good way to extract and then reinsert the SPEC file? – loris Feb 10 at 13:38
  • 1
    You can install srpm file and then you will have SPEC file in the filesystem :) – Romeo Ninov Feb 10 at 13:40
  • 1
    @loris, installing SRPM give you much more options to manipulate not only SPEC but also tar.gz archive. And you have in ``/usr/src` the source :) – Romeo Ninov Feb 10 at 13:58

I found out what I really want to do, namely

rpmbuild --define "_with_pmix --with-pmix=/path/to/pmxi" -ta slurm-19.05.5.tar.bz2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.