File cura1-lulzbot.spec of Package cura1-lulzbot

#
# spec file for package cura1-lulzbot
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2015 Ferry Huberts
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%global _curaName      Cura
%global _baseDir       scripts/linux/fedora

Name:           cura1-lulzbot
Version:        21.06
Release:        1%{?dist}
Summary:        3D printing software aimed at RepRaps, Ultimaker and LulzBot
License:        AGPL-3.0+
Group:          Applications/Engineering

Url:            https://code.alephobjects.com/diffusion/CURA/
Source0:        lulzbot-%{version}.tar.gz
Source1:        curaengine-14.03.tar.xz
Patch1:         dynamic-linking.patch

%if 0%{?suse_version}
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  glibc-devel
Requires:       python-numpy >= 1.6.2
Requires:       python-opengl >= 3.0.2
Requires:       python-pyserial >= 2.6
%else
BuildRequires:  glibc
BuildRequires:  libstdc++
Requires:       PyOpenGL >= 3.0.2
Requires:       numpy >= 1.6.2
Requires:       pyserial >= 2.6
%endif
Requires:       curl
Requires:       libglut3
Requires:       python-power >= 1.2
Requires:       wxPython >= 3.0.0

%description
%{_curaName} is a software solution for 3D printing, aimed at RepRaps,
the Ultimaker and LulzBot. This package comes with its own version of CuraEngine.

This is the fork from AlephObjects to support also LulzBot printers.

%prep
%setup -q -n Cura-lulzbot-%{version} -a 1
mv curaengine-* CuraEngine
cd CuraEngine
%patch1 -p1

%build
make -C CuraEngine VERSION=%{version}

# move to arch dependend dir for CuraEngine and to avoid conflicts with cura 2
dstDir="%{_baseDir}%{_libdir}/cura1-lulzbot"
sed -i -e 's,/usr/share/cura/,%{_libdir}/cura1-lulzbot/,g' scripts/linux/fedora/usr/bin/cura
sed -i -e 's,/usr/share/cura/,%{_libdir}/cura1-lulzbot/,g' scripts/linux/fedora/usr/share/applications/cura.desktop

rm    -frv "$dstDir"
mkdir -pv  "$dstDir"

cp -av -t  "$dstDir" \
  Cura \
  resources \
  plugins \
  CuraEngine/build/CuraEngine \
  scripts/linux/cura.py

%install
mkdir -pv "%{buildroot}"
cp -av -t "%{buildroot}" "%{_baseDir}/usr"
rm "%{buildroot}/usr/share/.gitignore"
mv "%{buildroot}/usr/bin/cura" "%{buildroot}/usr/bin/cura1-lulzbot"
mv "%{buildroot}/usr/share/applications/cura.desktop" "%{buildroot}/usr/share/applications/cura1-lulzbot.desktop"

sed -i -e 's,^Categories=.*,Categories=Education;Engineering;,' \
       -e 's,^Icon=.*,Icon=%_libdir/cura1-lulzbot/resources/images/c.png,' \
  %{buildroot}/usr/share/applications/cura1-lulzbot.desktop
%if 0%{?suse_version}
%fdupes -s %{buildroot}%{_libdir}
%endif

%{find_lang} Cura

%files -f Cura.lang
%doc LICENSE README.md
%{_bindir}/cura1-lulzbot
%attr(644, root, root) %{_datarootdir}/applications/cura1-lulzbot.desktop
%attr(755, root, root) %{_libdir}/cura1-lulzbot/Cura/cura.py
%attr(755, root, root) %{_libdir}/cura1-lulzbot/Cura/util/pymclevel/mce.py
%attr(755, root, root) %{_libdir}/cura1-lulzbot/CuraEngine
%attr(755, root, root) %{_libdir}/cura1-lulzbot/cura.py
%{_libdir}/cura1-lulzbot

%changelog
openSUSE Build Service is sponsored by