]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Clarify that --build-in-place sets _builddir to the CWD 2294/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 16 Jan 2024 20:28:41 +0000 (21:28 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 16 Jan 2024 20:28:41 +0000 (21:28 +0100)
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

index c8f69386bbf93c87214e9367acb5473bc70cf3f4..96391aacc6747eb53367871f59a0afe0168f96d9 100644 (file)
@@ -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