Skip to contentSkip to conversation

package_rpm: Add custom extension support for spec generation.

PATCH New Richard Purdie 1 participant 1 message Sep 1, 2014

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 package_rpm: Add custom extension support for spec generation.

Add hooks to allow customisation of the rpm spec files. Since python functions aren't visible in the data store, one variable is used to trigger the call to a separately named function. A dummy function is not provided since this then triggers various class ordering complexities which are best avoided.

Ultimately this will be replaced by a refactor of the code to generate the spec file using a python class.

This allows the tizen layer to add hooks for the security manifests for example.

meta/classes/package_rpm.bbclass +5 -0
index eecfcb2..ac69b68 100644
@@ -306,6 +306,7 @@ python write_specfile () {
     spec_files_bottom = []
 
     perfiledeps = (d.getVar("MERGEPERFILEDEPS", True) or "0") == "0"
+    extra_pkgdata = (d.getVar("RPM_EXTRA_PKGDATA", True) or "0") == "0"
 
     for pkg in packages.split():
         localdata = bb.data.createCopy(d)
@@ -389,6 +390,8 @@ python write_specfile () {
             else:
                 bb.note("Creating RPM package for %s" % splitname)
                 spec_files_top.append('%files')
+                if extra_pkgdata:
+                    package_rpm_extra_pkgdata(splitname, spec_files_top, localdata)
                 spec_files_top.append('%defattr(-,-,-,-)')
                 if file_list:
                     bb.note("Creating RPM package for %s" % splitname)
@@ -495,6 +498,8 @@ python write_specfile () {
             bb.note("Not creating empty RPM package for %s" % splitname)
         else:
             spec_files_bottom.append('%%files -n %s' % splitname)
+            if extra_pkgdata:
+                package_rpm_extra_pkgdata(splitname, spec_files_bottom, localdata)
             spec_files_bottom.append('%defattr(-,-,-,-)')
             if file_list:
                 bb.note("Creating RPM package for %s" % splitname)