#!/usr/bin/make -f

#export DH_VERBOSE=1

DH_ALWAYS_EXCLUDE := .svn

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk
include /usr/share/cdbs/1/class/gnome.mk
include /usr/share/cdbs/1/rules/simple-patchsys.mk
include /usr/share/cdbs/1/rules/utils.mk

DEB_INSTALL_DOCS_libosso-gnomevfs2-common := README.dbus doc/dbus-protocol.txt

# debug lib
DEB_DH_STRIP_ARGS := --dbg-package=libosso-gnomevfs2-0

DEB_CONFIGURE_EXTRA_FLAGS := --disable-samba --disable-gnutls --disable-openssl \
	--enable-gtk-doc --libexecdir=/usr/libexec --enable-more-warnings=no

DEB_DH_INSTALL_ARGS := -Xlibextfs -Xlibnntp -Xlibvfs-pipe -Xlibcomputer -Xlibfile -Xlibvfolder-desktop

DEB_DH_MAKESHLIBS_ARGS_libosso-gnomevfs2-common := --no-act

# Use soft-float and thumb mode if it enabled.
ifneq (,$(findstring thumb,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -mthumb
endif

post-patches:: debian/stamp-autothings-update
debian/stamp-autothings-update:
	NOCONFIGURE=1 ./autogen.sh
	# Not that nice, but it works; strip out i18n from schemas.
	for f in `ls schemas/*.schemas.in`; do cp $$f `echo $$f | sed -e "s/\.in//"`; done
	touch $@

clean::
	rm -f debian/stamp-autothings-update
	rm -f debian/stamp-libtool-patch

common-configure-arch:: debian/stamp-libtool-patch
debian/stamp-libtool-patch:
	if [ `./libtool --version | head -1 |cut -d' ' -f4` = '1.5.6' ]; then \
	    patch -p0 < debian/libtool-long-versions.patch; fi
	touch $@
