#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

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

%:
	dh $@ 

override_dh_install:
	# thunderbird-internal
	cp -a $(CURDIR)/thunderbird-internal/etc/thunderbird  $(CURDIR)/debian/treuchtlingen-foxde-config-thunderbird-internal/etc/
	cp -a $(CURDIR)/thunderbird-internal/etc/skel/.thunderbird $(CURDIR)/debian/treuchtlingen-foxde-config-thunderbird-internal/etc/skel/

	#firefox-internal
	cp -a $(CURDIR)/firefox-internal/etc/firefox-esr  $(CURDIR)/debian/treuchtlingen-foxde-config-firefox-internal/etc/
	cp -a $(CURDIR)/firefox-internal/etc/skel/.mozilla $(CURDIR)/debian/treuchtlingen-foxde-config-firefox-internal/etc/skel/
	cp -a $(CURDIR)/firefox-shared/usr/lib/firefox-esr/distribution/policies.json $(CURDIR)/debian/treuchtlingen-foxde-config-firefox-internal/usr/lib/firefox-esr/distribution/

	#firefox-external
	cp -a $(CURDIR)/firefox-external/etc/firefox-esr  $(CURDIR)/debian/treuchtlingen-foxde-config-firefox-external/etc/
	cp -a $(CURDIR)/firefox-external/etc/skel/.mozilla $(CURDIR)/debian/treuchtlingen-foxde-config-firefox-external/etc/skel/

	#libreoffice-colors
	cp -a $(CURDIR)/libreoffice/usr/lib/libreoffice/share/palette/Treuchtlingen.soc $(CURDIR)/debian/treuchtlingen-foxde-config-libreoffice-colors/usr/lib/libreoffice/share/palette/

	#libreoffice-internal
	cp -a $(CURDIR)/libreoffice/usr/lib/libreoffice/share/registry/treuchtlingen.xcd $(CURDIR)/debian/treuchtlingen-foxde-config-libreoffice-internal/usr/lib/libreoffice/share/registry/

	#cups-client-internal
	cp -a $(CURDIR)/cups-internal/client.conf $(CURDIR)/debian/treuchtlingen-foxde-config-cups-client-internal/etc/cups/

execute_after_dh_installdeb:
	find $(CURDIR)/debian/ -name '*.conffiles' | while read i ; do cp "$$i" "$(CURDIR)/debian/$$(basename "$$i" | sed 's/.conffiles//' )/DEBIAN/conffiles" ; done
