#!/usr/bin/make -f

POD_MANPAGES=$(wildcard debian/manpages/*.pod)
MANPAGES=$(patsubst %.pod,%.1, $(POD_MANPAGES))

%:
	dh --with=python2 $@

%.1: %.pod
	pod2man $< $@

override_dh_auto_clean:
	rm -f Makefile
	rm -f gunicorn/workers/gaiohttp.py
	dh_auto_clean

override_dh_auto_build: $(MANPAGES)
	dh_auto_build

override_dh_installexamples:
	dh_installexamples
	find debian/gunicorn/usr/share/doc/gunicorn/examples \
		-executable -type f -print0 | xargs -0r chmod -x
