#!/usr/bin/make -f

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

DATE=$(shell date +%Y%m%d)

get-orig-source:
	# Needs: git-core
	cd .. && \
 	git clone https://github.com/sciyoshi/pyfacebook.git && \
	mv pyfacebook python-facebook-$(DATE)

	cd ../python-facebook-$(DATE) && \
	rm -rf .git

	tar cfz ../python-facebook_$(DATE).orig.tar.gz ../python-facebook-$(DATE)

PYVERS	= $(shell pyversions -rv)

build-arch: build
build-indep: build

build: $(PYVERS:%=build-stamp-py%)
build-stamp-py%:
	dh_testdir
	python$* setup.py build
	touch $@

install: install-prereqs $(PYVERS:%=install-stamp-py%)
install-prereqs:
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs
install-stamp-py%:
	python$* setup.py install --root $(CURDIR)/debian/python-facebook

binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs
	dh_installdocs
	dh_installexamples
	dh_python2
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary-arch: build install
	#nothing

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
