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

DISABLE_UPDATE_UPLOADERS := 1
include /usr/share/gnome-pkg-tools/1/rules/uploaders.mk
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/rules/simple-patchsys.mk
include /usr/share/cdbs/1/rules/utils.mk
include /usr/share/cdbs/1/class/gnome.mk
-include /usr/share/gnome-pkg-tools/1/rules/gnome-get-source.mk

LDFLAGS += -Wl,-z,defs

LDFLAGS += -Wl,--as-needed

LDFLAGS += -Wl,-O1

GNOME_MODULE := libgda

SONAME := 3
DEB_DH_INSTALL_SOURCEDIR := debian/tmp
DEB_CONFIGURE_EXTRA_FLAGS += --enable-gtk-doc --with-postgres=$(shell pg_config --includedir) --without-bdb --without-mSQL --without-ibmdb2 --without-sybase --without-oracle --without-firebird --without-xbase --without-mdb --without-ldap
DEB_DH_STRIP_ARGS += --dbg-package=libgda3-$(SONAME)
DEB_DH_MAKESHLIBS_ARGS_ALL += -X /usr/lib/libgda-3.0/providers

clean::
	sed -e 's#@SONAME@#$(SONAME)#g' \
		-e 's#@GNOME_TEAM@#$(UPLOADERS)#g' \
		debian/control.in >debian/control
	
	# remove generated files
	rm -f libsql/lexer.c
	rm -f libsql/parser.c

common-binary-post-install-arch::
	for i in libgda3-common libgda3-bin libgda3-dev libgda3-$(SONAME)-dbg \
	  libgda3-mysql libgda3-odbc libgda3-postgres libgda3-sqlite \
	  libgda3-freetds; \
	do \
		rm -rf debian/$$i/usr/share/doc; \
		dh_link -p$$i usr/share/doc/libgda3-$(SONAME) usr/share/doc/$$i; \
	done

.PHONY: clean common-binary-post-install-arch
