#!/usr/bin/make -f

%:
	dh $@

override_dh_auto_build:
	dh_auto_build
	cd scintilla/gtk; $(MAKE) GTK3=1 $(BUILD_LUA)
	cd scite/gtk; $(MAKE) gnomeprefix=/usr GTK3=1 $(BUILD_LUA)

override_dh_auto_clean:
	dh_auto_clean
	$(MAKE) -C scintilla/gtk clean
	rm -f scintilla/bin/scintilla.a
	$(MAKE) -C scite/gtk clean

override_dh_clean:
	dh_clean -X"scintilla/src/Editor.cxx.orig"

override_dh_auto_install:
	dh_auto_install
	cd scite/gtk; $(MAKE) install GTK3=1 gnomeprefix=../../debian/scite/usr datadir=../../debian/scite/usr/share
	#chmod -x $(CURDIR)/debian/scite/usr/share/scite/*
	# needed by the debian-menu file
	install -m 644 $(CURDIR)/debian/Sci32M.xpm $(CURDIR)/debian/scite/usr/share/scite
	# install configuration files into the /etc directory
	mv $(CURDIR)/debian/scite/usr/share/scite/*.properties $(CURDIR)/debian/scite/etc/scite
	for f in $(CURDIR)/debian/scite/etc/scite/*.properties; do \
		dh_link etc/scite/$$(basename $$f) usr/share/scite/$$(basename $$f); \
	done

override_dh_installchangelogs:
	dh_installchangelogs scintilla/doc/ScintillaHistory.html

