#!/usr/bin/make -f

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

DEB_DEFAULT_CONFIG_OPTIONS ?= --enable-shared=yes \
                              --enable-static=yes \
                              --enable-bsdtar=shared \
                              --enable-bsdcpio=shared \
                              --enable-xattr \
                              --enable-acl \
                              --enable-largefile \
                              --with-pic \
                              --with-zlib \
                              --with-bz2lib \
                              --without-lzmadec \
                              --with-lzma \
                              --without-openssl \
                              --with-xml2 \
                              --without-expat

%:
	dh $@ --parallel

override_dh_auto_configure:
	dh_auto_configure -- $(DEB_DEFAULT_CONFIG_OPTIONS)

# see debian bug #418637 and libarchive1.lintian-overrides
override_dh_link:
	dh_link -plibarchive1 usr/lib/$(DEB_HOST_MULTIARCH)/libarchive.so.2 \
		usr/lib/$(DEB_HOST_MULTIARCH)/libarchive.so.1
