#!/bin/sh # start mock session with build deps from given .spec file set -eu [ -d "$(mock --print-root-path)" ] || mock --init specfile="$1" shift mock -i $(sed -n '/^BuildRequires:/ {s/^.*: //; s/>=.*$//; p}' "$specfile") $@