#!/usr/bin/make -f

export GEM2DEB_TEST_RUNNER = --check-dependencies

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

# We are renaming aws to ruby-aws and then cleaning up after the gem is installed
override_dh_auto_install:
	mkdir -p $(CURDIR)/lib/ruby-aws
	cp $(CURDIR)/lib/version.rb $(CURDIR)/lib/ruby-aws
	mv $(CURDIR)/lib/version.rb $(CURDIR)/debian
	mv $(CURDIR)/lib/aws.rb $(CURDIR)/lib/ruby-aws.rb
	dh_auto_install
	mv $(CURDIR)/lib/ruby-aws.rb $(CURDIR)/lib/aws.rb

clean:
	mkdir -p $(CURDIR)/lib/ruby-aws
	if [ -f $(CURDIR)/debian/version.rb ]; then mv $(CURDIR)/debian/version.rb $(CURDIR)/lib; fi
	cp -f $(CURDIR)/lib/version.rb $(CURDIR)/lib/ruby-aws
	dh_clean
	rm -rf lib/ruby-aws/version.rb
