#!/usr/bin/make -f
#DH_VERBOSE = 1

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_CFLAGS_MAINT_APPEND  = -Wall -Wno-error
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--disable-new-dtags -Wl,--allow-multiple-definition

ifeq ($(DEB_HOST_ARCH),ppc64el)
  export DEB_CFLAGS_MAINT_APPEND += -O2
  export DEB_CFLAGS_MAINT_STRIP += -O3
endif

override_dh_auto_build:
	dh_auto_build
	a2x --doctype=manpage --format manpage --verbose $(CURDIR)/debian/w1find.1.txt
	a2x --doctype=manpage --format manpage --verbose $(CURDIR)/debian/w1retap.1.txt
	a2x --doctype=manpage --format manpage --verbose $(CURDIR)/debian/w1sensors.1.txt

override_dh_auto_install:
	dh_auto_install
	install -D -o root -g root -m 755 docs/w1sensors.rb debian/tmp/usr/bin/w1sensors

override_dh_makeshlibs:
	dh_makeshlibs --noscripts

override_dh_installsystemd:
	dh_installsystemd --no-enable --no-start

%:
	dh $@
