#!/usr/bin/make -f
DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)

ifeq ($(DEB_BUILD_ARCH_OS),linux)
CONFIGURE_FLAGS = --enable-selinux
endif

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- ${CONFIGURE_FLAGS}

override_dh_auto_install:
	dh_auto_install
	if [ -f "debian/psmisc/usr/bin/fuser" ] ; then \
	  mv debian/psmisc/usr/bin/fuser debian/psmisc/bin/fuser ; \
	else \
	  rm -f debian/psmisc/usr/share/man/man1/fuser.1 ; \
	fi
	if [ "$(DEB_HOST_ARCH_OS)" = "kfreebsd" ] ; then \
	  rm -f debian/psmisc/usr/share/man/man1/peekfd.1 ; \
	fi
