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

# 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

SVN_ROOT ?= ../svnroot
DEST = $(PWD)/debian
DEST_MAIN = $(DEST)/yandex-du-zk-delivery

build:
	echo nop

binary: install
	echo nop

clean:
	dh_testdir
	dh_testroot
	dh_clean
	rm -f build-arch-stamp build-indep-stamp #CONFIGURE-STAMP#

	# Add here commands to clean up after the build process.
	-$(MAKE) clean

	dh_clean

install:
	dh_testdir
	dh_testroot
	dh_clean -k -i
	dh_installdirs
	dh_installcron

	# main
	#install -d $(DEST_MAIN)/opt/yandex-du-zk-delivery/
	#rsync -a --delete --exclude="packages" --exclude=".svn" $(SVN_ROOT)/ $(DEST_MAIN)/opt/yandex-du-zk-delivery/
	cd $(SVN_ROOT); ./setup.py install --force --root=$(DEST_MAIN)/ --install-scripts=/usr/local/bin
	#install -T $(SVN_ROOT)/zk-delivery $(DEST_MAIN)/usr/local/bin/zk-delivery
	#install -T $(SVN_ROOT)/zk-delivery-set $(DEST_MAIN)/usr/local/bin/zk-delivery-set
	#install -T $(SVN_ROOT)/zk-delivery-get $(DEST_MAIN)/usr/local/bin/zk-delivery-get

	#dh_makeshlibs
	dh_installdeb
	#dh_shlibdeps
	dh_gencontrol -- -v`cat debian/version`
	dh_md5sums
	dh_builddeb

.PHONY: build clean install
