icinga-build-package 728 Bytes
Newer Older
Markus Frosch's avatar
Markus Frosch committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
#!/bin/bash

# detecting files
FILES_SPEC="$(ls *.spec 2>/dev/null)"
FILES_DEBIAN="$(ls */debian 2>/dev/null)"

if [ -n "${FILES_SPEC}" ]; then
  echo "Detected RPM source: ${FILES_SPEC}"
  echo
  #TODO
  exit 1
elif [ -n "${FILES_DEBIAN}" ]; then
  echo "Detected Debian source files: ${FILES_DEBIAN}"
  echo
  echo "[ running source build ]"
  icinga-build-deb-source
  if [ $? -ne 0 ]; then
    echo "[ source build failed! ]"
    exit 1
  fi
  echo "[ source build completed ]"
  echo

  echo "[ running binary build ]"
  icinga-build-deb-binary
  if [ $? -ne 0 ]; then
    echo "[ binary build failed! ]"
    exit 1
  fi
  echo "[ binary build completed ]"
  echo
else
  echo "Could not detect build type!" >&2
  exit 1
fi