#!/usr/bin/make -f


PACKAGE_NAME = $(shell dpkg-parsechangelog --show-field source)
PACKAGE_VERSION = $(shell dpkg-parsechangelog --show-field version)
export PACKAGE_NAME PACKAGE_VERSION
SRC_VERSION ?= $(shell cat VERSION)
URL_DOWNLOAD = "https://github.com/asterisk/dahdi-linux/releases/download/v${SRC_VERSION}/dahdi-linux-${SRC_VERSION}.tar.gz"

%:
	dh $@ --with dkms

# Nothing to configure, build or auto-install (this all happens after
# installation using dkms)
override_dh_auto_configure:
override_dh_auto_build:
override_dh_auto_install:

.PHONY: get-orig-source

get-orig-source:
	@echo "# Downloading..."
	wget -nv -T10 -t3 $(URL_DOWNLOAD) -O ../$(PACKAGE_NAME)_$(SRC_VERSION).orig.tar.gz