%global pypi_name OctoPrint-PiSupport %global srcname %(tr [A-Z] [a-z] <<<%{pypi_name}) %global _description %{expand:The OctoPrint Pi Support plugin provides additional information about your Pi in the UI and also alerts you about undervoltage or overheating issues observed on your Pi or if your Pi is unsupported. If you are running OctoPi, the Pi Support plugin will also provide additional information about that. OctoPrint will only load this plugin when it detects that it is being run on a Raspberry Pi.} Name: python-%{srcname} Version: 2022.6.13 Release: 1%{?dist} Summary: OctoPrint plugin that provides additional information about your Pi in the UI 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_pi_support # 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_pi_support %files -n python3-%{srcname} -f %{pyproject_files} -f %{srcname}.lang %doc README.md %license LICENSE # Exclude useless .po files %exclude %{python3_sitelib}/octoprint_pi_support/translations/*/LC_MESSAGES/messages.po %changelog * Mon Jan 02 2023 Mohamed El Morabity - 2022.6.13-1 - Initial RPM release