From 14506b7012fc446d7e744289c68b3a1022ddbf26 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Tue, 16 Jan 2024 21:28:41 +0100 Subject: [PATCH] Clarify that --build-in-place sets _builddir to the CWD This isn't exactly obvious, so let's mention that --build-in-place configures _builddir to the current working directory which explains why we need to change directory to the upstream sources before invoking rpmbuild. --- docs/building-rpms-from-source.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/building-rpms-from-source.md b/docs/building-rpms-from-source.md index c8f69386b..96391aacc 100644 --- a/docs/building-rpms-from-source.md +++ b/docs/building-rpms-from-source.md @@ -119,10 +119,13 @@ dependencies installed to be able to build the RPM. Next is the build script. We suffix the build script with `.chroot` so that mkosi runs it entirely inside the image. In the build script, we invoke `rpmbuild -bb --build-in-place` to have `rpmbuild` build the RPM -in place from the upstream sources. Again, `_sourcedir` has to point to -the RPM spec sources. We also have to override `_rpmdir` to point to the -mkosi output directory (stored in `$OUTPUTDIR`). The build script -`mkosi.build.chroot` then looks as follows: +in place from the upstream sources. Because `--build-in-place` +configures `_builddir` to the current working directory, we change +directory to the upstream sources before invoking `rpmbuild`. Again, +`_sourcedir` has to point to the RPM spec sources. We also have to +override `_rpmdir` to point to the mkosi output directory (stored in +`$OUTPUTDIR`). The build script `mkosi.build.chroot` then looks as +follows: ```shell #!/bin/sh -- 2.47.2