#!/usr/bin/make -f
%:
	dh $@ --with xul-ext --buildsystem=xul_ext --parallel

override_dh_auto_build:
	uglifyjs -o \
		chrome/noscript.jar!/content/noscript/antlr.js \
		debian/antlr3-all.js
	dh_auto_build -O--buildsystem=xul_ext -O--parallel

override_dh_install:
	dh_install -O--buildsystem=xul_ext -O--parallel
	rm -f debian/xul-ext-noscript/usr/share/xul-ext/noscript/NoScript_License.txt
	rm -f debian/xul-ext-noscript/usr/share/xul-ext/noscript/GPL.txt

override_dh_installchangelogs:
	dh_installchangelogs debian/upstream-changelog -O--buildsystem=xul_ext -O--parallel

refresh-upstream-changelog:
	(echo "[+] new feature, [x] bug fix, [-] removed feature, [=] repackaging or cosmetic change"; \
	 echo; \
	 wget -q -O- http://noscript.net/changelog | \
	 sed -n -e '/<pre id="changelog"/,/<\/pre>/p' | tail -n +2 | head -n -1) \
	> debian/upstream-changelog
