#!/usr/bin/make -f
# -*- makefile -*-

include /usr/share/dpkg/pkg-info.mk

export PYBUILD_NAME = dhros
export PYBUILD_DESTDIR = debian/dh-ros
export PYBUILD_INSTALL_ARGS = --install-lib=/usr/share/dh-ros --install-scripts=/usr/share/dh-ros

ifeq ($(shell grep 'version="$(DEB_VERSION_UPSTREAM)"' setup.py),)
ifeq ($(shell env | grep SALSA_CI),)
$(error version in setup.py does not match the one in debian/changelog)
endif
endif

%:
	dh $@ --buildsystem=pybuild

execute_before_dh_installman: rosbuilder.1

%.1: %.1.in
	sed -e 's/@VERSION@/$(DEB_VERSION_UPSTREAM)/g' $< >$@
