diff options
author | Richard Purdie <richard@openedhand.com> | 2008-09-03 20:59:09 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2008-09-03 20:59:09 +0000 |
commit | 36d81980318386c8181b0a59dee39318e40e1f8d (patch) | |
tree | a438c9e68df2ecce3f6273b64f934dbebf97da55 /meta | |
parent | aae958d719c9c54c7f4d22ef94954be54cb30c6e (diff) | |
download | openembedded-core-36d81980318386c8181b0a59dee39318e40e1f8d.tar.gz openembedded-core-36d81980318386c8181b0a59dee39318e40e1f8d.tar.bz2 openembedded-core-36d81980318386c8181b0a59dee39318e40e1f8d.zip |
package_rpm.bbclass: Add support for postinst and preinst scripts
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5131 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/package_rpm.bbclass | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass index 22604d2569..aa22dd7668 100644 --- a/meta/classes/package_rpm.bbclass +++ b/meta/classes/package_rpm.bbclass @@ -27,6 +27,8 @@ python write_specfile() { "ROOT": "BuildRoot", "LICENSE": "License", "SECTION": "Group", + "pkg_postinst": "%post", + "pkg_preinst": "%pre", } root = bb.data.getVar('ROOT', d) @@ -71,7 +73,8 @@ python write_specfile() { if out_vartranslate[var][0] == "%": continue val = bb.data.getVar(var, d, 1) - fd.write("%s\t: %s\n" % (out_vartranslate[var], val)) + if val: + fd.write("%s\t: %s\n" % (out_vartranslate[var], val)) fd.write("AutoReqProv: no\n") @@ -99,8 +102,10 @@ python write_specfile() { for var in out_vartranslate.keys(): if out_vartranslate[var][0] != "%": continue - fd.write(out_vartranslate[var] + "\n") - fd.write(bb.data.getVar(var, d) + "\n\n") + val = bb.data.getVar(var, d) + if val: + fd.write(out_vartranslate[var] + "\n") + fd.write(val + "\n\n") fd.write("%files\n") for file in files: |