From 1ed405ae139a7d1640b6a8e0ab9c4ec669b02d6a Mon Sep 17 00:00:00 2001 From: Chris Caron Date: Tue, 30 Sep 2025 16:18:46 -0400 Subject: [PATCH] Updated RPM Spec file to fix rpmbuild errors on koji (#1421) --- packaging/redhat/python-apprise.spec | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/packaging/redhat/python-apprise.spec b/packaging/redhat/python-apprise.spec index 57faf7a7..adce6f3a 100644 --- a/packaging/redhat/python-apprise.spec +++ b/packaging/redhat/python-apprise.spec @@ -161,11 +161,29 @@ BuildRequires: python%{python3_pkgversion}-pytest-cov %if %{legacy_python_build} # backwards compatible %py3_install +# Compile gettext catalogues from SOURCE into the INSTALLED tree +pushd %{_builddir}/%{pypi_name}-%{version} +for po in apprise/i18n/*/LC_MESSAGES/apprise.po; do + [ -f "$po" ] || continue + langdir="$(dirname "${po#apprise/i18n/}")" + outdir="%{buildroot}%{python3_sitelib}/%{pypi_name}/i18n/${langdir}" + install -d "$outdir" + msgfmt -o "${outdir}/apprise.mo" "$po" +done %else %pyproject_install %pyproject_save_files apprise + +# Compile gettext catalogues into the installed tree +pushd %{buildroot}%{python3_sitelib}/apprise/i18n +for po in */LC_MESSAGES/apprise.po; do + [ -f "$po" ] || continue + msgfmt -o "${po%.po}.mo" "$po" +done %endif +popd + %{__install} -p -D -T -m 0644 packaging/man/%{pypi_name}.1 \ %{buildroot}%{_mandir}/man1/%{pypi_name}.1 @@ -184,7 +202,6 @@ LANG=C.UTF-8 PYTHONPATH=%{buildroot}%{python3_sitelib}:%{_builddir}/%{name}-%{ve %doc README.md ACKNOWLEDGEMENTS.md CONTRIBUTING.md %{python3_sitelib}/%{pypi_name}/ # Exclude i18n as it is handled below with the lang(spoken) tag below -%exclude %{python3_sitelib}/%{pypi_name}/i18n/ %exclude %{python3_sitelib}/%{pypi_name}/cli.* # Handle egg-info to dist-info transfer @@ -194,8 +211,14 @@ LANG=C.UTF-8 PYTHONPATH=%{buildroot}%{python3_sitelib}:%{_builddir}/%{name}-%{ve %{python3_sitelib}/apprise-*.egg-info %endif +%if %{legacy_python_build} +# Legacy: include all compiled locales that we produced under the package tree +%{python3_sitelib}/%{pypi_name}/i18n/*/LC_MESSAGES/apprise.mo +%else # Localised Files +%exclude %{python3_sitelib}/%{pypi_name}/i18n/ %lang(en) %{python3_sitelib}/%{pypi_name}/i18n/en/LC_MESSAGES/apprise.mo +%endif %files -n %{pypi_name} %{_bindir}/%{pypi_name}