2

Similarly to this question ("How can I automatically rebuild a package with a different compiler?" on askubuntu.com), I would like to know how can I automate fetching source and compilation of a C program using Fedora build scripts using a specific, non-default compiler - in my case afl-gcc. I would definitely welcome an example of the pv program, but I would like the solution to work for other packages, like libreoffice as well, with minimal modifications. I would like to achieve something similar to aflize (which is for Debian only right now). I have heard of mock and it would be best if I could use it for that.

Community
  • 1
  • 1
d33tah
  • 10,999
  • 13
  • 68
  • 158

1 Answers1

3

I do not know to do it automatically, but manually:

  • Prepare build environnement

    $ rpmdev-setuptree

  • Download corresonding srpms

    $ yumdownloader --source foo

  • Extract files from SRPMS

    $ rpm -i foo*.src.rpm

  • Replace the compiler used

    $ sed -i 's/make all/make CC=afl-gcc all/g' ~/rpmbuild/SPECS/foo.spec

setting CC var your corresponding compiler will do the jobs.

If you use cmake take a look to CMAKE_C_COMPILER

  • Rebuild

    $ cd ~/rpmbuild/SPECS/

    $ rpmbuild -ba foo.spec

Generated rpm files are located into ~/rpmbuild/RPMS

bioinfornatics
  • 1,749
  • 3
  • 17
  • 36