Blame cura-lulzbot.spec

4090bef
Name:           cura-lulzbot
4090bef
Version:        14.12
4090bef
Release:        1%{?dist}
4090bef
Summary:        Cura LulzBot Edition, 3D printer control software
4090bef
4090bef
# Code is AGPLv3
4090bef
# Example models are CC-BY-SA
4090bef
License:        AGPLv3 and CC-BY-SA
4090bef
4090bef
URL:            https://www.lulzbot.com/cura
4090bef
4090bef
Source0:        https://github.com/alephobjects/Cura/archive/lulzbot-%{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
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
4090bef
Requires:       pypy
4090bef
Requires:       CuraEngine >= 14.12.1
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
4090bef
%setup -qn Cura-lulzbot-%{version}
4090bef
%patch1 -p1
4090bef
%patch2 -p1
4090bef
%patch3 -p1
4090bef
4090bef
dos2unix resources/example/Attribution.txt
4090bef
4090bef
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' \
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
%doc changelog
4090bef
%{python_sitelib}/CuraLulzbot
4090bef
%{_datadir}/%{name}
4090bef
%{_datadir}/pixmaps/%{name}.ico
4090bef
%{_datadir}/applications/%{name}.desktop
4090bef
%{_bindir}/%{name}
4090bef
4090bef
%changelog
4090bef
* Wed Feb 04 2015 Miro HronĨok <mhroncok@redhat.com> - 14.12-1
4090bef
- Initial package (started as cura.spec fork)
4090bef