#! /usr/bin/make -f
%:
	dh $@

ARCH=$(shell dpkg-architecture -qDEB_HOST_ARCH)

SET_CLOCK = 1
# On s390 we're not allowed to change the system clock
ifeq ($(ARCH),s390)
SET_CLOCK = 0
endif
ifeq ($(ARCH),s390x)
SET_CLOCK = 0
endif

RDATE_DEPENDS =
ifneq ($(SET_CLOCK),0)
RDATE_DEPENDS = configured-network, rdate-udeb
endif

override_dh_auto_test:
	sh -n debian/clock-setup.postinst
	sh -n finish-install.d/10clock-setup

override_dh_install:
	dh_install
ifneq ($(SET_CLOCK),0)
	dh_install finish-install.d usr/lib
endif

override_dh_gencontrol:
	dh_gencontrol -- -Vrdate:Depends="$(RDATE_DEPENDS)"
