Skip to contentSkip to conversation

package_rpm: Add builddir macro to define source directory

PATCH In review Richard Purdie 2 participants 2 messages Aug 29, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package_rpm: Add builddir macro to define source directory

This allows its usage in other RPM macros so files in ${S} can be found.

meta/classes/package_rpm.bbclass +1 -0
index 0f565ac..51910ec 100644
@@ -689,6 +689,7 @@ python do_package_rpm () {
     cmd = rpmbuild
     cmd = cmd + " --nodeps --short-circuit --target " + pkgarch + " --buildroot " + pkgd
     cmd = cmd + " --define '_topdir " + workdir + "' --define '_rpmdir " + pkgwritedir + "'"
+    cmd = cmd + " --define '_builddir " + d.getVar('S', True) + "'"
     cmd = cmd + " --define '_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm'"
     cmd = cmd + " --define '_use_internal_dependency_generator 0'"
     if perfiledeps:
#1 lore raw
Quoted 1 line · Richard Purdie

This allows its usage in other RPM macros so files in ${S} can be found.

Minor note, (traditional) RPM doesn't differentiate between the 'B' and the 'S'.
So build dir has historically be a combination of the two.

In this case, 'S' is likely better, because any additional post-processing is going to want to reference the generated objects and not the original source. (If the post processing needs the source, then globally S and B will need to be merged back together in a distribution specific configuration.)

So long story short, no objections.. just wanted to cover why S vs B makes sense here.

--Mark

Quoted 16 lines
meta/classes/package_rpm.bbclass +1 -0
index 0f565ac..51910ec 100644
@@ -689,6 +689,7 @@ python do_package_rpm () {
      cmd = rpmbuild
      cmd = cmd + " --nodeps --short-circuit --target " + pkgarch + " --buildroot " + pkgd
      cmd = cmd + " --define '_topdir " + workdir + "' --define '_rpmdir " + pkgwritedir + "'"
+    cmd = cmd + " --define '_builddir " + d.getVar('S', True) + "'"
      cmd = cmd + " --define '_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm'"
      cmd = cmd + " --define '_use_internal_dependency_generator 0'"
      if perfiledeps: