diff --git a/.gitignore b/.gitignore index 266ebc3..2bf209e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ SOURCES/btrd-0.5.2-vendor.tar.gz +SOURCES/btrd-0.5.2.crate diff --git a/.rust-btrd.metadata b/.rust-btrd.metadata index 9c0c3e6..b11ba12 100644 --- a/.rust-btrd.metadata +++ b/.rust-btrd.metadata @@ -1 +1,2 @@ 0e13f1c21917730315d52da015e2f71472ec7c8a SOURCES/btrd-0.5.2-vendor.tar.gz +4a5ec8946614dc51b996d6a70e87d912134b8dcd SOURCES/btrd-0.5.2.crate diff --git a/SOURCES/btrd-0.5.2.crate b/SOURCES/btrd-0.5.2.crate deleted file mode 100644 index 5b22e6d..0000000 Binary files a/SOURCES/btrd-0.5.2.crate and /dev/null differ diff --git a/SOURCES/update-vendor-tarball.sh b/SOURCES/update-vendor-tarball.sh new file mode 100755 index 0000000..16cd73d --- /dev/null +++ b/SOURCES/update-vendor-tarball.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +name='btrd' +specfile="rust-${name}.spec" +version=$(rpm -q --qf '%{VERSION}\n' --specfile "$specfile" | head -1) +nv="${name}-${version}" +crate="${nv}.crate" +vendor_tarball="${nv}-vendor.tar.gz" + +if [ -f "$vendor_tarball" ]; then + echo "${vendor_tarball} already exists, aborting" + exit 1 +fi + +[ -f "$crate" ] || spectool -g "$specfile" +tardir="$PWD" +workdir=$(mktemp -d) +trap 'rm -rf "$workdir"' EXIT + +tar xvzf "$tardir/$crate" -C "$workdir" +(cd "${workdir}/${nv}" && \ + cargo vendor && \ + tar cvzf "${tardir}/${vendor_tarball}" vendor/) + +exit 0