From 52342d4f56c3429d374f1c5612877fef46fb349e Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Wed, 1 Nov 2023 14:39:20 +0200 Subject: [PATCH] fixup! Autobuild WIP documentation --- build/parseSpec.c | 2 +- docs/manual/autobuild.md | 16 ++++++++++++++++ macros.in | 8 ++++---- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/build/parseSpec.c b/build/parseSpec.c index ea8d30028a..a9d100768a 100644 --- a/build/parseSpec.c +++ b/build/parseSpec.c @@ -900,7 +900,7 @@ static rpmRC parseAutosect(rpmSpec spec, if (sb == NULL) { char *mn = rstrscat(NULL, "autobuild_", prefix, "_", section, NULL); - if (rpmMacroIsParametric(NULL, mn)) { + if (rpmMacroIsDefined(NULL, mn)) { char *path = NULL; FD_t fd = rpmMkTempFile(NULL, &path); if (fd) { diff --git a/docs/manual/autobuild.md b/docs/manual/autobuild.md index 72ab2a5eb9..31376bbcf4 100644 --- a/docs/manual/autobuild.md +++ b/docs/manual/autobuild.md @@ -37,6 +37,14 @@ this is why `%conf` is a separate section from the rest of the build, eg: %configure --enable-experimental ``` +However as the autobuild macros could rely on state from a previous step, +it's better to use the corresponding macro alias instead (XXX not yet +implemented in this draft): +``` +%conf +%autobuild_conf --enable-experimental +``` + 3) Complex packages can have things like multiple build systems, in which case you might want to invoke the macros manually, eg. @@ -64,3 +72,11 @@ Scriptlet | Autobuild macro Replace "name" with the buildsystem name, eg `%autobuild_cmake_build`. When Autobuild: tag is set, these automatically populate the corresponding spec section, unless the spec manually overrides it. + +For example, supporting the classic autotools case could be built on top +of existing helper macros: +``` +%autobuild_autotools_conf %configure +%autobuild_autotools_build %make_build +%autobuild_autotools_install %make_install +``` diff --git a/macros.in b/macros.in index 9f87f0c49e..8b54826d0c 100644 --- a/macros.in +++ b/macros.in @@ -1350,12 +1350,12 @@ end } # autobuild defaults -%autobuild_default_prep() %autosetup -p1 +%autobuild_default_prep %autosetup -p1 # example autobuild macros for autotools -%autobuild_autotools_conf() %configure -%autobuild_autotools_build() %make_build -%autobuild_autotools_install()\ +%autobuild_autotools_conf %configure +%autobuild_autotools_build %make_build +%autobuild_autotools_install\ %make_install\ test -d po && %find_lang %{name} ||: