%global pypi_name OctoPrint-FirmwareCheck %global srcname %(tr [A-Z] [a-z] <<<%{pypi_name}) %global _description %{expand:The OctoPrint Firmware Check plugin tries to identify printers or rather printer firmware with known safety issues, such as disabled thermal runaway protection, or other kinds of severe issues, like known communication crippling bugs, and displays a warning box to logged in users on identification of such a firmware.} Name: python-%{srcname} Version: 2021.10.11 Release: 1%{?dist} Summary: OctoPrint plugin to check for unsafe or broken printer firmwares License: AGPL-3.0-only URL: https://github.com/OctoPrint/%{pypi_name}/ Source0: %{url}/archive/%{version}/%{srcname}-%{version}.tar.gz BuildRequires: python3-devel BuildArch: noarch %description %{_description} %package -n python3-%{srcname} Summary: %{summary} %description -n python3-%{srcname} %{_description} %prep %autosetup -n %{pypi_name}-%{version} %generate_buildrequires %pyproject_buildrequires -r %build %pyproject_wheel %install %pyproject_install %pyproject_save_files octoprint_firmware_check # Workaround to manage lang files within %%{pyproject_files} while read -r line; do [[ "$line" =~ /([^/]+)/LC_MESSAGES/messages.mo$ ]] || continue echo "%%lang(${BASH_REMATCH[1]}) $line" >>%{srcname}.lang sed -i "\|$line|d" %{pyproject_files} done <%{pyproject_files} %check # Disable check. This plugin depends on OctoPrint, and OctoPrint requires this # plugin... # %%py3_check_import octoprint_firmware_check %files -n python3-%{srcname} -f %{pyproject_files} -f %{srcname}.lang %doc README.md %license LICENSE # Exclude useless .po files %exclude %{python3_sitelib}/octoprint_firmware_check/translations/*/LC_MESSAGES/messages.po %changelog * Sun Jan 15 2023 Mohamed El Morabity - 2021.10.11-1 - Initial RPM release