diff options
author | Oliver Smith <osmith@sysmocom.de> | 2020-05-08 15:08:48 +0200 |
---|---|---|
committer | Oliver Smith <osmith@sysmocom.de> | 2020-05-08 15:08:48 +0200 |
commit | 9cf3a0a01ac5f0d450d13b76316623782aec0760 (patch) | |
tree | 17a95df311100bec6ba165e78ca9254b15091eae | |
parent | 56c7e4f720d808ba653c3f1c43682e7b7292482b (diff) |
build_pkg.sh: only install systemd-rpm-macros if needed
Change-Id: Iffd773f4b079286ffde028cbc994ec9bd8ddd9cf
-rwxr-xr-x | rpm-local/scripts/build_pkg.sh | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/rpm-local/scripts/build_pkg.sh b/rpm-local/scripts/build_pkg.sh index 8354bf4..4d0e0f2 100755 --- a/rpm-local/scripts/build_pkg.sh +++ b/rpm-local/scripts/build_pkg.sh @@ -22,13 +22,14 @@ for arch in $ARCHES; do fi done -# HACK: install systemd-rpm-macros unless we are building it now, so the spec files can be parsed -if [ "$1" != "systemd-rpm-macros" ]; then +cd /home/user/rpmbuild/SPECS + +# Install systemd-rpm-macros if needed, so the .spec can be parsed +if grep "^BuildRequires:" "$1.spec" | grep -q systemd-rpm-macros; then dnf -y install systemd-rpm-macros fi # keepcache: /var/cache/dnf is mounted from outside docker dir, so downloaded rpm depends are cached -cd /home/user/rpmbuild/SPECS dnf \ --setopt=keepcache=1 \ -y \ |