Skip to content

Commit

Permalink
macros: Use /bin/bash instead of /bin/sh by default
Browse files Browse the repository at this point in the history
RPM spec files (and %build/%install sections) assume certain bashisms,
such as pushd, brace'd globs (i.e mkdir {bin,lib}), etc. Currently, rpm
macros as upstream enforce /bin/sh as the shebang for the rpmbuild generated .sh.
This works okay as long as /bin/sh points to bash, however this is not
necessarily the case, and plenty of distros have/are switching to other
shells such as dash by default for /bin/sh scripts.

Since we aren't going to fix all spec files any time soon, use /bin/bash
as the default %{_buildshell} value. This makes sure rpmbuild works
without a hitch on such systems.

Signed-off-by: Pedro Falcato <[email protected]>
  • Loading branch information
heatd committed Dec 14, 2024
1 parent f9f124a commit 8c4c87b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion macros.in
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
%_builddir %{_topdir}/BUILD

# The interpreter used for build scriptlets.
%_buildshell /bin/sh
%_buildshell /bin/bash

# The location of the rpm database file(s).
%_dbpath %{_var}/lib/rpm
Expand Down

0 comments on commit 8c4c87b

Please sign in to comment.