%global pypi_name OctoPrint-FileCheck %global srcname %(tr [A-Z] [a-z] <<<%{pypi_name}) %global _description %{expand:The OctoPrint File Check plugin tries to detect common issues in uploaded files that are known to cause issues while printing and which in the past have caused support requests on OctoPrint's Community Forums.} Name: python-%{srcname} Version: 2021.2.23 Release: 1%{?dist} Summary: OctoPrint plugin to check for common issues in uploaded files 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_file_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_file_check %files -n python3-%{srcname} -f %{pyproject_files} -f %{srcname}.lang %doc README.md %license LICENSE # Exclude useless .po files %exclude %{python3_sitelib}/octoprint_file_check/translations/*/LC_MESSAGES/messages.po %changelog * Mon Jan 02 2023 Mohamed El Morabity - 2021.2.23-1 - Initial RPM release