Accepting request 919796 from home:schubi2
- Use libalternatives instead of update-alternatives. OBS-URL: https://build.opensuse.org/request/show/919796 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Babel?expand=0&rev=59
This commit is contained in:
parent
2578bf0a5a
commit
a696184eb5
@ -1,3 +1,8 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Aug 23 07:34:43 UTC 2021 - Stefan Schubert <schubi@suse.de>
|
||||
|
||||
- Use libalternatives instead of update-alternatives.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue May 11 21:40:39 UTC 2021 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
|
@ -16,6 +16,12 @@
|
||||
#
|
||||
|
||||
|
||||
%if 0%{?suse_version} > 1500
|
||||
%bcond_without libalternatives
|
||||
%else
|
||||
%bcond_with libalternatives
|
||||
%endif
|
||||
|
||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||
%define oldpython python
|
||||
Name: python-Babel
|
||||
@ -33,8 +39,12 @@ BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-rpm-macros
|
||||
Requires: python-pytz >= 2015.7
|
||||
%if %{with libalternatives}
|
||||
Requires: alts
|
||||
%else
|
||||
Requires(post): update-alternatives
|
||||
Requires(postun):update-alternatives
|
||||
%endif
|
||||
BuildArch: noarch
|
||||
%ifpython2
|
||||
Obsoletes: %{oldpython}-babel < %{version}
|
||||
@ -57,7 +67,14 @@ A collection of tools for internationalizing Python applications.
|
||||
|
||||
%install
|
||||
%python_install
|
||||
%python_clone -a %{buildroot}%{_bindir}/pybabel
|
||||
%if ! %{with libalternatives}
|
||||
%python_clone -a %{buildroot}%{_bindir}/pybabel
|
||||
%else
|
||||
%python_clone %{buildroot}%{_bindir}/pybabel
|
||||
ln -sf %{_bindir}/alts %{buildroot}%{_bindir}/pybabel
|
||||
mkdir -p %{buildroot}%{_datadir}/libalternatives/pybabel
|
||||
%python_expand echo "binary=%{_bindir}/pybabel-%{$python_version}" > %{buildroot}%{_datadir}/libalternatives/pybabel/10%{$python_version_nodots}.conf
|
||||
%endif
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||
|
||||
%check
|
||||
@ -67,17 +84,31 @@ A collection of tools for internationalizing Python applications.
|
||||
# Since /usr/bin/pybabel became ghosted to be used with update-alternatives, we have to get rid
|
||||
# of the old binary resulting from the non-update-alternativies-ified package:
|
||||
[ -h %{_bindir}/pybabel ] || rm -f %{_bindir}/pybabel
|
||||
|
||||
%if %{with libalternatives}
|
||||
# removing old update-alternatives entries
|
||||
if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ]; then
|
||||
%python_uninstall_alternative pybabel
|
||||
fi
|
||||
%else
|
||||
%post
|
||||
%python_install_alternative pybabel
|
||||
|
||||
%postun
|
||||
%python_uninstall_alternative pybabel
|
||||
%endif
|
||||
|
||||
%files %{python_files}
|
||||
%license LICENSE
|
||||
%doc CHANGES
|
||||
%if ! 0%{with libalternatives}
|
||||
%python_alternative %{_bindir}/pybabel
|
||||
%else
|
||||
%dir %{_datadir}/libalternatives
|
||||
%dir %{_datadir}/libalternatives/pybabel
|
||||
%{_datadir}/libalternatives/pybabel/10%python_version_nodots.conf
|
||||
%{_bindir}/pybabel
|
||||
%{_bindir}/pybabel-%python_version
|
||||
%endif
|
||||
%{python_sitelib}/babel
|
||||
%{python_sitelib}/Babel-%{version}-py%{python_version}.egg-info
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user