#!/usr/bin/make -f

DEB_DIVERT_EXTENSION = .debathena
ifneq ($(wildcard /usr/share/gconf/default.path),)
    GCONF2_PATH = /usr/share/gconf/default.path
    DEB_CHECK_FILES_SOURCE_/etc/gconf/2/path = $(GCONF2_PATH)
else
    GCONF2_PATH = /etc/gconf/2/path
endif
DEB_TRANSFORM_FILES_debathena-gconf2-config += \
	/etc/gconf/2/path.debathena
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/rules/config-package.mk

GCONF_FILES = debian/gconf.afs debian/gconf.local debian/gconf.

common-build-indep:: $(GCONF_FILES)

DISTRO = $(shell lsb_release --short --id)
SUFFIX = $(SUFFIX-$(DISTRO))
SUFFIX-Debian = -debathena
SUFFIX-Ubuntu = -debathena-ubuntu
RELEASE = $(shell lsb_release --short --codename)

ifeq ($(SUFFIX),)
	$(error Unknown distro $(DISTRO).)
endif

debian/gconf.afs:
	echo 'xml:readwrite:$$(HOME)/.gconf-debathena-$(RELEASE)' > $@

debian/gconf.local:
	echo 'xml:readwrite:$$(HOME)/.gconf' > $@

debian/gconf.:
	ln -sf gconf.local $@

clean::
	rm -f $(GCONF_FILES)
