#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
#
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.
#
# Modified to make a template file for a multi-binary package with separated
# build-arch and build-indep targets  by Bill Allombert 2001

# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
export CURVER=$(shell dpkg-parsechangelog |grep Version|sed 's/Version: //'| sed -re 's,.([0-9])+$$,,')

ifeq ($(ARCH), i386)
    export UPSTREAM_ARCH=ia32
else
    export UPSTREAM_ARCH=x64
endif

%:
	dh $@

override_dh_install:
	mkdir debian/tmp

	cd packages; tar xvzf node-webkit-v$(CURVER)-linux-$(UPSTREAM_ARCH).tar.gz
	mv packages/node-webkit-v$(CURVER)-linux-$(UPSTREAM_ARCH) debian/tmp/node-webkit
	cd packages; tar xvzf libffmpegsumo.so.$(UPSTREAM_ARCH).tar.gz
	mv packages/libffmpegsumo.so debian/tmp/node-webkit
	dh_install

override_dh_shlibdeps:
	echo "override"