#!/usr/bin/make -f
# -*- makefile -*-

# path to the basic package
BASE:=$(CURDIR)/debian/xfe


# ------------------- cdbs scripts ---------------------

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk
# not needed any more since source format 3.0:
#include /usr/share/cdbs/1/rules/simple-patchsys.mk

# for debugging (-O2 -DDEBUG):
#DEB_CONFIGURE_EXTRA_FLAGS += --enable-debug
# for releasing (-O3):
#DEB_CONFIGURE_EXTRA_FLAGS += --enable-release

# enable startup notify (new feature)
DEB_CONFIGURE_EXTRA_FLAGS += --enable-sn


# ----------------- additional rules -------------------

clean::
	-rm -f xf*.desktop
	-rm -f config.log

binary-post-install/xfe::
	@echo .
	# rename to prevent clash with xvstream
	mv $(BASE)/usr/bin/xfi $(BASE)/usr/bin/xfimage
	mv $(BASE)/usr/bin/xfp $(BASE)/usr/bin/xfpack
	mv $(BASE)/usr/bin/xfv $(BASE)/usr/bin/xfview
	mv $(BASE)/usr/bin/xfw $(BASE)/usr/bin/xfwrite
	mv $(BASE)/usr/share/man/man1/xfi.1 $(BASE)/usr/share/man/man1/xfimage.1
	mv $(BASE)/usr/share/man/man1/xfp.1 $(BASE)/usr/share/man/man1/xfpack.1
	mv $(BASE)/usr/share/man/man1/xfv.1 $(BASE)/usr/share/man/man1/xfview.1
	mv $(BASE)/usr/share/man/man1/xfw.1 $(BASE)/usr/share/man/man1/xfwrite.1
	@echo .

binary-post-install/xfe-i18n::
	@echo .
	-rm -rf $(BASE)-i18n/usr/share/doc/xfe-i18n
	dh_link -pxfe-i18n usr/share/doc/xfe usr/share/doc/xfe-i18n	
	@echo .

binary-post-install/xfe-themes::
	@echo .
	-rm -rf $(BASE)-themes/usr/share/doc/xfe-themes
	dh_link -pxfe-themes usr/share/doc/xfe usr/share/doc/xfe-themes
	@echo .


.PHONY: clean binary-post-install/xfe binary-post-install/xfe-i18n binary-post-install/xfe-themes
