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

metaver = $(shell LC_ALL=C dpkg-parsechangelog | grep '^Version:' | cut -d ' ' -f 2,2)
metaupstreamver = $(shell echo "$(metaver)" | cut -d '-' -f 1,1)
fslfullver = $(shell echo "$(metaver)" | sed -e 's/+.*-/-/')
fslupstreamver = $(shell echo "$(fslfullver)" | cut -d '-' -f 1,1)
fslmajorver = $(shell echo "$(fslupstreamver)" | cut -d . -f -2)

# one ring to rule them all ...
%:
	dh $@

override_dh_auto_build: update-control
	dh_auto_build

update-control:
	sed -e 's/#FSLMVER#/$(fslmajorver)/g' -e 's/#FSLFVER#/$(fslfullver)/g' \
		< debian/control.template > debian/control

get-orig-source:
	tar --exclude debian --exclude .git -czf ../fslmeta_$(metaupstreamver).orig.tar.gz .
