#!/usr/bin/make -f
export PYBUILD_NAME=xrootd
# --install-layout deb

%:
	dh $@ --builddirectory=build --destdir=deb_packages --with python3

override_dh_auto_configure:
	dh_auto_configure -- -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_LIBDIR=lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH) -DPYTHON_EXECUTABLE=/usr/bin/python3 -DPYTHON_LAYOUT=deb -DCMAKE_SKIP_INSTALL_RPATH=ON -DXRDCLHTTP_SUBMODULE=TRUE

override_dh_install:
	install -D -m 644 packaging/common/client.conf deb_packages/etc/xrootd/client.conf
	install -D -m 644 packaging/common/client-plugin.conf.example deb_packages/etc/xrootd/client.plugins.d/client-plugin.conf.example
	install -D -m 644 src/XrdClHttp/config/http.client.conf.example  deb_packages/etc/xrootd/client.plugins.d/xrdcl-http-plugin.conf
	dh_install --sourcedir=deb_packages
