# git ls-remote git://github.com/vlachoudis/bCNC/ %global git_commit 523f1ec75d839de5d599420bb5b751f905324463 %global git_date 20221017 %global git_short_commit %(echo %{git_commit} | cut -c -8) %global git_suffix %{git_date}git%{git_short_commit} Name: bCNC Version: 0.9.14.52~%{git_suffix} Release: 5%{?dist} Summary: GRBL CNC command sender, autoleveler and G-code editor # GPL-2.0-only: # setup.py # bCNC/lib/svgcode.py # BSD-3-Clause: # bCNC/lib/ttf.py # MIT: # tests/arduino-loopback/test-loopback.py License: GPL-2.0-only AND GPL-2.0-or-later AND BSD-3-Clause AND MIT URL: https://github.com/vlachoudis/%{name} Source0: %{url}/archive/%{git_commit}/%{name}-%{git_suffix}.tar.gz BuildArch: noarch BuildRequires: python3-setuptools BuildRequires: python3-devel BuildRequires: desktop-file-utils BuildRequires: python3-pyserial BuildRequires: python3-numpy BuildRequires: python3-pillow BuildRequires: python3-opencv BuildRequires: ImageMagick BuildRequires: findutils BuildRequires: python3-opencv BuildRequires: js-jquery BuildRequires: sed Requires: hicolor-icon-theme Requires: js-jquery Requires: python3-opencv Requires: python3-utils Requires: python3-numpy-stl Recommends: python3-scipy Provides: bundled(fastclick) Provides: bundled(svgcode) = 0.2 Patch0: bCNC-0.9.14.52-locale-fix.patch Patch2: bCNC-0.9.14.52-system-paths.patch # https://github.com/vlachoudis/bCNC/pull/1755 Patch3: bCNC-0.9.14.52-packages-fix.patch # https://github.com/vlachoudis/bCNC/issues/1761 # https://bugzilla.redhat.com/show_bug.cgi?id=2142632 Patch4: bCNC-0.9.14.52-opencv-relax-deps.patch %description GRBL CNC command sender, autoleveler, G-code editor, digitizer, CAM and swiss army knife for all your CNC needs. %prep %autosetup -n %{name}-%{git_commit} -p1 # Icon convert convert bCNC/bCNC.png -resize 256x256 ./bCNC.png # Unbundle python3-utils and python3-numpy-stl pushd bCNC/lib rm -f python_utils/* rmdir python_utils rm -f stl/* rmdir stl popd # Drop shebangs pushd bCNC sed -i '1 { /^#!/ d }' __main__.py bmain.py popd %build %py3_build %install %py3_install # Do not install test suite, there is nothing usable rm -rf %{buildroot}%{python3_sitelib}/tests # Icon install -Dpm 0644 bCNC.png %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/bCNC.png # Desktop file mkdir -p %{buildroot}%{_datadir}/applications desktop-file-install -m 0644 --add-category="Utility" \ --dir=%{buildroot}%{_datadir}/applications \ bCNC/bCNC.desktop # Config install -Dpm 0644 %{buildroot}%{python3_sitelib}/bCNC/bCNC.ini %{buildroot}%{_sysconfdir}/bCNC.ini # Bitmap file install -Dpm 0644 %{buildroot}%{python3_sitelib}/bCNC/bCNC.xbm %{buildroot}%{_datadir}/%{name}/bCNC.xbm # Icons mv %{buildroot}%{python3_sitelib}/bCNC/icons %{buildroot}%{_datadir}/%{name} # Images mv %{buildroot}%{python3_sitelib}/bCNC/images %{buildroot}%{_datadir}/%{name} # Drop artifacts pushd %{buildroot}%{python3_sitelib}/bCNC rm -f {bCNC,bCNC.bat,bCNC.desktop,bCNC.ico,bCNC.ini,bCNC.png,bCNC.pot,bCNC.xbm,make-exe.bat} rm -f lib/python_utils/compat.py* popd # Unbundle jQuery pushd %{buildroot}%{python3_sitelib}/bCNC/pendant rm -f jquery-2.1.4.min.js ln -s %{_datadir}/javascript/jquery/latest/jquery.min.js jquery-2.1.4.min.js popd # Handle locale # Move locale to the right place mv %{buildroot}%{python3_sitelib}/bCNC/locales %{buildroot}%{_datadir}/locale # Drop unneeded .po files pushd %{buildroot}%{_datadir} find . -name '*.po' -exec rm -f {} \; popd # Drop unneeded bCNC.pot file rm -f %{buildroot}%{_datadir}/locale/bCNC.pot %find_lang %{name} # Test is currently disabled because it uses PIP to install specific package versions # we don't have in Fedora. Todo: fix upstream #%%check #%%{__python3} setup.py test %files -f %{name}.lang %license LICENSE.md %doc README.md %{_bindir}/bCNC %config(noreplace) %{_sysconfdir}/bCNC.ini %{_datadir}/icons/hicolor/256x256/apps/bCNC.png %{_datadir}/applications/bCNC.desktop %{_datadir}/bCNC %{python3_sitelib}/bCNC %{python3_sitelib}/bCNC-*.egg-info %changelog * Wed Nov 23 2022 Jaroslav Škarvada - 0.9.14.52~20221017git523f1ec7-5 - Fixed according to the review Related: rhbz#1684603 * Mon Nov 14 2022 Jaroslav Škarvada - 0.9.14.52~20221017git523f1ec7-4 - Fixed according to the review Related: rhbz#1684603 * Thu Nov 10 2022 Jaroslav Škarvada - 0.9.14.52-20221017git523f1ec7-3 - Fixed according to the review Related: rhbz#1684603 * Tue Nov 1 2022 Jaroslav Škarvada - 0.9.14.52~20221017git523f1ec7-2 - Fixed according to the review Related: rhbz#1684603 * Mon Oct 17 2022 Jaroslav Škarvada - 0.9.14.52~20221017git523f1ec7-1 - New snapshot * Mon Oct 17 2022 Jaroslav Škarvada - 0.9.14.52~20210908git36896e5f-1 - Updated according to the review Related: rhbz#1684603 * Wed Sep 8 2021 Jaroslav Škarvada - 0.9.14.52-0.2.20210908git36896e5f - New version * Fri Feb 8 2019 Jaroslav Škarvada - 0.9.14.52-0.1.beta - Initial release