builders: use sh and quote $1 (dirname)

Signed-off-by: Niels Thykier <niels@thykier.net>