overriding rpmrc options inside mock

Michael E Brown Michael_E_Brown at dell.com
Thu Mar 27 16:44:02 UTC 2008


On Thu, Mar 27, 2008 at 12:03:19PM -0400, Todd Zullinger wrote:
> Hans de Goede wrote:
> > I've contacted Matt Domsch to ask him to add
> > -Werror-implicit-function-declaration to the default optflags with
> > his next mass rebuild to get an idea of the amount of packages that
> > this will cause to fail (most likely a huge amount, but we will
> > see).
> >
> > Matt is so kind as to give this a try, but, to quote him: "Where do
> > I add that option to make sure it's in effect for the mock builds?"
> >
> > I have no clue, so how do we this?
> 
> This needs to be added to the .rpmrc file in the mock root (from what
> I've gathered in other threads).  You should be able to use this sort
> of thing in your mock config:
> 
> config_opts['files']['path/name/no/leading/slash'] = "file contents"
> 
> I think you'll want something about like this (untested ;)):
> 
> config_opts['files']['builddir/.rpmrc'] = """
> optflags: i386 -O2 -g -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -Werror-implicit-function-declaration
> optflags: i486 -O2 -g -m32 -march=i486 -fasynchronous-unwind-tables -Werror-implicit-function-declaration
> optflags: i586 -O2 -g -m32 -march=i586 -fasynchronous-unwind-tables -Werror-implicit-function-declaration
> optflags: i686 -O2 -g -m32 -march=i686 -mtune=generic -fasynchronous-unwind-tables -Werror-implicit-function-declaration
> optflags: pentium3 -O2 -g -m32 -march=pentium3 -mtune=generic -fasynchronous-unwind-tables -Werror-implicit-function-declaration
> optflags: pentium4 -O2 -g -m32 -march=pentium4 -mtune=generic -fasynchronous-unwind-tables -Werror-implicit-function-declaration
> optflags: athlon -O2 -g -m32 -march=athlon -fasynchronous-unwind-tables -Werror-implicit-function-declaration
> optflags: ia64 -O2 -g -m64 -mtune=generic -Werror-implicit-function-declaration
> optflags: x86_64 -O2 -g -m64 -mtune=generic -Werror-implicit-function-declaration
> optflags: amd64 -O2 -g -mtune=generic -Werror-implicit-function-declaration
> optflags: ia32e -O2 -g -m64 -mtune=generic -Werror-implicit-function-declaration
> ...
> """

As seth mentioned, the 'macros' config option was created for this, and
would most likely be more appropriate, although using 'files' is
creative. :)

config_opts['macros']['Add_your_macro_name_here'] = "add macro value 
here"

--
Michael




More information about the fedora-devel-list mailing list