name: "centreon-engine-daemon"
arch: "${ARCH}"
platform: "linux"
version_schema: "none"
version: "${VERSION}"
release: "${RELEASE}${DIST}"
section: "default"
priority: "optional"
maintainer: "Centreon <contact@centreon.com>"
description: |
  Centreon Engine is a monitoring engine that schedule checks on your
  network services and hosts.
  Commit: @COMMIT_HASH@
vendor: "Centreon"
homepage: "https://www.centreon.com"
license: "Apache-2.0"

contents:
  - src: "../engine/conf/centengine.cfg"
    dst: "/etc/centreon-engine/centengine.cfg"
    type: config|noreplace
    file_info:
      mode: 0664
      owner: centreon-engine
      group: centreon-engine

  - src: "../engine/conf/resource.cfg"
    dst: "/etc/centreon-engine/resource.cfg"
    type: config|noreplace
    file_info:
      mode: 0664
      owner: centreon-engine
      group: centreon-engine

  - src: "../engine/conf/commands.cfg"
    dst: "/etc/centreon-engine/commands.cfg"
    type: config|noreplace
    file_info:
      mode: 0664
      owner: centreon-engine
      group: centreon-engine

  - src: "../engine/conf/timeperiods.cfg"
    dst: "/etc/centreon-engine/timeperiods.cfg"
    type: config|noreplace
    file_info:
      mode: 0664
      owner: centreon-engine
      group: centreon-engine

  - src: "../engine/scripts/logrotate.conf"
    dst: "/etc/logrotate.d/centengine"
    type: config|noreplace

  - src: "../engine/scripts/centengine.service"
    dst: "/usr/lib/systemd/system/centengine.service"
    file_info:
      mode: 0644
    packager: rpm
  - src: "../engine/scripts/centengine.service"
    dst: "/lib/systemd/system/centengine.service"
    file_info:
      mode: 0644
    packager: deb

  - src: "../build/engine/centengine"
    dst: "/usr/sbin/centengine"

  - src: "../build/engine/centenginestats"
    dst: "/usr/sbin/centenginestats"

  - src: "../build/engine/modules/external_commands/externalcmd.so"
    dst: "/usr/lib64/centreon-engine/externalcmd.so"

  - dst: "/etc/centreon-engine"
    type: dir
    file_info:
      mode: 0775
      owner: centreon-engine
      group: centreon-engine

  - dst: "/etc/centreon-engine/conf.d"
    type: dir
    file_info:
      mode: 0775
      owner: centreon-engine
      group: centreon-engine

  - dst: "/var/log/centreon-engine"
    type: dir
    file_info:
      mode: 0755
      owner: centreon-engine
      group: centreon-engine

  - dst: "/var/log/centreon-engine/archives"
    type: dir
    file_info:
      mode: 0755
      owner: centreon-engine
      group: centreon-engine

  - dst: "/var/lib/centreon-engine"
    type: dir
    file_info:
      mode: 0755
      owner: centreon-engine
      group: centreon-engine

  - dst: "/var/lib/centreon-engine/rw"
    type: dir
    file_info:
      mode: 0775
      owner: centreon-engine
      group: centreon-engine

scripts:
  preinstall: ./scripts/centreon-engine-daemon-preinstall.sh
  postinstall: ./scripts/centreon-engine-daemon-postinstall.sh
  preremove: ./scripts/centreon-engine-daemon-preremove.sh
  postremove: ./scripts/centreon-engine-daemon-postremove.sh

overrides:
  rpm:
    depends:
      - centreon-clib = ${VERSION}-${RELEASE}${DIST}
      - centreon-engine = ${VERSION}-${RELEASE}${DIST}
      - centreon-broker-cbmod = ${VERSION}-${RELEASE}${DIST}
      - centreon-engine-opentelemetry = ${VERSION}-${RELEASE}${DIST}
    conflicts:
      - centreon-engine-extcommands
      - centreon-engine-devel
    replaces:
      - centreon-engine-extcommands
      - centreon-engine-devel
    provides:
      - centreon-engine-extcommands
      - centreon-engine-devel
  deb:
    depends:
      - centreon-clib (= ${VERSION}-${RELEASE}${DIST})
      - centreon-engine (= ${VERSION}-${RELEASE}${DIST})
      - centreon-broker-cbmod (= ${VERSION}-${RELEASE}${DIST})
      - centreon-engine-opentelemetry (= ${VERSION}-${RELEASE}${DIST})
    conflicts:
      - centreon-engine-extcommands
      - centreon-engine-dev
    replaces:
      - centreon-engine-extcommands
      - centreon-engine-dev
    provides:
      - centreon-engine-extcommands
      - centreon-engine-dev

rpm:
  summary: Centreon Engine Daemon is the daemon to schedule checks.
  compression: zstd
  signature:
    key_file: ${RPM_SIGNING_KEY_FILE}
    key_id: ${RPM_SIGNING_KEY_ID}
