#!/bin/sh
# Regenerate nicotine+ tarball without nonfree sound themes (licensed under CC
# Sampling Plus 1.0)
VERSION=$1
SHORT_VERSION=$VERSION
[[ "$VERSION" =~ [a-z0-9]{7,} ]] && SHORT_VERSION=${VERSION:0:7}
SRC_TARBALL=nicotine+-$SHORT_VERSION.tar.gz
DEST_TARBALL=nicotine+-$SHORT_VERSION-without-nonfree-sounds.tar.gz
curl -L -R -O https://github.com/Nicotine-plus/nicotine-plus/archive/$VERSION/$SRC_TARBALL
gunzip <$SRC_TARBALL | tar --delete nicotine-plus-$VERSION/sounds | gzip >$DEST_TARBALL
rm $SRC_TARBALL