Blob Blame History Raw
#!/bin/bash

VERSION="$1"

wget "https://github.com/daid/Cura/archive/$VERSION.tar.gz" || exit 1

tar -xzf "Cura-$VERSION.tar.gz" || exit 1
cd "Cura-$VERSION"

# not needed
rm -rf scripts

# Remove CC BY-NC content
# It cannot be shipped with/in Fedora, as it has use restrictions 
rm -f resources/meshes/*
rm -f resources/example/UltimakerRobot_support.stl

# Remove binary locales
rm -f resources/locale/*/LC_MESSAGES/*.mo

# Drop the note about the removal
echo -e '\n\nPlease note, that files under the terms of CC BY-NC has been removed form this Fedora package for legal reasons.' >> resources/example/Attribution.txt

# Use free UltimakerHandle.stl instead of UltimakerRobot_support.stl
FILES=`grep -Ir "UltimakerRobot_support.stl" . | cut -f1 -d: | sort | uniq | grep -v Attribution.txt | tr '\n' ' '`
sed -i 's/UltimakerRobot_support.stl/UltimakerHandle.stl/g' $FILES

# Remove the firmware
# It is binary, so it is prohibited in Fedora
rm -rf resources/firmware

cd ..
# rm -f "$VERSION.tar.gz"
tar -czf Cura-$VERSION-fedora.tar.gz "Cura-$VERSION"