#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/buildcore.mk
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk
include /usr/share/cdbs/1/rules/patchsys-quilt.mk
include /usr/share/cdbs/1/rules/autoreconf.mk

DEB_CONFIGURE_EXTRA_FLAGS = --enable-experimental --disable-python

# TUN/TAP is almost unsupported on kFreeBSD, so install the corresponding files
# only on Linux.
binary-install/vde2::
	if test "x`uname -s`" = "xLinux"; then \
		dh_install -pvde2 debian/tmp/usr/sbin/vde_tunctl; \
		dh_install -pvde2 debian/tmp/usr/lib/vde2/libvdetap.so; \
		dh_install -pvde2 debian/tmp/usr/lib/vde2/vdetap; \
		dh_installman -pvde2 debian/tmp/usr/share/man/man8/vde_tunctl.8; \
		dh_installman -pvde2 debian/tmp/usr/share/man/man1/vdetaplib.1; \
	fi

binary-install/libvde-dev::
	if test "x`uname -o`" = "xGNU/Linux"; then \
		dh_install -plibvde-dev debian/tmp/usr/lib/vde2/libvdetap.a; \
	fi

install/vde2::
	install -D -m 0755 debian/network/if-pre-up.d/vde2 debian/vde2/etc/network/if-pre-up.d/vde2
	install -D -m 0755 debian/network/if-post-down.d/vde2 debian/vde2/etc/network/if-post-down.d/vde2