#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@

override_dh_install:
	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp

	mv $(CURDIR)/debian/tmp/etc/uptimed.conf-dist \
		$(CURDIR)/debian/tmp/etc/uptimed.conf
	install -D -m 644 $(CURDIR)/libuptimed/urec.h \
		$(CURDIR)/debian/tmp/usr/include/uptimed.h

	$(MAKE) -C libuptimed install DESTDIR=$(CURDIR)/debian/tmp/

	dh_install

override_dh_auto_build:
	dh_auto_build
	LC_ALL=C onsgmls debian/uptimed.conf.sgml | sgmlspl sgmlspl-specs/docbook2man-spec.pl
	mv uptimed.conf.5 debian/
	dh_clean manpage.links manpage.refs
