Skip to content

Commit

Permalink
fixup! Autobuild WIP documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
pmatilai committed Nov 1, 2023
1 parent 15d6f9e commit 52342d4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build/parseSpec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
16 changes: 16 additions & 0 deletions docs/manual/autobuild.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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
```
8 changes: 4 additions & 4 deletions macros.in
Original file line number Diff line number Diff line change
Expand Up @@ -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} ||:

Expand Down

0 comments on commit 52342d4

Please sign in to comment.