#!/usr/bin/make -f

### CDBS INCLUDES
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/rules/simple-patchsys.mk
include /usr/share/cdbs/1/class/kde.mk

### VARIABLES
DEB_DH_MAKESHLIBS_ARGS_ALL := -n
DEB_INSTALL_DIRS_amarok    := usr/lib/amarok
DEB_DH_SHLIBDEPS_ARGS	   := -Xusr/lib/amarok/amarok_xmmswrapper2 \
			      -Xusr/lib/kde3/konqsidebar_universalamarok.so

DEB_CONFIGURE_EXTRA_FLAGS  := --without-included-sqlite \
			      --enable-mysql

### COMMON STUFF
common-binary-arch::
	# Use debian/substvars
	for p in $(DEB_ALL_PACKAGES); do \
	  cat debian/substvars >>debian/$$p.substvars; \
	done

### POST-INSTALL HACKING
# Make directories in /usr/share/doc be symlinks for packages other than amarok
common-binary-post-install-arch::
	for p in $(filter-out amarok,$(DEB_ALL_PACKAGES)); do \
	  rm -rf debian/$$p/usr/share/doc/$$p; \
	  ln -sf amarok debian/$$p/usr/share/doc/$$p; \
	done

	if test -r debian/install-bug-notice.sh; then \
	    sh debian/install-bug-notice.sh $(DEB_ALL_PACKAGES); \
	fi

	# Check for not installed files
	dh_install --no-act --list-missing
