#!/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/utils.mk
include /usr/share/cdbs/1/rules/autoreconf.mk
include /usr/share/cdbs/1/class/gnome.mk
-include /usr/share/gnome-pkg-tools/1/rules/gnome-get-source.mk

GNOME_MODULE := libgda
SONAME := 4

LDFLAGS += -Wl,-z,defs -Wl,--as-needed -Wl,-O1

DEB_DH_MAKESHLIBS_ARGS_ALL += -X /usr/lib/libgda-5.0/providers

DEB_MAKE_CHECK_TARGET = check

DEB_CONFIGURE_EXTRA_FLAGS +=	--with-postgres		\
				--with-mysql		\
				--with-libsoup		\
				--without-bdb		\
				--without-oracle	\
				--without-ldap		\
				--without-firebird	\
				--without-mdb		\
				--without-java		\
				--without-gnome-keyring	\
				--without-ui		\
				--enable-system-sqlite	\
				--enable-introspection	\
				--disable-crypto	\
				--enable-gtk-doc

clean::
	sed -e 's#@SONAME@#$(SONAME)#g' \
		-e 's#@GNOME_TEAM@#$(UPLOADERS)#g' \
		debian/control.in >debian/control

binary-install/libgda-5.0-common::
	# Don't ship our own copy of jquery.js
	rm debian/libgda-5.0-common/usr/share/libgda-5.0/web/jquery.js
	ln -s ../../javascript/jquery/jquery.js \
		debian/libgda-5.0-common/usr/share/libgda-5.0/web/
	dh_python2 -p$(cdbs_curpkg) usr/share/libgda-5.0

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

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