#!/usr/bin/make -f
# Originally made with the aid of dh_make, by Craig Small
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
# Some lines taken from debmake, by Cristoph Lameter.
# Rewritten to use dh, by Balint Reczey

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# This has to be exported to make some magic below work.
export DH_OPTIONS

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- --enable-lastfm --enable-mpd --enable-itunes --enable-chromecast --with-pulseaudio --with-libwebsockets --enable-spotify

override_dh_auto_install:
	cp $(CURDIR)/owntone.service debian/
	dh_auto_install
	rm debian/owntone/usr/lib/*/owntone/owntone-sqlext.la
	rm -rf debian/owntone/etc/systemd/

override_dh_makeshlibs:
	dh_makeshlibs -n

override_dh_installdocs:
	dh_installdocs -XNEWS

override_dh_clean:
	dh_clean
	rm -f debian/owntone.service
	rm -f config.log src/RSP*.h src/RSP*.c src/RSP*.tokens src/RSP*.u src/DAAP*.h src/DAAP*.c src/DAAP*.tokens src/DAAP*.u src/SMARTPL*.h src/SMARTPL*.c src/SMARTPL*.tokens src/SMARTPL*.u src/*hash.h build-aux/config.sub build-aux/config.guess
