%bcond bootstrap 0 %bcond datetime_tests %{undefined rhel} %global python3_pkgversion 3.11 Name: babel Version: 2.14.0 Release: 3.ac%{?dist} Summary: Tools for internationalizing Python applications License: BSD-3-Clause URL: https://babel.pocoo.org/ Source: %{pypi_source Babel} BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel %if %{without bootstrap} BuildRequires: coreutils # The Python test dependencies are not generated from tox.ini, # because it would require complex patching to be usable # and becasue we want to avoid the tox dependency in ELN/RHEL. BuildRequires: python%{python3_pkgversion}-pytest %if %{with datetime_tests} BuildRequires: python3-freezegun BuildRequires: python%{python3_pkgversion}-freezegun # The pytz tests are skipped when pytz is missing BuildRequires: python3-pytz BuildRequires: python%{python3_pkgversion}-pytz %endif # build the documentation BuildRequires: make BuildRequires: python%{python3_pkgversion}-sphinx %endif Requires: python%{python3_pkgversion}-babel = %{?epoch:%{epoch}:}%{version}-%{release} %description Babel is composed of two major parts: * tools to build and work with gettext message catalogs * a Python interface to the CLDR (Common Locale Data Repository), providing access to various locale display names, localized number and date formatting, etc. %package -n babel%{python3_pkgversion} Summary: Tools for internationalizing Python applications %description -n babel%{python3_pkgversion} Tools to build and work with gettext message catalogs %package -n python%{python3_pkgversion}-babel Summary: Library for internationalizing Python %{python3_pkgversion} applications %description -n python%{python3_pkgversion}-babel Babel is composed of two major parts: * tools to build and work with gettext message catalogs * a Python interface to the CLDR (Common Locale Data Repository), providing access to various locale display names, localized number and date formatting, etc. %if %{without bootstrap} %package doc%{python3_pkgversion} Summary: Documentation for Babel %py_provides python%{python3_pkgversion}-babel-doc %description doc%{python3_pkgversion} Documentation for Babel %endif %prep %autosetup -p1 -n Babel-%{version} %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel BUILDDIR="$PWD/built-docs" rm -rf "$BUILDDIR" %if %{without bootstrap} pushd docs make SPHINXBUILD=sphinx-build-%{python3_pkgversion} BUILDDIR="$BUILDDIR" html man popd rm -f "$BUILDDIR/html/.buildinfo" %endif %install %pyproject_install %pyproject_save_files babel %if %{without bootstrap} install -D -m 0644 built-docs/man/babel.1 %{buildroot}%{_mandir}/man1/pybabel-%{python3_pkgversion}.1 %endif mv %{buildroot}%{_bindir}/pybabel %{buildroot}%{_bindir}/pybabel-%{python3_pkgversion} %check export TZ=UTC %pyproject_check_import %if %{without bootstrap} # The deselected doctests fail without pytz when run during Eastern Daylight Time # https://github.com/python-babel/babel/issues/988 # The ignored files use freezegun %pytest %{!?with_datetime_tests: -k "not (babel.dates.format_time or babel.dates.get_timezone_name)" --ignore tests/test_dates.py --ignore tests/messages/test_frontend.py} %endif %files -n %{name}%{python3_pkgversion} %doc CHANGES.rst AUTHORS %{_bindir}/pybabel-%{python3_pkgversion} %if %{without bootstrap} %{_mandir}/man1/pybabel-%{python3_pkgversion}.1* %endif %files -n python%{python3_pkgversion}-babel -f %{pyproject_files} %if %{without bootstrap} %files doc%{python3_pkgversion} %license LICENSE %doc built-docs/html/* %endif %changelog * Wed Apr 03 2024 Ding-Yi Chen - 2.14.0-3.ac - Shortcut packaging