summaryrefslogtreecommitdiffstats
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
parentaae958d719c9c54c7f4d22ef94954be54cb30c6e (diff)
downloadpoky-36d81980318386c8181b0a59dee39318e40e1f8d.tar.gz
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
-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 22604d2569..aa22dd7668 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -27,6 +27,8 @@ python write_specfile() {
27 "ROOT": "BuildRoot", 27 "ROOT": "BuildRoot",
28 "LICENSE": "License", 28 "LICENSE": "License",
29 "SECTION": "Group", 29 "SECTION": "Group",
30 "pkg_postinst": "%post",
31 "pkg_preinst": "%pre",
30 } 32 }
31 33
32 root = bb.data.getVar('ROOT', d) 34 root = bb.data.getVar('ROOT', d)
@@ -71,7 +73,8 @@ python write_specfile() {
71 if out_vartranslate[var][0] == "%": 73 if out_vartranslate[var][0] == "%":
72 continue 74 continue
73 val = bb.data.getVar(var, d, 1) 75 val = bb.data.getVar(var, d, 1)
74 fd.write("%s\t: %s\n" % (out_vartranslate[var], val)) 76 if val:
77 fd.write("%s\t: %s\n" % (out_vartranslate[var], val))
75 78
76 fd.write("AutoReqProv: no\n") 79 fd.write("AutoReqProv: no\n")
77 80
@@ -99,8 +102,10 @@ python write_specfile() {
99 for var in out_vartranslate.keys(): 102 for var in out_vartranslate.keys():
100 if out_vartranslate[var][0] != "%": 103 if out_vartranslate[var][0] != "%":
101 continue 104 continue
102 fd.write(out_vartranslate[var] + "\n") 105 val = bb.data.getVar(var, d)
103 fd.write(bb.data.getVar(var, d) + "\n\n") 106 if val:
107 fd.write(out_vartranslate[var] + "\n")
108 fd.write(val + "\n\n")
104 109
105 fd.write("%files\n") 110 fd.write("%files\n")
106 for file in files: 111 for file in files: