#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/hlibrary.mk

DEB_GHC_EXTRA_PACKAGES := libghc-ekg-data (>= $(CABAL_VERSION))

MIN_JS = debian/jquery-1.6.4.min.js debian/jquery.flot.min.js

install/libghc-ekg-data:: debian/tmp-inst-ghc $(MIN_JS)
	mv debian/tmp-inst-ghc/usr/share/ekg-$(CABAL_VERSION) \
	   debian/libghc-ekg-data/usr/share
	for i in $(MIN_JS); do \
	  install -m 0644 \
	  $$i debian/libghc-ekg-data/usr/share/ekg-$(CABAL_VERSION)/assets/ ; \
	done

debian/%.min.js: assets/%.js
	uglifyjs -o $@ $<

.PHONY: minify-js

minify-js: $(MIN_JS)
