#!/usr/bin/make -f
# -*- Makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

DESTDIR=$(CURDIR)/debian/libjs-cryptojs

override_dh_auto_build:
	$(CURDIR)/debian/build

%:
	dh $@

get-orig-source:
	VERSION=$(shell if [ -z $$CJS_VERSION ]; \
	   then dpkg-parsechangelog | grep ^Version | cut -d\  -f2 | cut -d- -f1 | cut -d+ -f1; \
	   else echo $$CJS_VERSION; fi);\
	mkdir dump ; \
	cd dump ; \
	svn export http://crypto-js.googlecode.com/svn/tags/$${VERSION}/build cryptojs-$${VERSION}+dfsg  ; \
	svn export http://crypto-js.googlecode.com/svn/tags/$${VERSION}/docs cryptojs-$${VERSION}+dfsg/docs  ; \
	rm -rf cryptojs-$${VERSION}+dfsg/components/*-min.js cryptojs-$${VERSION}+dfsg/rollups ; \
	tar -czf cryptojs_$${VERSION}+dfsg.orig.tar.gz cryptojs-$${VERSION}+dfsg

.PHONY: override_dh_auto_build