Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use Bash features in an RPM spec file?

Tags:

bash

rpm

rpmbuild

Searching open source projects, shows me that spec files in the wild do use bash constructs, for instance cat info|while read.

But is it really safe? Does the rpm documentation tells me I can count on the %build section being run by Bash?

like image 332
Elazar Leibovich Avatar asked May 23 '11 06:05

Elazar Leibovich


2 Answers

The default shell invoked for each of the spec stanzas is given by %_buildshell. This defaults to /bin/sh, but can be overridden either globally or on a per-stanza basis.

like image 129
Ignacio Vazquez-Abrams Avatar answered Sep 18 '22 20:09

Ignacio Vazquez-Abrams


Short answer: yes

Long answer: While bash has become the de facto standard of Linux shells and in practice you can count on having bash around, it does not hurt to specify %_buildshell to /bin/bash as already mentioned in @Ignacio Vazquez-Abrams 's answer

like image 26
Kimvais Avatar answered Sep 20 '22 20:09

Kimvais