packaged-staging.bbclass: Add rpm package coverage (from Poky)
authorRichard Purdie <richard@openedhand.com>
Thu, 2 Oct 2008 15:22:10 +0000 (15:22 +0000)
committerMarcin Juszkiewicz <hrw@openembedded.org>
Thu, 19 Mar 2009 19:22:36 +0000 (20:22 +0100)
git-svn-id: https://svn.o-hand.com/repos/poky@5382 311d38ba-8fff-0310-9ca6-ca027cbcb966

classes/packaged-staging.bbclass

index d6272b8..849f60c 100644 (file)
@@ -361,6 +361,8 @@ python do_package_stage () {
             ipkpath = bb.data.getVar('DEPLOY_DIR_IPK', d, True).replace(tmpdir, stagepath)
         if bb.data.inherits_class('package_deb', d):
             debpath = bb.data.getVar('DEPLOY_DIR_DEB', d, True).replace(tmpdir, stagepath)
+        if bb.data.inherits_class('package_rpm', d):
+            rpmpath = bb.data.getVar('DEPLOY_DIR_RPM', d, True).replace(tmpdir, stagepath)
 
         for pkg in packages:
             pkgname = bb.data.getVar('PKG_%s' % pkg, d, 1)
@@ -393,6 +395,18 @@ python do_package_stage () {
                     bb.mkdirhier(destpath)
                     bb.copyfile(srcfile, destpath + srcname)
 
+            if bb.data.inherits_class('package_rpm', d):
+               version = bb.data.getVar('PV', d, 1)
+               version = version.replace('-', '+')
+               bb.data.setVar('RPMPV', version, d)
+                srcname = bb.data.expand(pkgname + "-${RPMPV}-" + pr + ".${TARGET_ARCH}.rpm", d)
+                srcfile = bb.data.expand("${DEPLOY_DIR_RPM}/" + arch + "/" + srcname, d)
+                if os.path.exists(srcfile):
+                    destpath = rpmpath + "/" + arch + "/" 
+                    bb.mkdirhier(destpath)
+                    bb.copyfile(srcfile, destpath + srcname)
+
+
     #
     # Handle stamps/ files
     #