#!/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 = debian
DEST_MAIN = debian/yandex-du-release-shell-c

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 -T $(SVN_ROOT)/release-action.pl $(DEST_MAIN)/usr/local/bin/release-action.pl
	install -T $(SVN_ROOT)/release-shell-rc.sh     $(DEST_MAIN)/usr/local/bin/release-shell-rc.sh
	install -T $(SVN_ROOT)/tracker-limtest.pl     $(DEST_MAIN)/usr/local/bin/tracker-limtest.pl
	install -T $(SVN_ROOT)/get-release-components.pl     $(DEST_MAIN)/usr/local/bin/get-release-components.pl
	install -T $(SVN_ROOT)/release-beta-up.sh     $(DEST_MAIN)/usr/local/bin/release-beta-up.sh

	install -d $(DEST_MAIN)/usr/share/perl5/
	rsync -a --delete --exclude="packages" --exclude=".svn" $(SVN_ROOT)/Release/ $(DEST_MAIN)/usr/share/perl5/Release/

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

.PHONY: build clean install
