# Laser Studio Pro RPM package for Fedora. See packaging/fedora/README.md. # # Released version: the archive of the v%%{base_version} tag on GitHub. # Development snapshot, for the Copr repository only: `make -f .copr/Makefile srpm` # builds the archive from the git repository and defines `commit`, `snapdate` and # `commitcount` (Version ^YYYYMMDD.git). %global forgeurl https://github.com/Jgood3d/laser-studio-pro %global app_id io.github.jgood3d.LaserStudioPro %global base_version 3.0.1 %bcond tests 1 %if %{defined commit} %global shortcommit %(c=%{commit}; echo ${c:0:7}) # Copr only (it follows the stable branch): the commit count orders two snapshots # made on the same day, which the hash alone would not. %global snapinfo ^%{snapdate}.%{commitcount}git%{shortcommit} %endif Name: laser-studio-pro Version: %{base_version}%{?snapinfo} Release: 3%{?dist} Summary: Prepare and engrave images and drawings on GRBL lasers # Code: GPL-3.0-or-later. Breeze and Cortex icons (Cortex is a recolored Breeze, resources/icons/): LGPL-3.0-or-later. # Sports models of the design library (resources/library/*/*-modele-[12]/): CC-BY-SA-4.0, with # Material Symbols pictograms from Google (models 1) under Apache-2.0. # Bundled fonts (OFL-1.1): removed, replaced by the system ones (see %%prep). License: GPL-3.0-or-later AND LGPL-3.0-or-later AND CC-BY-SA-4.0 AND Apache-2.0 URL: %{forgeurl} Source: %{forgeurl}/archive/v%{base_version}/%{name}-%{base_version}.tar.gz BuildArch: noarch BuildRequires: python3-devel BuildRequires: desktop-file-utils BuildRequires: libappstream-glib %if %{with tests} # Fonts checked by the tests (tests/test_bundled_fonts.py, Stencil Studio). BuildRequires: font(dejavusans) BuildRequires: font(rubik) BuildRequires: font(dancingscript) BuildRequires: appstream %endif # Fonts of the design library and Stencil Studio: the system ones, not copies # (see %%prep and %%install). Qt finds them under the same name. Requires: font(dejavusans) Requires: font(rubik) Requires: font(dancingscript) Requires: hicolor-icon-theme # AI subject detection in Stencil Studio is optional. Suggests rather than # Recommends: onnxruntime requires sympy, which recommends LaTeX and matplotlib # (more than 200 packages, about 1 GB installed). Suggests: python3-onnxruntime %description Laser Studio Pro prepares images and vector drawings for laser engraving and cutting, then drives GRBL engravers and cutters over USB: image engraving with dithering, vector editor with layers (SVG and DXF import, text, shapes, nesting), box, puzzle and keychain generators, Stencil Studio, guided calibration and machine control. %prep %autosetup -p1 -n %{name}-%{base_version} # Fedora ships OpenCV as "opencv" (python3-opencv), without a headless variant. sed -i 's/"opencv-python-headless"/"opencv"/' pyproject.toml # Stencil Studio's background removal model: downloaded on first use into the # user's profile, since the installed directory is read-only. rm src/stencil_studio/resources/models/u2netp.onnx # Bundled fonts (Rubik, Dancing Script): the Fedora font packages are required # instead. Without this directory, the application uses the system fonts. rm -r src/laser_studio/resources/fonts # Modules runnable on their own from the source tree: once installed, they are not scripts. for f in $(grep -rl --include='*.py' '^#!' src); do sed -i '1{/^#!/d}' "$f" done %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install # Stencil Studio: the system DejaVu font instead of the bundled copy. ln -sf %{_datadir}/fonts/dejavu-sans-fonts/DejaVuSans-Bold.ttf \ %{buildroot}%{python3_sitelib}/stencil_studio/resources/fonts/DejaVuSans-Bold.ttf %pyproject_save_files -L laser_studio laser_common stencil_studio desktop-file-install --dir=%{buildroot}%{_datadir}/applications \ packaging/linux/%{app_id}.desktop install -Dpm 0644 src/laser_studio/resources/laser_studio_pro_512.png \ %{buildroot}%{_datadir}/icons/hicolor/512x512/apps/%{app_id}.png install -Dpm 0644 packaging/linux/%{app_id}.metainfo.xml \ %{buildroot}%{_metainfodir}/%{app_id}.metainfo.xml %check desktop-file-validate %{buildroot}%{_datadir}/applications/%{app_id}.desktop appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/%{app_id}.metainfo.xml # selftest: Stencil Studio self-test, run by hand. %pyproject_check_import -e stencil_studio.selftest %if %{with tests} export QT_QPA_PLATFORM=offscreen export QTWEBENGINE_CHROMIUM_FLAGS="--no-sandbox" # One process per test file: a Qt timer left by one file cannot fire during the next one # (Python 3.14 crashed that way on Copr). faulthandler names the line if it crashes. for t in tests/test_*.py; do %{py3_test_envvars} %{python3} -X faulthandler -m unittest discover -s tests -p "${t#tests/}" || exit 1 done %endif %files -f %{pyproject_files} %license LICENSE %license src/laser_studio/resources/icons/breeze/COPYING.LGPL-3 %license src/laser_studio/resources/library/medailles/medaille-sportive-modele-1/LICENCE-material-symbols.txt %doc README.md CHANGELOG.md %{_bindir}/laser-studio-pro %{_datadir}/applications/%{app_id}.desktop %{_datadir}/icons/hicolor/512x512/apps/%{app_id}.png %{_metainfodir}/%{app_id}.metainfo.xml %changelog * Wed Dec 02 2026 Antoine Le Morvan - 3.0.1-3 - Put snapshot information in Version instead of Release - Require fonts by their font() name * Mon Nov 30 2026 Antoine Le Morvan - 3.0.1-2 - Translate spec comments to English * Mon Nov 30 2026 Antoine Le Morvan - 3.0.1-1 - Version 3.0.1 * Thu Nov 26 2026 Antoine Le Morvan - 3.0.0-1 - Version 3.0.0 * Sun Nov 22 2026 Antoine Le Morvan - 2.5.0-1 - Initial package