#!/bin/bash

set -ex

UPSTREAM_VERSION=$(dpkg-parsechangelog -S Version | cut -f 1 -d -)

rm -rf vendor
cargo vendor

(
  cd vendor
  tar -czf ../../rpds-py_$UPSTREAM_VERSION.orig-vendor.tar.gz *
)

CARGO_VENDOR_DIR=vendor /usr/share/cargo/bin/dh-cargo-vendored-sources
