summaryrefslogtreecommitdiff
path: root/meta/classes
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2008-09-03 20:59:09 +0000
committerRichard Purdie <richard@openedhand.com>2008-09-03 20:59:09 +0000
commit36d81980318386c8181b0a59dee39318e40e1f8d (patch)
treea438c9e68df2ecce3f6273b64f934dbebf97da55 /meta/classes
parentaae958d719c9c54c7f4d22ef94954be54cb30c6e (diff)
downloadopenembedded-core-36d81980318386c8181b0a59dee39318e40e1f8d.tar.gz
openembedded-core-36d81980318386c8181b0a59dee39318e40e1f8d.tar.bz2
openembedded-core-36d81980318386c8181b0a59dee39318e40e1f8d.tar.xz
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/classes')
-rw-r--r--meta/classes/package_rpm.bbclass11
1 files changed, 8 insertions, 3 deletions
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 22604d256..aa22dd766 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: