#!/usr/bin/make -f

#export DH_VERBOSE = 1
export GEM2DEB_TEST_RUNNER = --check-dependencies
#export DH_RUBY = --gem-install

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

override_dh_install:
	dh_install
	mv $(CURDIR)/debian/ruby-http-parser/usr/share/rubygems-integration/2.5.0 \
	   $(CURDIR)/debian/ruby-http-parser/usr/share/rubygems-integration/all
	mkdir -p $(CURDIR)/debian/ruby-http-parser/usr/lib/`ruby -e 'puts RbConfig::CONFIG["arch"]'`/ruby/vendor_ruby/
	find ext/ -name "libhttp-parser-ext.so" -exec cp "{}" $(CURDIR)/debian/ruby-http-parser/usr/lib/`ruby -e 'puts RbConfig::CONFIG["arch"]'`/ruby/vendor_ruby/ ";"
