#! /usr/bin/make -f
# debhelper rules for os-prober
# (C) 2004 Joshua Kwan <joshk@triplehelix.org>

%:
	dh $@

ARCH=$(shell dpkg-architecture -qDEB_HOST_ARCH)
ifneq (,$(findstring :$(ARCH):,:i386:amd64:lpia:))
ARCH=x86
endif

override_dh_install:
	dh_install
	for probes in os-probes os-probes/mounted os-probes/init \
	              linux-boot-probes linux-boot-probes/mounted; do \
		dh_install $$probes/common/* usr/lib/$$probes; \
		if [ -e "$$probes/$(ARCH)" ]; then \
			dh_install $$probes/$(ARCH)/* usr/lib/$$probes; \
		fi; \
	done
ifeq ($(ARCH),x86)
	dh_install os-probes/mounted/powerpc/20macosx usr/lib/os-probes/mounted
endif
	cp -a debian/os-prober-udeb/usr/lib debian/os-prober/usr/
