_new_melody() {
  cat <<'MESSAGE'
==> This is a new Melody, not an update of the old one.

The Go daemon this package used to build is gone. melodyd is now a C++
engine that owns the library and playback, and it does not read anything
the old one left behind:

  - no MPD protocol (port 6600) and no web UI or HTTP API (port 6701);
    clients speak Melody's own protocol on port 6603, streams go out on 6604
  - no melodyd.toml and no setup wizard: options are flags, in
    ~/.config/melody/melodyd.conf for the user service
  - a new library database: add your music again and let it scan
  - melody-tui, melody-rofi, melody-lrcmatch and melody-watcher do not
    work with it; remove them if you have them. melody-musiclist does again:
    it comes with melody-cli-git

What talks to it: melody-git (the desktop app), melody-cli-git, the
Android app, and melody-agent-git for speakers elsewhere.

Setup: /usr/share/doc/melodyd-git/melody.md
MESSAGE
}

post_install() {
  _new_melody
  cat <<'MESSAGE'

On a desktop the engine starts with Melody: melodyd.socket is enabled
for every user. If an older Trackknife had started one, Melody moves it
over once; if it says no engine runs, start it:

  systemctl --user daemon-reload
  systemctl --user enable --now melodyd.socket

On a server:

  melody-cli config password 'the one all your engines share'
  systemctl --user enable --now melodyd.service
  loginctl enable-linger $USER    # to run without being logged in
MESSAGE
}

post_upgrade() {
  # Coming from the Go daemon, whose history ended at r116; the rewrite's
  # starts far above it. Quiet on ordinary updates after that.
  if [ "$(vercmp "$2" r300)" -lt 0 ]; then
    _new_melody
  fi
  cat <<'MESSAGE'
Restart the engine to use the new one: systemctl --user restart melodyd.service
Its state moves once from ~/.local/share/trackknife/trackknife to
~/.local/share/melody/engine as it starts (ADR-0287).
MESSAGE
}
