07a9f8f
#!/bin/bash
07a9f8f
fe4da9f
VERSION="$1"
07a9f8f
fe4da9f
wget "https://github.com/daid/Cura/archive/$VERSION.tar.gz" || exit 1
07a9f8f
2dfa411
tar -xzf "Cura-$VERSION.tar.gz" || exit 1
fe4da9f
cd "Cura-$VERSION"
07a9f8f
fe4da9f
# not needed
fe4da9f
rm -rf scripts
07a9f8f
07a9f8f
# Remove CC BY-NC content
07a9f8f
# It cannot be shipped with/in Fedora, as it has use restrictions 
07a9f8f
rm -f resources/meshes/*
07a9f8f
rm -f resources/example/UltimakerRobot_support.stl
07a9f8f
2dfa411
# Remove binary locales
2dfa411
rm -f resources/locale/*/LC_MESSAGES/*.mo
2dfa411
07a9f8f
# Drop the note about the removal
07a9f8f
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
07a9f8f
07a9f8f
# Use free UltimakerHandle.stl instead of UltimakerRobot_support.stl
07a9f8f
FILES=`grep -Ir "UltimakerRobot_support.stl" . | cut -f1 -d: | sort | uniq | grep -v Attribution.txt | tr '\n' ' '`
07a9f8f
sed -i 's/UltimakerRobot_support.stl/UltimakerHandle.stl/g' $FILES
07a9f8f
07a9f8f
# Remove the firmware
07a9f8f
# It is binary, so it is prohibited in Fedora
07a9f8f
rm -rf resources/firmware
07a9f8f
2dfa411
cd ..
2dfa411
# rm -f "$VERSION.tar.gz"
fe4da9f
tar -czf Cura-$VERSION-fedora.tar.gz "Cura-$VERSION"