name: "elastic-otel-php"
arch: "${PACKAGE_GOARCHITECTURE}"
platform: "linux"

version: ${PACKAGE_VERSION}
version_schema: semver

section: "default"
priority: "extra"

replaces:
- apm-agent-php

overrides:
  rpm:
    provides:
    - elastic-otel-php
  deb:
    provides:
    - elastic-otel-php

depends:
- bash
maintainer: "APM Team <info@elastic.co>"
description: |
  Elastic Distribution for OpenTelemetry PHP
  Git Commit: ${PACKAGE_SHA}
vendor: "Elasticsearch, Inc."
homepage: "https://github.com/elastic/elastic-otel-php"
license: "ASL 2.0"
#changelog: "changelog.yaml"
contents:
- src: /source/prod/native/_build/${BUILD_ARCHITECUTRE}-release/loader/code/elastic_otel_php_loader.so
  dst: /opt/elastic/elastic-otel-php/
  expand: true
- src: /source/prod/native/_build/${BUILD_ARCHITECUTRE}-release/extension/code/elastic_otel_php_*.so
  dst: /opt/elastic/elastic-otel-php/
  expand: true
- src: /source/prod/php
  dst: /opt/elastic/elastic-otel-php/php
  type: tree
  packager: rpm
- src: /source/prod/php
  dst: /opt/elastic/elastic-otel-php/php
  packager: deb
- src: /source/prod/php
  dst: /opt/elastic/elastic-otel-php/php
  packager: apk
- src: /source/packaging/configs/elastic-otel-custom-template.ini
  dst: /opt/elastic/elastic-otel-php/etc/elastic-otel-custom.ini
  type: config
- src: /source/README.md
  dst: /opt/elastic/elastic-otel-php/docs/README.md
- src: /source/NOTICE
  dst: /opt/elastic/elastic-otel-php/NOTICE
- src: /source/LICENSE
  dst: /opt/elastic/elastic-otel-php/LICENSE

scripts:
  postinstall: /source/packaging/scripts/post-install.sh
  preremove: /source/packaging/scripts/before-uninstall.sh
