#!/usr/bin/make -f

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

# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
export DH_VERBOSE = 1

NAME	= efa-nv-peermem
VERSION = 1.2.1
DESTDIR:=`pwd`/debian/${NAME}
INSTALL_PATH = /usr/src/${NAME}-${VERSION}


%:
	dh $@

override_dh_auto_clean:
	dh_clean

override_dh_auto_build:
	echo "Skip build"

override_dh_auto_configure:
	echo "Skip configure"

override_dh_auto_install:
	mkdir -p ${DESTDIR}/${INSTALL_PATH}
	mkdir -p ${DESTDIR}/${INSTALL_PATH}/config
	mkdir -p ${DESTDIR}/${INSTALL_PATH}/src
	install -D -m 644 conf/efa_nv_peermem.conf		${DESTDIR}/etc/modules-load.d/efa_nv_peermem.conf
	install -m 644 conf/dkms.conf				${DESTDIR}/${INSTALL_PATH}
	install -m 744 conf/configure-dkms.sh			${DESTDIR}/${INSTALL_PATH}
	install -m 644 src/efa_nv_peermem_main.c		${DESTDIR}/${INSTALL_PATH}/src
	install -m 644 src/efa_nv_peermem.h			${DESTDIR}/${INSTALL_PATH}/src
	install -m 644 src/nv-p2p.h				${DESTDIR}/${INSTALL_PATH}/src
	install -m 644 src/CMakeLists.txt			${DESTDIR}/${INSTALL_PATH}/src
	install -m 644 src/Kbuild.in				${DESTDIR}/${INSTALL_PATH}/src
	install -m 644 README					${DESTDIR}/${INSTALL_PATH}
	install -m 644 RELEASENOTES.md				${DESTDIR}/${INSTALL_PATH}
	install -m 644 CMakeLists.txt				${DESTDIR}/${INSTALL_PATH}
