#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#DH_VERBOSE = 1

# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk

# see FEATURE AREAS in dpkg-buildflags(1)
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
#export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

OPENSSL_ENGINE_DIR=$(shell openssl version -e |sed -e 's/^[^.]*"//' -e 's/".*$$//')
# main packaging script based on dh7 syntax
%:
	dh $@ 

# debmake generated override targets
# This is example for Cmake (See http://bugs.debian.org/641051 )
#override_dh_auto_configure:
#	dh_auto_configure -- \
#	-DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)
override_dh_install:
	install -d -m 755 $(CURDIR)/debian/libengine-gost-openssl1.1/$(OPENSSL_ENGINE_DIR)
	install -d -m 755 $(CURDIR)/debian/gostsum/usr/bin
	install -d -m 755 $(CURDIR)/debian/gostsum/usr/share/man/man1
	install -m 755 bin/gost.so $(CURDIR)/debian/libengine-gost-openssl1.1/$(OPENSSL_ENGINE_DIR)
	install -m 755 bin/gostsum $(CURDIR)/debian/gostsum/usr/bin
	install -m 755 bin/gost12sum $(CURDIR)/debian/gostsum/usr/bin
	install -m 644 gostsum.1 $(CURDIR)/debian/gostsum/usr/share/man/man1
	install -m 644 gost12sum.1 $(CURDIR)/debian/gostsum/usr/share/man/man1
#verride_dh_clean:
#	rm -rf bin debian/debhelper-build-stamp



# Please also look if there are files or directories which have a
# different copyright/license attached and list them here.
# Please avoid to pick license terms that are more restrictive than the
# packaged work, as it may make Debian's contributions unacceptable upstream.
