#!/bin/sh
# Superficial check that the binary starts, links and reports its build.
set -eu

version="$(shairport-sync -V)"
echo "version string: $version"
for feature in AirPlay2 Avahi ALSA PulseAudio PipeWire dummy stdout pipe soxr metadata mqtt dbus mpris; do
	case "-$version-" in
	*"-$feature-"*) ;;
	*)
		echo "version string lacks '$feature'; was the package built with all expected options?" >&2
		exit 1
		;;
	esac
done

shairport-sync -h >/dev/null
shairport-sync -X >/dev/null 2>&1
