# default to debian
LIBSSL_DEV="libssl1.0-dev"
LIBCURL="libcurl3"

# override for ubuntu
dpkg-vendor --derives-from Ubuntu
if ( test "$?" = "0" )
then
	LIBSSL_DEV="libssl-dev"

	# override for ubuntu versions
	UBUNTU_VERSION=`lsb_release -r | cut -d':' -f2 | sed -e "s|\t||g" -e "s|\.||g"`
	if ( test "$UBUNTU_VERSION" -ge "1804" )
	then
		LIBCURL="libcurl4"
	fi
fi

# update control file
sed \
-e "s|@LIBSSL_DEV@|$LIBSSL_DEV|" \
-e "s|@LIBCURL@|$LIBCURL|" \
control.in > control
