aimylios / rpms / calibre

Forked from rpms/calibre 4 years ago
Clone
fea7039
#!/bin/sh -e
fea7039
fea7039
# Usage: ./getsources.sh [version]
fea7039
#     (this produces calibre-[version]-nofonts.tar.xz)
fea7039
if [ -n "$1" ]; then
fea7039
    version="$1"
fea7039
else
fea7039
    version="$(awk '/^Version:/{print $2}' *.spec)"
fea7039
fi
fea7039
fea7039
fname="calibre-${version}-nofonts.tar.xz"
fea7039
if [ -e "$fname" ]; then
fea7039
    echo "$fname already exists, not downloading"
fea7039
    exit 0
fea7039
fi
fea7039
fea7039
echo "Downloading version ${version}"
fea7039
[ -x /bin/pxz ] && xz=pxz || xz=xz
fea7039
fea7039
curl -sSL http://code.calibre-ebook.com/dist/src | \
fea7039
    xzcat | \
fea7039
    tar --delete --wildcards -f - '*/fonts/liberation/*' | \
fea7039
    $xz -9v > "$fname"
fea7039
fea7039
echo "$fname is ready"