#!/usr/bin/make -f

include /usr/share/dpkg/architecture.mk

export DEB_BUILD_MAINT_OPTIONS=hardening=+all
export PYBUILD_NAME=backports.zstd

# Use Debian's zstd library
export PYBUILD_BUILD_ARGS = --config-setting="--build-option=--system-zstd"

# These test requires installation to system before testing
DISABLE_TESTS =
DISABLE_TESTS +=     not test_bad_use
DISABLE_TESTS += and not test_create_command
DISABLE_TESTS += and not test_create_command_compressed
DISABLE_TESTS += and not test_create_command_dot_started_filename
DISABLE_TESTS += and not test_create_command_dotless_filename
DISABLE_TESTS += and not test_extract_command
DISABLE_TESTS += and not test_extract_command_different_directory
DISABLE_TESTS += and not test_extract_command_invalid_file
DISABLE_TESTS += and not test_list_command_invalid_file
DISABLE_TESTS += and not test_test_command
DISABLE_TESTS += and not test_test_command_invalid_file

# Ignore test failure on Hurd
ifeq ($(DEB_HOST_ARCH_OS),hurd)
DISABLE_TESTS += and not test_realpath_limit_attack
endif

export PYBUILD_TEST_ARGS = -k "$(DISABLE_TESTS)"

%:
	dh $@ --buildsystem=pybuild
