Merge "Fix performance option handling"
[apex.git] / ci / build.sh
index 7e080be..e687055 100755 (executable)
@@ -35,6 +35,7 @@ CACHE_DEST=""
 CACHE_DIR="cache"
 CACHE_NAME="apex-cache"
 MAKE_TARGETS="images"
+REQUIRED_PKGS="rpm-build python-docutils"
 
 parse_cmdline() {
   while [ "${1:0:1}" = "-" ]
@@ -82,6 +83,16 @@ run_make() {
 
 parse_cmdline "$@"
 
+# Install build dependencies
+for pkg in $REQUIRED_PKGS; do
+  if ! rpm -q $pkg > /dev/null; then
+    if ! sudo yum -y install $pkg > /dev/null; then
+      echo "Required package $pkg missing and installation failed."
+      exit 1
+    fi
+  fi
+done
+
 if [ -n "$RELEASE" ]; then MAKE_ARGS+="RELEASE=$RELEASE "; fi
 
 # Get the Old Cache