#!/bin/bash
# Copyright (c) 2000-2016 Synology Inc. All rights reserved.

if ! checkPlatformFunction SYNO_FEA_QUALCOMM_COMMON; then
	SkipThisProject
	return;
fi
case "$BUILD_TARGET" in
	QUALCOMM_IPQ806X)
		;;
	QUALCOMM_CYPRESS)
		;;
	QUALCOMM_HAWKEYE)
		;;
	*)
		SkipThisProject
		return
		;;
esac

MOD_DST=${TmpInstDir}/lib/modules
if [ "$BUILD_TARGET" = "QUALCOMM_CYPRESS" ] || [ "$BUILD_TARGET" = "QUALCOMM_HAWKEYE" ]; then
	MOD_LIST="
	cryptoapi/v2.0/qca-nss-cfi-cryptoapi.ko
	ocf/v2.0/qca-nss-cfi-ocf.ko
	"
else
	MOD_LIST="
	cryptoapi/v1.1/qca-nss-cfi-cryptoapi.ko
	ocf/v1.0/qca-nss-cfi-ocf.ko
	ipsec/v1.0/qca-nss-ipsec.ko
	"
fi
for each in ${MOD_LIST}; do
	install -D -m644 ${each} ${MOD_DST}/$(basename ${each})
	if [ "x$NOSTRIP" != "xNOSTRIP" ]; then
		${STRIP} -d ${MOD_DST}/$(basename ${each})
	fi
done
# vim:ft=sh
