Skip to content

Commit

Permalink
Define a global %clean default, reuse for the non-buildsystem, case too
Browse files Browse the repository at this point in the history
We've had this special case for %clean for ages, but this actually
offers a nice opportunity to put it into a macro that allows customization
and is used for more than one purpose.
  • Loading branch information
pmatilai committed Jan 11, 2024
1 parent 0c9a45e commit c4be218
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build/parseSpec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,7 @@ static rpmSpec parseSpec(const char *specFile, rpmSpecFlags flags,
goto errxit;

if (spec->sections[SECT_CLEAN] == NULL) {
char *body = rpmExpand("%{?buildroot: %{__rm} -rf %{buildroot}}", NULL);
char *body = rpmExpand("%{buildsystem_default_clean}", NULL);
spec->sections[SECT_CLEAN] = newStringBuf();
appendLineStringBuf(spec->sections[SECT_CLEAN], body);
free(body);
Expand Down
1 change: 1 addition & 0 deletions macros.in
Original file line number Diff line number Diff line change
Expand Up @@ -1354,6 +1354,7 @@ end

# Global buildsystem defaults
%buildsystem_default_prep() %autosetup -p1 %*
%buildsystem_default_clean() %{__rm} -rf %{buildroot}

# Example buildsystem for autotools
%buildsystem_autotools_conf() %configure %*
Expand Down

0 comments on commit c4be218

Please sign in to comment.