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

. ${ScriptsDir}/include/exports

if checkPlatformFunction SYNO_FEA_SHA_API; then
	if [ "32" = "$BUILD_ARCH" ]; then
		STRIP=${STRIP}
	else
		STRIP=${STRIP64}
	fi
else
	SkipThisProject
	return
fi

make remoteinstall BuildRoot="$TmpInstDir" STRIP=${STRIP}

strip_binary()
{
	[ "x$NOSTRIP" = "xNOSTRIP" ] && return

	if [ -d "$TmpInstDir/usr/bin" ]; then
		find $TmpInstDir/usr/bin -type f | xargs $STRIP
	fi
}

clean_execute_permission_on_all_files()
{
	find $TmpInstDir/ -type f -exec chmod og-x {} \;
}

strip_binary
clean_execute_permission_on_all_files
