#!/usr/bin/make -f

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

DEB_CONFIGURE_EXTRA_FLAGS += --enable-static --disable-gtk-doc
DEB_DH_MAKESHLIBS_ARGS_libethos-1.0-1 = -V 'libethos-1.0-1 (>= 0.1.0)' -- -c4

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

binary-install/python-ethos::
	dh_pycentral -p$(cdbs_curpkg)

VERSION=$(shell ./version.sh)
REV=$(shell git rev-list HEAD^!)
DATE=$(shell date --rfc-2822)
DIST=$(shell lsb_release -c -s)

update-version:
	echo "\
ethos (${VERSION}-1~${DIST}0) ${DIST}; urgency=low\n\
\n\
  * Automatic package for revision ${REV}. \n\
\n\
 -- Christian Hergert <chris@dronelabs.com>  ${DATE}" > debian/changelog
	echo "\n\n*** PACKAGE WILL BE BUILT FOR ${DIST} ***\n\n"
