\r
Both MacOS and Linux require some extra instructions for development, as you need to prepare an environment. Look below at the proper section to see what is needed.\r
\r
+Fedora\r
+--------\r
+\r
+Fedora builds Cura by using ```mock```, thereby enabling it to build RPMs for\r
+every distribution that ```mock``` has a configuration file for. In pratice\r
+this means that Fedora can build RPMs for several versions of Fedora, CentOS\r
+and RHEL.\r
+\r
+Cura can be built under a regular user account, there is no need to have root\r
+privileges. In fact, having root privileges is very much discouraged.\r
+\r
+However, the user account under which the build is performed needs to be a\r
+member of the 'mock' group. This is accomplished as follows:\r
+\r
+```bash\r
+sudo usermod -a -G mock "$(whoami)"\r
+```\r
+\r
+To install the software that is required to build Cura, run the following\r
+commands:\r
+\r
+```bash\r
+sudo yum install -y git rpmdevtools rpm-build mock arduino\r
+\r
+# Ensure that the Arduino tools can be found by the build\r
+sudo mkdir -p /usr/share/arduino/hardware/tools/avr\r
+sudo ln -sf /usr/bin /usr/share/arduino/hardware/tools/avr/bin\r
+\r
+```\r
+\r
+To build and install Cura, run the following commands:\r
+\r
+```bash\r
+# Get the Cura software, only required once\r
+git clone https://github.com/daid/Cura.git Cura\r
+\r
+# Build for the current system\r
+cd Cura\r
+./package.sh fedora\r
+\r
+# Install on the current system\r
+sudo yum localinstall -y scripts/linux/fedora/RPMS/Cura-*.rpm\r
+```\r
+\r
+Examples of building other configurations:\r
+\r
+```bash\r
+# Build for Fedora rawhide x86-64 and i386\r
+./package.sh fedora fedora-rawhide-x86_64.cfg fedora-rawhide-i386.cfg\r
+\r
+# Since only the basename of the mock configurations is used, this also works:\r
+./package.sh fedora /etc/mock/fedora-21-x86_64.cfg /etc/mock/fedora-rawhide-i386.cfg\r
+```\r
+\r
Debian and Ubuntu Linux\r
--------\r
\r
echo "$0 debian_armhf"
echo "$0 darwin"
echo "$0 freebsd"
+ echo "$0 fedora # current system"
+ echo "$0 fedora \"mock_config_file\" ... # different system(s)"
exit 0
fi
exit 1
fi
+
#Build the Ultimaker Original firmwares.
gitClone git@github.com:Ultimaker/Marlin.git _UltimakerMarlin
cd _UltimakerMarlin/Marlin
exit
fi
+#############################
+# Fedora Generic
+#############################
+
+function sanitiseVersion() {
+ local _version="$1"
+ echo "${_version//-/.}"
+}
+
+function fedoraCreateSRPM() {
+ local _curaName="$1"
+ local _version="$(sanitiseVersion "$2")"
+ local _srcSpecFile="$3"
+ local _srcSpecFileRelease="$4"
+ local _dstSrpmDir="$5"
+
+ local _dstTarSources="$HOME/rpmbuild/SOURCES/$_curaName-$_version.tar.gz"
+ local _dstSpec="$HOME/rpmbuild/SPECS/$_curaName-$_version.spec"
+
+ local _namePower="Power"
+ local _nameCuraEngine="CuraEngine"
+
+ gitClone "https://github.com/GreatFruitOmsk/Power" "$_namePower"
+ gitClone "$CURA_ENGINE_REPO" "$_nameCuraEngine"
+
+ cd "$_namePower"
+ local _gitPower="$(git rev-list -1 HEAD)"
+ cd -
+
+ cd "$_nameCuraEngine"
+ local _gitCuraEngine="$(git rev-list -1 HEAD)"
+ cd -
+
+ local _gitCura="$(git rev-list -1 HEAD)"
+
+ rpmdev-setuptree
+
+ rm -fv "$_dstTarSources"
+ tar \
+ --exclude-vcs \
+ --transform "s#^#$_curaName-$_version/#" \
+ -zcvf "$_dstTarSources" \
+ "$_nameCuraEngine" \
+ "$_namePower" \
+ Cura \
+ resources \
+ plugins \
+ scripts/linux/cura.py \
+ scripts/linux/fedora/usr
+
+ sed \
+ -e "s#__curaName__#$_curaName#" \
+ -e "s#__version__#$_version#" \
+ -e "s#__gitCura__#$_gitCura#" \
+ -e "s#__gitCuraEngine__#$_gitCuraEngine#" \
+ -e "s#__gitPower__#$_gitPower#" \
+ -e "s#__basedir__#scripts/linux/fedora#" \
+ "$_srcSpecFile" \
+ > "$_dstSpec"
+
+ rpmbuild -bs "$_dstSpec"
+
+ mkdir -pv "$_dstSrpmDir"
+ cp -v \
+ "$HOME/rpmbuild/SRPMS/$_curaName-$_version-$_srcSpecFileRelease.src.rpm" \
+ "$_dstSrpmDir"
+}
+
+function buildFedora() {
+ local _nameForRpm="Cura"
+ local _versionForRpm="$(sanitiseVersion "$BUILD_NAME")"
+
+ #
+ # SRPM
+ #
+
+ local _srcSpecFile="scripts/linux/fedora/rpm.spec"
+ local _srcSpecFileRelease="$(rpmspec -P "$_srcSpecFile" | grep -E '^Release:'|awk '{print $NF}')"
+ local _dstSrpmDir="scripts/linux/fedora/SRPMS"
+
+ fedoraCreateSRPM \
+ "$_nameForRpm" \
+ "$_versionForRpm" \
+ "$_srcSpecFile" \
+ "$_srcSpecFileRelease" \
+ "$_dstSrpmDir"
+
+ #
+ # RPM
+ #
+
+ local _srpmFile="$_dstSrpmDir/$_nameForRpm-$_versionForRpm-$_srcSpecFileRelease.src.rpm"
+ local _dstRpmDir="scripts/linux/fedora/RPMS"
+
+ while [ $# -ne 0 ]; do
+ local _mockRelease="$(basename "${1%\.cfg}")"
+ local _mockReleaseArg=""
+ if [ -n "$_mockRelease" ]; then
+ _mockReleaseArg="-r $_mockRelease"
+ fi
+
+ mkdir -pv "$_dstRpmDir/$_mockRelease"
+ mock \
+ $_mockReleaseArg \
+ --resultdir="$_dstRpmDir/$_mockRelease" \
+ "$_srpmFile"
+
+ shift 1
+ done
+}
+
+#############################
+# Fedora RPMs
+#############################
+
+if [ "$BUILD_TARGET" = "fedora" ]; then
+ shift 1 # skip "fedora" arg
+
+ if [ $# -eq 0 ]; then
+ "$0" "$BUILD_TARGET" ""
+ else
+ buildFedora "${@}"
+ fi
+
+ exit
+fi
+
#############################
# Rest
#############################
--- /dev/null
+/RPMS/
+/SRPMS/
--- /dev/null
+%global _curaName __curaName__
+%global _baseDir __basedir__
+%global _version __version__
+%global _gitCura __gitCura__
+%global _gitCuraEngine __gitCuraEngine__
+%global _gitPower __gitPower__
+
+
+Name: %{_curaName}
+Version: %{_version}
+Release: 1%{?dist}
+Summary: 3D printing software aimed at RepRaps and the Ultimaker
+Group: Applications/Engineering
+
+License: GPLv2+
+URL: https://github.com/daid/Cura.git
+Source0: %{_curaName}-%{_version}.tar.gz
+
+BuildRequires: libstdc++-static, glibc-static
+Requires: wxPython, curl
+Requires: python3-setuptools >= 0.6.34
+Requires: python3-PyOpenGL >= 3.0.2, PyOpenGL >= 3.0.2
+Requires: python3-pyserial >= 2.6, pyserial >= 2.6
+Requires: python3-numpy >= 1.6.2, numpy >= 1.6.2
+Requires: python3-power >= 1.2
+
+
+%description
+%{_curaName} is a full software solution for 3D printing, aimed at RepRaps and
+the Ultimaker.
+
+It's free software payed for and maintained by Ultimaker.
+
+
+%prep
+%setup -q -n %{name}-%{version}
+
+
+%build
+make -C CuraEngine VERSION=%{_version}
+
+dstDir="%{_baseDir}/usr/share/cura"
+
+rm -frv "$dstDir"
+mkdir -pv "$dstDir"
+
+cp -av -t "$dstDir" \
+ Cura \
+ resources \
+ plugins \
+ CuraEngine/build/CuraEngine \
+ Power/power \
+ scripts/linux/cura.py
+
+echo "%{_version}" > "$dstDir/Cura/version"
+cat > "$dstDir/Cura/versions" << EOF
+# Git SHAs of software used to build %{_curaName}
+Cura : %{_gitCura}
+CuraEngine : %{_gitCuraEngine}
+Power : %{_gitPower}
+EOF
+
+
+%install
+mkdir -pv "%{buildroot}"
+cp -av -t "%{buildroot}" "%{_baseDir}/usr"
+
+
+%files
+%defattr(-,root,root)
+%{_bindir}/cura
+%attr(644, root, root) %{_datarootdir}/applications/cura.desktop
+%attr(755, root, root) %{_datarootdir}/cura/Cura/cura.py
+%attr(755, root, root) %{_datarootdir}/cura/Cura/util/pymclevel/mce.py
+%attr(755, root, root) %{_datarootdir}/cura/CuraEngine
+%attr(755, root, root) %{_datarootdir}/cura/cura.py
+%{_datarootdir}/cura
+
+
+%changelog
+* Wed Jan 14 2015 Ferry Huberts <ferry.huberts@pelagic.nl>
+- Initial packaging, currently at version 15.01.RC7
--- /dev/null
+#!/bin/sh
+PYTHONPATH=$PYTHONPATH:/usr/share/cura/ /usr/bin/python /usr/share/cura/cura.py "$@"
--- /dev/null
+[Desktop Entry]
+Type=Application
+Name=Cura
+Comment=Cura
+Icon=/usr/share/cura/resources/images/c.png
+Exec=/usr/bin/python /usr/share/cura/cura.py
+Path=/usr/share/cura/
+StartupNotify=true
+Terminal=false
+Categories=Graphics;3DGraphics;Engineering;Development;