#!/usr/bin/make -f

%:
	dh $@ --buildsystem=ruby --with ruby

override_dh_fixperms:
	dh_fixperms
	chmod -x $(CURDIR)/debian/mcollective-common/usr/lib/ruby/vendor_ruby/mcollective/util.rb

override_dh_auto_install:
	cp -R  $(CURDIR)/lib/* $(CURDIR)/debian/mcollective-common/usr/lib/ruby/vendor_ruby/
	cp $(CURDIR)/bin/mco $(CURDIR)/debian/mcollective-client/usr/bin/

override_dh_installinit:
	dh_installinit --error-handler=true --no-enable

override_dh_installchangelogs:
	dh_installchangelogs debian/upstream/changelog/changelog.upstream

override_dh_installman:
	pandoc -s -t man $(CURDIR)/debian/man/mcollectived.md -o $(CURDIR)/debian/man/mcollectived.1
	pandoc -s -t man $(CURDIR)/debian/man/mco.md -o $(CURDIR)/debian/man/mco.1
	dh_installman
