]> code.ossystems Code Review - openembedded-core.git/commitdiff
package_rpm.bbclass: Add RPMSPEC_PREAMBLE
authorMark Hatle <mark.hatle@windriver.com>
Fri, 23 Dec 2011 01:01:36 +0000 (19:01 -0600)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 23 Dec 2011 17:32:17 +0000 (17:32 +0000)
Add a way to add arbitrary text to the top of a spec file.  This
can be useful for adding specific tags to the produced binaries for
tracking purposes.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/package_rpm.bbclass

index 469526be7a0c65a6ecee7e3b73bc3cfc61375a21..d03dc3f88363f4a1d5d701bfecea5493d0cd4f5a 100644 (file)
@@ -817,6 +817,12 @@ python write_specfile () {
        except OSError:
                raise bb.build.FuncFailed("unable to open spec file for writing.")
 
+       # RPMSPEC_PREAMBLE is a way to add arbitrary text to the top
+       # of the generated spec file
+       external_preamble = d.getVar("RPMSPEC_PREAMBLE", True)
+       if external_preamble:
+               specfile.write(external_preamble + "\n")
+
        for line in spec_preamble_top:
                specfile.write(line + "\n")