#!/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
VERSION = 2.15.3
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.conf		${DESTDIR}/etc/modules-load.d/efa.conf
	install -D -m 644 conf/efa-modprobe.conf ${DESTDIR}/etc/modprobe.d/efa.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_com.c		${DESTDIR}/${INSTALL_PATH}/src
	install -m 644 src/efa_com_cmd.c	${DESTDIR}/${INSTALL_PATH}/src
	install -m 644 src/efa_main.c		${DESTDIR}/${INSTALL_PATH}/src
	install -m 644 src/efa_sysfs.c		${DESTDIR}/${INSTALL_PATH}/src
	install -m 644 src/efa_verbs.c		${DESTDIR}/${INSTALL_PATH}/src
	install -m 644 src/efa_data_verbs.c	${DESTDIR}/${INSTALL_PATH}/src
	install -m 644 src/efa-abi.h 		${DESTDIR}/${INSTALL_PATH}/src
	install -m 644 src/efa_admin_cmds_defs.h ${DESTDIR}/${INSTALL_PATH}/src
	install -m 644 src/efa_admin_defs.h 	${DESTDIR}/${INSTALL_PATH}/src
	install -m 644 src/efa_com_cmd.h	${DESTDIR}/${INSTALL_PATH}/src
	install -m 644 src/efa_com.h		${DESTDIR}/${INSTALL_PATH}/src
	install -m 644 src/efa_common_defs.h	${DESTDIR}/${INSTALL_PATH}/src
	install -m 644 src/efa_io_defs.h	${DESTDIR}/${INSTALL_PATH}/src
	install -m 644 src/efa.h		${DESTDIR}/${INSTALL_PATH}/src
	install -m 644 src/efa_verbs.h		${DESTDIR}/${INSTALL_PATH}/src
	install -m 644 src/efa_regs_defs.h	${DESTDIR}/${INSTALL_PATH}/src
	install -m 644 src/efa_sysfs.h		${DESTDIR}/${INSTALL_PATH}/src
	install -m 644 src/kcompat.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 src/efa_p2p.c		${DESTDIR}/${INSTALL_PATH}/src
	install -m 644 src/efa_p2p.h		${DESTDIR}/${INSTALL_PATH}/src
	install -m 644 src/efa_gdr.c		${DESTDIR}/${INSTALL_PATH}/src
	install -m 644 src/nv-p2p.h		${DESTDIR}/${INSTALL_PATH}/src
	install -m 644 src/efa_neuron.c		${DESTDIR}/${INSTALL_PATH}/src
	install -m 644 src/neuron_p2p.h		${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}
	install -m 644 config/Makefile		${DESTDIR}/${INSTALL_PATH}/config
	install -m 644 config/main.c.in		${DESTDIR}/${INSTALL_PATH}/config
	install -m 744 config/compile_conftest.sh	${DESTDIR}/${INSTALL_PATH}/config
	install -m 744 config/wait_for_pid.sh	${DESTDIR}/${INSTALL_PATH}/config
	install -m 644 config/efa.cmake		${DESTDIR}/${INSTALL_PATH}/config
	install -m 744 config/runbg.sh		${DESTDIR}/${INSTALL_PATH}/config
