# git ls-remote git://github.com/vlachoudis/bCNC/ %global git_commit 36896e5fee627b4760d0c2378cc0463f7bf3c3e9 %global git_date 20210908 %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 Release: 0.2.%{git_suffix}%{?dist} Summary: GRBL CNC command sender, autoleveler and G-code editor License: GPLv2 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: ImageMagick BuildRequires: findutils BuildRequires: sed BuildRequires: python3-opencv Patch0: bCNC-0.9.14.52-locale-fix.patch Patch2: bCNC-0.9.14.52-system-paths.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 # Drop executable mode on locales find bCNC/locale -type f -exec chmod a-x {} \; # Icon convert convert bCNC/bCNC.png -resize 256x256 ./bCNC.png %build %py3_build %install %py3_install # Do not install test suite, there is nothing usable rm -rf %{buildroot}%{python3_sitelib}/tests # Drop hashbangs #pushd %{buildroot}%{python3_sitelib} #find . -name '*.py' -exec sed -i '1{/^#!/ d}' {} \; #popd # 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 # Handle locale # Move locale to the right place mv %{buildroot}%{python3_sitelib}/bCNC/locale %{buildroot}%{_datadir} # Drop unneeded .po files pushd %{buildroot}%{_datadir} find . -name '*.po' -exec rm -f {} \; popd %find_lang %{name} %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 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