# nfpm configuration file for build Stork agent package
#
# check https://nfpm.goreleaser.com/configuration for detailed usage
#
arch: "${STORK_NFPM_ARCH}"
version: "${STORK_NFPM_VERSION}"

name: "isc-stork-agent"
platform: "linux"
section: "admin"
priority: "required"
replaces: []
provides: []
depends: []
recommends: []
suggests: []
conflicts: []
maintainer: "Stork team <stork-users@lists.isc.org>"
description: ISC Stork Server
vendor: "Internet Systems Consortium, Inc."
homepage: "https://stork.isc.org"
license: "MPL 2.0"

contents:
- src: dist/agent/lib/
  dst: /lib
- src: dist/agent/usr/
  dst: /usr
- src: dist/agent/etc/stork/agent.env
  dst: /etc/stork/agent.env
  type: config
- src: dist/agent/etc/stork/agent-credentials.json.template
  dst: /etc/stork/agent-credentials.json.template
- src: dist/agent/etc/stork/isc-stork-agent.initd
  dst: /etc/init.d/isc-stork-agent
  packager: apk

overrides:
  deb:
    scripts:
      postinstall: etc/hooks/deb/isc-stork-agent.postinst
      preremove:   etc/hooks/deb/isc-stork-agent.prerm
      postremove:  etc/hooks/deb/isc-stork-agent.postrm
  rpm:
    scripts:
      postinstall: etc/hooks/rpm/isc-stork-agent.postinst
      preremove:   etc/hooks/rpm/isc-stork-agent.prerm
      postremove:  etc/hooks/rpm/isc-stork-agent.postrm
  apk:
    scripts:
      postinstall: etc/hooks/apk/isc-stork-agent.postinst
      preremove:   etc/hooks/apk/isc-stork-agent.prerm
      postremove:  etc/hooks/apk/isc-stork-agent.postrm
