#! /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/simple-patchsys.mk
include /usr/share/cdbs/1/rules/utils.mk

include /usr/share/gnome-pkg-tools/1/rules/uploaders.mk

# special support for CST is not needed anymore, as it's integrated into openssl
DEB_CONFIGURE_EXTRA_FLAGS := --with-ssl=openssl --with-cst=yes
DEB_DH_MAKESHLIBS_ARGS_ALL := -V

ifneq (,$(findstring parallel,$(DEB_BUILD_OPTIONS)))
	PARALLEL_JOBS := $(shell echo $(DEB_BUILD_OPTIONS) | \
		sed -e 's/.*parallel=\([0-9]\+\).*/\1/')
	ifeq ($(DEB_BUILD_OPTIONS),$(PARALLEL_JOBS))
		PARALLEL_JOBS := $(shell if [ -f /proc/cpuinfo ]; \
			then echo `cat /proc/cpuinfo | grep 'processor' | wc -l`; \
			else echo 1; fi)
	endif
	NJOBS := -j$(PARALLEL_JOBS)
endif
DEB_MAKE_ENVVARS := MAKEFLAGS=$(NJOBS)

makebuilddir/libloudmouth1-0::
	gtkdocize
	autoreconf -v --install

common-binary-predeb-arch:: list-missing

clean::
	rm -fr docs/reference/html
	rm -fr docs/reference/xml
	rm -f docs/reference/loudmouth-decl.txt
	rm -f docs/reference/loudmouth-decl-list.txt
	rm -f docs/reference/loudmouth-undocumented.txt
