Blame cura-lulzbot.spec

4090bef
Name:           cura-lulzbot
2b42460
Version:        19.05
2b42460
Release:        1%{?dist}
4090bef
Summary:        Cura LulzBot Edition, 3D printer control software
4090bef
# Code is AGPLv3
4090bef
# Example models are CC-BY-SA
4090bef
License:        AGPLv3 and CC-BY-SA
4090bef
URL:            https://www.lulzbot.com/cura
4090bef
e904ee3
# This is no longer hosted on Github :(
e904ee3
# So I did:
e904ee3
#  git clone https://code.alephobjects.com/diffusion/CURA/cura.git
e904ee3
#  cd cura
2b42460
#  git checkout lulzbot-19.05
e904ee3
#  git archive --format=tar.gz --prefix=cura-lulzbot-%{version}/ lulzbot-%{version} > ../cura-lulzbot-%{version}.tar.gz
e904ee3
Source0:        %{name}-%{version}.tar.gz
4090bef
Source1:        %{name}
4090bef
Source2:        %{name}.desktop
4090bef
4090bef
# Use system paths and make it parallel installable with cura
4090bef
Patch1:         %{name}-system-paths.patch
4090bef
4090bef
# Rework the logic of determining the version (didn't work)
4090bef
Patch2:         %{name}-version.patch
4090bef
4090bef
# Disable installation of firmwares Fedora doesn't ship
4090bef
Patch3:         %{name}-no-firmware.patch
4090bef
e5e577e
# Open directories with xdg-open
e5e577e
# https://bugzilla.redhat.com/show_bug.cgi?id=1217961
e5e577e
Patch4:         %{name}-xdg-open.patch
e5e577e
4090bef
BuildArch:      noarch
4090bef
BuildRequires:  python2-devel
4090bef
BuildRequires:  dos2unix
4090bef
BuildRequires:  desktop-file-utils
4090bef
BuildRequires:  gettext
4090bef
Requires:       PyOpenGL
4090bef
Requires:       wxPython
4090bef
Requires:       pyserial
4090bef
Requires:       numpy
4090bef
Requires:       python-power
45bbe1c
Requires:       CuraEngine >= 15.04
2b42460
# So that it just works
2b42460
Requires:	3dprinter-udev-rules
4090bef
4090bef
%description
4090bef
The default software for the LulzBot Mini 3D printer is called Cura LulzBot
4090bef
Edition. Cura is a Free Software program that both prepares your files for
4090bef
printing (by converting your model into GCODE), and also allows you to control
4090bef
the operation of your LulzBot 3D printer.
4090bef
4090bef
4090bef
%prep
e904ee3
%setup -q
4090bef
%patch1 -p1
4090bef
%patch2 -p1
04dfabd
%patch3 -p1 -b .nofw
e5e577e
%patch4 -p1
4090bef
45bbe1c
# invalid locale not able to compile
45bbe1c
rm resources/locale/zh -rf
45bbe1c
4090bef
dos2unix resources/example/Attribution.txt
4090bef
e904ee3
sed -i 's/REPLACE_THIS_IN_SPEC/%{version}/' Cura/util/version.py
4090bef
4090bef
# remove shebang
4090bef
sed -i '1d' Cura/cura.py
4090bef
sed -i '1d' Cura/util/pymclevel/mce.py
4090bef
4090bef
# Remove firmware
4090bef
rm resources/firmware/*
4090bef
4090bef
# Rename icon
4090bef
mv resources/cura{,-lulzbot}.ico
4090bef
4090bef
# Relocate imports - don't write patch for this, as this sed needs no rebasing ;)
4090bef
find -name \*.py -exec sed -i \
4090bef
  -e 's/from Cura import/from CuraLulzbot import/g' \
4090bef
  -e 's/from Cura\./from CuraLulzbot./g' \
1b93c64
  -e 's/Cura.serialCommunication/CuraLulzbot.serialCommunication/g' \
4090bef
  -e 's/import Cura/import CuraLulzbot/g' {} \;
4090bef
4090bef
%build
4090bef
# rebuild locales
4090bef
cd resources/locale
4090bef
mv po pl # polish code was wrong
4090bef
rm *.in *.pot
4090bef
for FILE in *; do
4090bef
  rm $FILE/LC_MESSAGES/Cura.mo
4090bef
  msgfmt $FILE/LC_MESSAGES/Cura.po -o $FILE/LC_MESSAGES/CuraLulzbot.mo
4090bef
  rm $FILE/LC_MESSAGES/Cura.po
4090bef
done
4090bef
cd -
4090bef
4090bef
%install
4090bef
mkdir -p %{buildroot}%{python_sitelib}/CuraLulzbot
4090bef
mkdir -p %{buildroot}%{_datadir}/%{name}
4090bef
mkdir -p %{buildroot}%{_datadir}/pixmaps
4090bef
mkdir -p %{buildroot}%{_datadir}/locale
4090bef
mkdir -p %{buildroot}%{_bindir}
4090bef
4090bef
cp -apr Cura/* %{buildroot}%{python_sitelib}/CuraLulzbot
4090bef
rm -rf %{buildroot}%{python_sitelib}/CuraLulzbot/LICENSE
4090bef
cp -apr resources/* %{buildroot}%{_datadir}/%{name}
4090bef
cp -apr plugins %{buildroot}%{_datadir}/%{name}
4090bef
cp -ap %{SOURCE1} %{buildroot}%{_bindir}
4090bef
ln -s %{_datadir}/%{name} %{buildroot}%{python_sitelib}/CuraLulzbot/resources
4090bef
ln -s %{_datadir}/%{name}/%{name}.ico %{buildroot}%{_datadir}/pixmaps
4090bef
4090bef
# locales
4090bef
cp -ar %{buildroot}%{_datadir}/%{name}/locale/* %{buildroot}%{_datadir}/locale
4090bef
rm -rf %{buildroot}%{_datadir}/%{name}/locale
4090bef
ln -s -f %{_datadir}/locale/ %{buildroot}%{_datadir}/%{name}/ # the app expects the locale folder in here
4090bef
4090bef
desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE2}
4090bef
4090bef
%{find_lang} CuraLulzbot
4090bef
4090bef
%files -f CuraLulzbot.lang
4090bef
%license Cura/LICENSE resources/example/Attribution.txt
4090bef
%{python_sitelib}/CuraLulzbot
4090bef
%{_datadir}/%{name}
4090bef
%{_datadir}/pixmaps/%{name}.ico
4090bef
%{_datadir}/applications/%{name}.desktop
4090bef
%{_bindir}/%{name}
4090bef
4090bef
%changelog
2b42460
* Fri Mar 18 2016 Tom Callaway <spot@fedoraproject.org> - 19.05-1
2b42460
- update to 19.05
2b42460
50d579d
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 19.01-2
50d579d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
50d579d
04dfabd
* Fri Jan 08 2016 Tom Callaway <spot@fedoraproject.org> - 19.01-1
04dfabd
- update to 19.01
04dfabd
e904ee3
* Sun Oct 04 2015 Miro Hrončok <mhroncok@redhat.com> - 17.10-1
e904ee3
- Update to 17.10 (different version scheme, but forwarding, no need for epoch)
e904ee3
- No longer hosted on Github
e904ee3
- Remove merged patches
e904ee3
e953866
* Wed Jul 08 2015 Miro Hrončok <mhroncok@redhat.com> - 15.02.1.1.03-3
e953866
- No longer depend on pypy
c37376a
- Simplify the launcher
e953866
44034f6
* Wed Jul 08 2015 Miro Hrončok <mhroncok@redhat.com> - 15.02.1.1.03-2
44034f6
- Fix endless loop of wizards (#1231624)
0f200e3
- Fix version string in version.py
44034f6
45bbe1c
* Mon Jul 06 2015 Miro Hrončok <mhroncok@redhat.com> - 15.02.1.1.03-1
45bbe1c
- Update to 15.02.1-1.03
45bbe1c
aa7a075
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 14.12-6
aa7a075
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
aa7a075
e5e577e
* Fri May 29 2015 Miro Hrončok <mhroncok@redhat.com> - 14.12-5
e5e577e
- Patch: Open directories with xdg-open (#1217961)
e5e577e
c5fe418
* Mon Apr 20 2015 Miro Hrončok <mhroncok@redhat.com> - 14.12-4
c5fe418
- Handle files from the command line (#1213220)
c5fe418
812839c
* Wed Apr 01 2015 Miro Hrončok <mhroncok@redhat.com> - 14.12-3
812839c
- Update the no firmware patch according to communication with Cura upstream
812839c
1b93c64
* Wed Mar 25 2015 Tom Callaway <spot@fedoraproject.org> - 14.12-2
1b93c64
- fix one missing CuraLulzbot invoke
1b93c64
4090bef
* Wed Feb 04 2015 Miro Hrončok <mhroncok@redhat.com> - 14.12-1
4090bef
- Initial package (started as cura.spec fork)
4090bef