#!/usr/bin/make -f

DEB_PYTHON_SYSTEM = pysupport
DEB_DH_INSTALLCHANGELOGS_ARGS = ChangeLog

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/python-distutils.mk

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
common-build-indep:: debian/stamp-makefile-check
debian/stamp-makefile-check:
	for pyversion in $(shell pyversions -vr); do python$$pyversion gflags_unittest.py; done
	touch $@

clean::
	rm -f debian/stamp-makefile-check
endif

install/python-gflags::
	mv $(CURDIR)/debian/python-gflags/usr/bin/gflags2man.py $(CURDIR)/debian/python-gflags/usr/bin/gflags2man
	PYTHONPATH=$(CURDIR) python$(cdbs_python_current_version) gflags2man.py --dest_dir $(CURDIR) $(CURDIR)/debian/python-gflags/usr/bin/gflags2man

binary-install/python-gflags::
	for f in README AUTHORS; do rm "$(CURDIR)/debian/python-gflags/usr/share/doc/python-gflags/$$f"; done

clean::
	rm -f gflags2man.1
