package_rpm: Add %manifest support for spec generation.
PATCH 1/1 package_rpm: Add %manifest support for spec generation.
From: Ronan Le Martret <[email protected]>
The manifest file allow custom smack security for a package.
https://wiki.tizen.org/wiki/Security/Application_installation_and_Manifest
meta/classes/package_rpm.bbclass +4 -0
@@ -389,6 +389,8 @@ python write_specfile () { else: bb.note("Creating RPM package for %s" % splitname) spec_files_top.append('%files') + if localdata.getVar('MANIFESTFILES', True): + spec_files_top.append('%%manifest %s' % localdata.getVar('MANIFESTFILES', True)) spec_files_top.append('%defattr(-,-,-,-)') if file_list: bb.note("Creating RPM package for %s" % splitname)
@@ -495,6 +497,8 @@ python write_specfile () { bb.note("Not creating empty RPM package for %s" % splitname) else: spec_files_bottom.append('%%files -n %s' % splitname) + if localdata.getVar('MANIFESTFILES', True): + spec_files_bottom.append('%%manifest %s' % localdata.getVar('MANIFESTFILES', True)) spec_files_bottom.append('%defattr(-,-,-,-)') if file_list: bb.note("Creating RPM package for %s" % splitname)
Quoted 4 lines · Richard Purdie
From: Ronan Le Martret <[email protected]>
The manifest file allow custom smack security for a package.
https://wiki.tizen.org/wiki/Security/Application_installation_and_Manifest
I'm concerned with this simply because we're adding a very specific (non-oe) mechanism into the mix.
I'd prefer if there was simple a "perform this generic action, which can add to the .spec file"
The during the packaging (before writing the .spec) we can call the action and it can insert the %manifest if appropriate.
That can then be distribution defined and work with any arbitrary mechanisms.
--Mark
Quoted 27 lines
Signed-off-by Ronan Le Martret <[email protected]>Signed-off-by Richard Purdie <[email protected]>meta/classes/package_rpm.bbclass +4
-0@@ -389,6 +389,8 @@ python write_specfile () { else: bb.note("Creating RPM package for %s" % splitname) spec_files_top.append('%files') + if localdata.getVar('MANIFESTFILES', True): + spec_files_top.append('%%manifest %s' % localdata.getVar('MANIFESTFILES', True)) spec_files_top.append('%defattr(-,-,-,-)') if file_list: bb.note("Creating RPM package for %s" % splitname)@@ -495,6 +497,8 @@ python write_specfile () { bb.note("Not creating empty RPM package for %s" % splitname) else: spec_files_bottom.append('%%files -n %s' % splitname) + if localdata.getVar('MANIFESTFILES', True): + spec_files_bottom.append('%%manifest %s' % localdata.getVar('MANIFESTFILES', True)) spec_files_bottom.append('%defattr(-,-,-,-)') if file_list: bb.note("Creating RPM package for %s" % splitname)
Quoted 9 lines · Mark Hatle
Quoted 4 lines · Richard Purdie
From: Ronan Le Martret <[email protected]>
The manifest file allow custom smack security for a package.
https://wiki.tizen.org/wiki/Security/Application_installation_and_ManifestI'm concerned with this simply because we're adding a very specific (non-oe) mechanism into the mix.
Quoted 7 lines
I'd prefer if there was simple a "perform this generic action, which can add to the .spec file"
The during the packaging (before writing the .spec) we can call the action and it can insert the %manifest if appropriate.
That can then be distribution defined and work with any arbitrary mechanisms.
The rough plan forming in my (and other people's) minds is that we need a proper python "spec" construction class.
If we had such a thing, customisations like this would be much easier, we could also likely more easily reconcile some of the archiver srpm pieces too.
Right now we don't have that, there are people needing to fork the whole of package_rpm to add the few tweaks I've posted. I'm therefore minded to make things easier. If/as or more like when we implement the class, this kind of issue should go away.
Cheers,
Richard
Quoted 21 lines · Richard Purdie
Quoted 9 lines · Mark Hatle
Quoted 4 lines · Richard Purdie
From: Ronan Le Martret <[email protected]>
The manifest file allow custom smack security for a package.
https://wiki.tizen.org/wiki/Security/Application_installation_and_ManifestI'm concerned with this simply because we're adding a very specific (non-oe) mechanism into the mix.
Quoted 7 lines
I'd prefer if there was simple a "perform this generic action, which can add to the .spec file"
The during the packaging (before writing the .spec) we can call the action and it can insert the %manifest if appropriate.
That can then be distribution defined and work with any arbitrary mechanisms.
The rough plan forming in my (and other people's) minds is that we need a proper python "spec" construction class.
Quoted 8 lines
If we had such a thing, customisations like this would be much easier, we could also likely more easily reconcile some of the archiver srpm pieces too.
Right now we don't have that, there are people needing to fork the whole of
package_rpmto add the few tweaks I've posted. I'm therefore minded to make things easier. If/as or more like when we implement the class, this kind of issue should go away.
I was thinking of a simple interface where you'd just call an external function (python) based on a variable set by the distro.
It would be passed the various pieces of the spec file, preamble, individual sections and the files.. that way the necessary pieces can be manipulated -- the call would be made -after- all of the regular processing occurs.
As for a custom class, we can certainly do that.. perhaps it's something to plan for 1.8? We already have much of the processing setup and broken into the constituent pieces.. we just don't have a way to extend it before being written.
--Mark
Quoted 6 lines
Cheers,
Richard