#!/usr/bin/make -f

DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

%:
	dh $@ --with autoreconf

override_dh_auto_configure:
	./configure \
			--host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr \
			--libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \
			--mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info \
			--sysconfdir=/etc

override_dh_auto_install:
	dh_auto_install
	mv debian/tmp/usr/bin/proxyresolv debian/libproxychains3/usr/lib/proxychains3/
