summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorAlexander Kanavin <alexander.kanavin@linux.intel.com>2017-02-02 15:20:41 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-14 14:42:17 +0000
commitd94b98fe3092ab69f031d014adeed1badd85c472 (patch)
treee113e9e32301fe7cb69d8cbb588d8533c3b4d0d4 /meta/classes
parentea4bac7e45188cd35f2c88cd0021fc8cfb8b3642 (diff)
downloadpoky-d94b98fe3092ab69f031d014adeed1badd85c472.tar.gz
package_rpm.bbclass: instruct rpm to not remove the buildroot directory
This is the ${W}/package directory which may be reused in subsequent builds. Also clean up various default directories rpm 4 creates. (From OE-Core rev: bdebe0d50a210438730ee7797968eafe169ded23) Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/package_rpm.bbclass7
1 files changed, 5 insertions, 2 deletions
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 9b634e583b..ff86dc8798 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -697,7 +697,7 @@ python do_package_rpm () {
697 os.chmod(pkgwritedir, 0o755) 697 os.chmod(pkgwritedir, 0o755)
698 698
699 cmd = rpmbuild 699 cmd = rpmbuild
700 cmd = cmd + " --nodeps --short-circuit --target " + pkgarch + " --buildroot " + pkgd 700 cmd = cmd + " --noclean --nodeps --short-circuit --target " + pkgarch + " --buildroot " + pkgd
701 cmd = cmd + " --define '_topdir " + workdir + "' --define '_rpmdir " + pkgwritedir + "'" 701 cmd = cmd + " --define '_topdir " + workdir + "' --define '_rpmdir " + pkgwritedir + "'"
702 cmd = cmd + " --define '_builddir " + d.getVar('S') + "'" 702 cmd = cmd + " --define '_builddir " + d.getVar('S') + "'"
703 cmd = cmd + " --define '_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm'" 703 cmd = cmd + " --define '_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm'"
@@ -721,8 +721,11 @@ python do_package_rpm () {
721 bb.build.exec_func('SBUILDSPEC', d) 721 bb.build.exec_func('SBUILDSPEC', d)
722 cmd = cmd + " -bb " + outspecfile 722 cmd = cmd + " -bb " + outspecfile
723 723
724 # rpm 4 creates various empty directories in _topdir, let's clean them up
725 cleanupcmd = "rm -rf %s/BUILDROOT %s/SOURCES %s/SPECS %s/SRPMS" % (workdir, workdir, workdir, workdir)
726
724 # Build the rpm package! 727 # Build the rpm package!
725 d.setVar('BUILDSPEC', cmd + "\n") 728 d.setVar('BUILDSPEC', cmd + "\n" + cleanupcmd + "\n")
726 d.setVarFlag('BUILDSPEC', 'func', '1') 729 d.setVarFlag('BUILDSPEC', 'func', '1')
727 bb.build.exec_func('BUILDSPEC', d) 730 bb.build.exec_func('BUILDSPEC', d)
728 731