#!/usr/bin/make -f
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.

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

build: build-stamp
build-stamp:
	dh_testdir
	# Add here commands to compile the package.
	./configure --disable-alsa --without-x
#	ln -sf main.c src/main/xmain.c
	$(MAKE)
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp
	dh_clean
	# Add here commands to clean up after the build process.
	-$(MAKE) distclean

# Build architecture-independent files here.
binary-indep: build
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build-stamp
#	dh_testversion
	dh_testdir
	dh_testroot
	dh_clean
	dh_installdirs -pxmp usr/bin etc #usr/share/doc-base
	dh_installdirs -pxmp-xmms usr/lib/xmms/Input
	# Add here commands to install the files into debian/xmp
#	$(MAKE) BIN_DIR=$(shell pwd)/debian/tmp/usr/bin install
	install -s -m755 src/main/xmp $(shell pwd)/debian/tmp/usr/bin
	install -s -m755 src/xmms/libxmp.so $(shell pwd)/debian/xmp-xmms/usr/lib/xmms/Input
	cp debian/xmp-view debian/tmp/usr/bin
	chmod +x debian/tmp/usr/bin/xmp-view
	cp debian/xmp-view.conf debian/tmp/etc/xmp-view.conf
	cp etc/xmp.conf debian/tmp/etc/xmp.conf
	cp etc/xmp-modules.conf debian/tmp/etc/xmp-modules.conf
	# cp debian/doc-base debian/tmp/usr/share/doc-base/xmp
	# cp debian/doc-base debian/tmp/usr/share/doc-base/xmp-faq
	dh_installdocs -pxmp docs/CREDITS docs/README.awebug \
		docs/README.fixloop docs/README.trackers README
	dh_installdocs -pxmp-xmms src/xmms/README
	dh_installexamples
	dh_installmenu
#	dh_installinit
	dh_installcron
	dh_installmanpages -pxmp docs/xxmp.1
	dh_undocumented -pxmp xmp-view.1
	dh_installchangelogs docs/ChangeLog
	dh_strip
	dh_compress
	dh_fixperms
	dh_suidregister
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
#	dh_makeshlibs
	dh_md5sums
	dh_builddeb

source diff:                                                                  
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary
