project_name: 'geoipupdate'
archives:
  - id: main
    wrap_in_directory: true
    files:
      - 'CHANGELOG.md'
      - 'LICENSE-APACHE'
      - 'LICENSE-MIT'
      - 'README.md'
      - 'GeoIP.conf'
      - 'GeoIP.conf.md'
      - 'geoipupdate.md'
builds:
  - main: './cmd/geoipupdate'
    binary: 'geoipupdate'
    goarch:
      - '386'
      - 'amd64'
      - 'arm'
      - 'arm64'
    goos:
      - 'linux'
    hooks:
      post: 'make data BUILDDIR=. CONFFILE=/etc/GeoIP.conf DATADIR=/usr/share/GeoIP'
    ldflags:
      - '-s -w -X main.version={{.Version}} -X main.defaultConfigFile=/etc/GeoIP.conf -X main.defaultDatabaseDirectory=/usr/share/GeoIP'
    env:
      - CGO_ENABLED=0
checksum:
  name_template: 'checksums-dpkg-rpm.txt'
nfpms:
  - vendor: 'MaxMind, Inc.'
    homepage: https://www.maxmind.com/
    maintainer: 'MaxMind, Inc. <support@maxmind.com>'
    description: Program to perform automatic updates of GeoIP2 and GeoIP Legacy binary databases.
    license: Apache 2.0 or MIT
    formats:
      - deb
      - rpm
    bindir: /usr/bin
    empty_folders:
      - /usr/share/GeoIP
    files:
      'CHANGELOG.md': '/usr/share/doc/geoipupdate/CHANGELOG.md'
      'LICENSE-APACHE': '/usr/share/doc/geoipupdate/LICENSE-APACHE'
      'LICENSE-MIT': '/usr/share/doc/geoipupdate/LICENSE-MIT'
      'README.md': '/usr/share/doc/geoipupdate/README.md'
      'GeoIP.conf': '/usr/share/doc/geoipupdate/GeoIP.conf'
      'GeoIP.conf.md': '/usr/share/doc/geoipupdate/GeoIP.conf.md'
      'geoipupdate.md': '/usr/share/doc/geoipupdate/geoipupdate.md'
    config_files:
      'GeoIP.conf': '/etc/GeoIP.conf'
release:
  # We disable the release as there is no way to disable the creation of
  # the archive version and we don't want to upload those. We also can
  # only do one release.
  disable: true
