#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/gnome.mk
include /usr/share/cdbs/1/rules/utils.mk

DH_VERBOSE=1

DEB_AUTO_UPDATE_LIBTOOL := post

DEB_INSTALL_MANPAGES_glom := debian/glom.1

DEB_SHLIBDEPS_INCLUDE := debian/libglom-1.18-0/usr/lib
DEB_CONFIGURE_EXTRA_FLAGS := --disable-update-mime-database --with-postgres-utils=/usr/lib/postgresql/8.4/bin

DEB_COMPRESS_EXCLUDE := .glom .js

common-binary-arch::
	rm -f debian/*/usr/share/mime/{subclasses,globs,magic,XMLnamespaces,aliases,mime.cache}
	rm -f debian/*/usr/lib/python*/*-packages/glom*.la
	rm -f debian/*/usr/lib/python*/*-packages/glom*.a
	rm -f debian/*/usr/share/pyshared/glom*.a
	rm -f debian/*/usr/share/pyshared/glom*.la

makebuilddir::
	/usr/bin/docbook-to-man debian/glom.sgml > debian/glom.1

binary-predeb/glom-doc::
	find debian/tmp -type f -name jquery.js -delete
	find debian/tmp -type f -name underscore.js -delete
	ln -sf /usr/share/javascript/jquery/jquery.js \
	debian/glom-doc/usr/share/doc/pyglom_1_18/reference/html/_static/jquery.js
	ln -sf /usr/share/javascript/underscore/underscore.js \
	debian/glom-doc/usr/share/doc/pyglom_1_18/reference/html/_static/underscore.js

cleanbuilddir::
	rm -f debian/glom.1
	rm -f glom-*.tar.gz.cdbs-config_list

binary-install/glom::
	dh_python2
