name: "centreon-common"
arch: "all"
platform: "linux"
version_schema: "none"
version: "${VERSION}"
release: "${RELEASE}${DIST}"
section: "default"
priority: "optional"
maintainer: "Centreon <contact@centreon.com>"
description: |
  Add user and group for Centreon
  Commit: @COMMIT_HASH@
vendor: "Centreon"
homepage: "https://www.centreon.com"
license: "Apache-2.0"

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

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

  - dst: "/var/cache/centreon"
    type: dir
    file_info:
      owner: centreon
      group: centreon
      mode: 0775

  - dst: "/var/cache/centreon/backup"
    type: dir
    file_info:
      owner: centreon
      group: centreon
      mode: 0775

  - dst: "/var/cache/centreon/config"
    type: dir
    file_info:
      owner: centreon
      group: centreon
      mode: 2775

  - dst: "/var/cache/centreon/config/engine"
    type: dir
    file_info:
      owner: centreon
      group: centreon
      mode: 2775

  - dst: "/var/cache/centreon/config/broker"
    type: dir
    file_info:
      owner: centreon
      group: centreon
      mode: 2775

  - dst: "/var/cache/centreon/config/export"
    type: dir
    file_info:
      owner: centreon
      group: centreon
      mode: 2775

  - dst: "/var/cache/centreon/config/vmware"
    type: dir
    file_info:
      owner: centreon
      group: centreon
      mode: 2775

  - src: "./src/config.yaml"
    dst: "/etc/centreon/config.yaml"
    file_info:
      mode: 0600

  - src: "./src/centreon.systemd"
    dst: "/etc/systemd/system/centreon.service"
    file_info:
      mode: 0644
    packager: rpm
  - src: "./src/centreon.systemd"
    dst: "/lib/systemd/system/centreon.service"
    file_info:
      mode: 0644
    packager: deb

scripts:
  preinstall: ./scripts/centreon-common-preinstall.sh
  postinstall: ./scripts/centreon-common-postinstall.sh
  preremove: ./scripts/centreon-common-preremove.sh
  postremove: ./scripts/centreon-common-postremove.sh

overrides:
  rpm:
    depends:
      - centreon-broker >= ${MAJOR_VERSION}
      - centreon-broker < ${NEXT_MAJOR_VERSION}
      - centreon-engine-daemon >= ${MAJOR_VERSION}
      - centreon-engine-daemon < ${NEXT_MAJOR_VERSION}
      - sudo
  deb:
    depends:
      - "centreon-broker (>= ${MAJOR_VERSION}~)"
      - "centreon-broker (<< ${NEXT_MAJOR_VERSION}~)"
      - "centreon-engine-daemon (>= ${MAJOR_VERSION}~)"
      - "centreon-engine-daemon (<< ${NEXT_MAJOR_VERSION}~)"
      - sudo

rpm:
  summary: Centreon common package
  compression: zstd
  signature:
    key_file: ${RPM_SIGNING_KEY_FILE}
    key_id: ${RPM_SIGNING_KEY_ID}
