#!/usr/bin/make -f

udeb_libnl=libnl-3-200-udeb
udeb_libnl_genl=libnl-genl-3-200-udeb

TG_BRANCHES := debian/etc-libnl-3,debian/out-of-tree,debian/no-symvers

# If the file doesn't exist, the include messes with the default dh rule
ifneq "$(wildcard /usr/share/topgit/tg2quilt.mk)" ""
-include /usr/share/topgit/tg2quilt.mk
endif

# to export the patch series use
#	debian/rules tg-clean
#	debian/rules tg-export


# FIXME: not honoured
# CFLAGS += $(if $(findstring udeb,$(cdbs_make_curflavor)),-Os)


DEB_CONFIGURE_EXTRA_FLAGS += --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH)


export DEB_BUILD_MAINT_OPTIONS=hardening=+all

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- $(DEB_CONFIGURE_EXTRA_FLAGS)

override_dh_makeshlibs:
	dh_makeshlibs -plibnl-3-200  --add-udeb=$(udeb_libnl)
	dh_makeshlibs -plibnl-genl-3-200  --add-udeb=$(udeb_libnl_genl)
	dh_makeshlibs -a --remaining-packages

override_dh_gencontrol:
	dh_gencontrol -plibnl-3-200-udeb  -- -Vmisc:Depends=
	dh_gencontrol -plibnl-genl-3-200-udeb  -- -Vmisc:Depends=
	dh_gencontrol -a --remaining-packages
