--- /dev/null
+--- rpm-4.15.1/rpmbuild.c~ 2019-06-26 16:17:31.000000000 +0200
++++ rpm-4.15.1/rpmbuild.c 2020-01-13 23:29:36.442259031 +0100
+@@ -435,13 +435,6 @@
+ if (ba->buildRootOverride)
+ buildRootURL = rpmGenPath(NULL, ba->buildRootOverride, NULL);
+
+- /* Create build tree if necessary */
+- const char * buildtree = "%{_topdir}:%{_specdir}:%{_sourcedir}:%{_builddir}:%{_rpmdir}:%{_srcrpmdir}:%{_buildrootdir}";
+- const char * rootdir = rpmtsRootDir(ts);
+- if (rpmMkdirs(!rstreq(rootdir, "/") ? rootdir : NULL , buildtree)) {
+- goto exit;
+- }
+-
+ if (buildMode == 't') {
+ char *srcdir = NULL, *dir;
+
+@@ -508,6 +501,13 @@
+ goto exit;
+ }
+
++ /* Create build tree if necessary */
++ const char * buildtree = "%{_topdir}:%{_specdir}:%{_sourcedir}:%{_builddir}:%{_rpmdir}:%{_srcrpmdir}:%{_buildrootdir}";
++ const char * rootdir = rpmtsRootDir(ts);
++ if (rpmMkdirs(!rstreq(rootdir, "/") ? rootdir : NULL , buildtree)) {
++ goto exit;
++ }
++
+ if ((rc = rpmSpecBuild(ts, spec, ba))) {
+ goto exit;
+ }
Patch16: %{name}-add-compress-doc.patch
Patch17: rpm5-db-compat.patch
Patch18: python-internal-build.patch
+Patch19: create-build-tree-after-parse.patch
URL: https://rpm.org/
BuildRequires: %{reqdb_pkg}-devel >= %{reqdb_pkgver}
BuildRequires: %{reqdb_pkg}-sql-devel >= %{reqdb_pkgver}
%patch16 -p1
%patch17 -p1
%patch18 -p1
+%patch19 -p1
install %{SOURCE16} scripts/perl.prov.in