#!/usr/bin/make -f

PYVERSION = $(shell pyversions -v -r | tr -d . )

CONFIGUREFLAGS = \
  --enable-static \
  --enable-shared \
  --disable-debug \
  --with-logging=none \
  --with-dht=on \
  --with-encryption=on \
  --with-ssl \
  --with-zlib=system \
  --with-libgeoip=system \
  --disable-examples \
  --disable-tests \
  --enable-python-binding \
  --with-boost-python=boost_python-mt-py$(PYVERSION)

%:
	dh $@

override_dh_auto_configure:
	# generate html docs
	(cd docs/ && $(MAKE) -f makefile)
	dh_auto_configure -- PTHREAD_LIBS="-lpthread" CFLAGS="$(CFLAGS)" \
		PYTHON_INSTALL_PARAMS="--root=$(CURDIR)/debian/tmp --install-layout=deb" \
		LDFLAGS="-Wl,--as-needed -lrt" $(CONFIGUREFLAGS)

override_dh_compress:
	dh_compress -Xcpp

override_dh_strip:
	dh_strip -a --dbg-package=libtorrent-rasterbar-dbg

override_dh_makeshlibs:
	dh_makeshlibs -a -V
