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

# Use bash and not the default sh
SHELL := /bin/bash

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

# This has to be exported to make some magic below work.
export DH_OPTIONS

source := $(shell dpkg-parsechangelog -S Source)

%:
	dh $@

override_dh_auto_clean:
	# Cleanup first
	mkdir -p opt/waterfox/distribution/extensions
	rm -f opt/waterfox/distribution/extensions/*
	wget -q -nc https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/ -O opt/waterfox/distribution/extensions/uBlock0@raymondhill.net.xpi
	wget -q -nc https://addons.mozilla.org/firefox/downloads/latest/https-everywhere/ -O opt/waterfox/distribution/extensions/https-everywhere@eff.org.xpi
	wget -q -nc https://addons.mozilla.org/firefox/downloads/latest/privacy-badger17/ -O opt/waterfox/distribution/extensions/jid1-MnnxcxisBPnSXQ@jetpack.xpi

override_dh_builddeb:
	dh_builddeb
	# Cleanup build directory when done
	rm -rf ./debian/$(source)
