python-3.x - 未知标签:%python_provide:错误:python3-ansible 无法识别
问题描述
我不知道以下错误是什么意思。根据这个链接%python_provide
标签应该是有效的
[root@ip-10-114-62-15 ~]# rpmbuild -ba rpmbuild/SPECS/ansible.spec
error: line 29: Unknown tag: %python_provide: ERROR: python3-ansible not recognized.
[root@ip-10-114-62-15 ~]# cat rpmbuild/SPECS/ansible.spec
# Created by pyp2rpm-3.3.7
%global pypi_name ansible
%global pypi_version 4.5.0
%global pypi_source ansible-4.5.0.tar.gz
Name: python-%{pypi_name}
Version: %{pypi_version}
Release: 1%{?dist}
Summary: Radically simple IT automation
License: GPLv3+
URL: https://ansible.com/
Source0: %{pypi_source}
BuildRequires: python3-devel
BuildRequires: python3dist(ansible-core) >= 2.11.4 with python3dist(ansible-core) < 2.12
BuildRequires: python3dist(setuptools)
BuildRequires: python3dist(sphinx)
%description
|PyPI version| |Docs badge| |Chat badge| |Build Status| |Code Of Conduct|
|Mailing Lists| |License|**************Ansible is a radically simple IT
automation system. It handles configuration management, application deployment,
cloud provisioning, ad-hoc task execution, network automation, and multi-node
orchestration. Ansible makes complex changes like zero-downtime rolling updates
with load...
%package -n python3-%{pypi_name}
Summary: %{summary}
%{?python_provide:%python_provide python3-%{pypi_name}}
Requires: (python3dist(ansible-core) >= 2.11.4 with python3dist(ansible-core) < 2.12)
%description -n python3-%{pypi_name}
|PyPI version| |Docs badge| |Chat badge| |Build Status| |Code Of Conduct|
|Mailing Lists| |License|**************Ansible is a radically simple IT
automation system. It handles configuration management, application deployment,
cloud provisioning, ad-hoc task execution, network automation, and multi-node
orchestration. Ansible makes complex changes like zero-downtime rolling updates
with load...
%package -n python-%{pypi_name}-doc
Summary: ansible documentation
%description -n python-%{pypi_name}-doc
Documentation for ansible
%prep
%autosetup -n %{pypi_name}-%{pypi_version}
# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info
%build
%py3_build
# generate html docs
PYTHONPATH=${PWD} sphinx-build-3 ansible_collections/sensu/sensu_go/docs/source html
# remove the sphinx-build leftovers
rm -rf html/.{doctrees,buildinfo}
%install
%py3_install
%check
%{__python3} setup.py test
解决方案
提供的信息很少,但我假设您正在尝试在 CentOS/RHEL 8 机器上构建,其中宏%python_provide
需要另一个%{python3_pkgversion}
. 例如,前者的来源是:
%python_provide() %{lua:
function string.starts(String,Start)
return string.sub(String,1,string.len(Start))==Start
end
package = rpm.expand("%{?1}")
vr = rpm.expand("%{?epoch:%{epoch}:}%{version}-%{release}")
if (string.starts(package, "python2-")) then
--No unversioned provides as python2 is not default
elseif (string.starts(package, "python" .. rpm.expand("%{python3_pkgversion}") .. "-")) then
--No unversioned provides as python3 is not default
elseif (rpm.expand("%{?python3_other_pkgversion}") ~= "" and string.starts(package, "python" .. rpm.expand("%{python3_other_pkgversion}") .. "-")) then
--No unversioned provides as python3_other is not default
elseif (string.starts(package, "pypy-")) then
--No unversioned provides as pypy is not default
elseif (string.starts(package, "pypy3-")) then
--No unversioned provides as pypy is not default
elseif (string.starts(package, "python-")) then
--Providing the current default python
print("Provides: python2-")
print(string.sub(package,8,string.len(package)))
print(" = ")
print(vr)
else
print("%python_provide: ERROR: ")
print(package)
print(" not recognized.")
end
}
python3-ansible
因此,通过它时可能会出错的唯一方法是何时%{python3_pkgversion}
未定义。
您可能想安装python-srpm-macros
软件包...
推荐阅读
- java - Project Reactor 是围绕 java 的 CompletableFuture 的包装器吗?
- javascript - 从数组中按值从对象中获取值
- java - 生成带有图像的 Excel 工作表
- javascript - PWA beforeinstallprompt 未调用
- sql - 我们能否实现 SSRS 中的行级安全性?
- java - RecyclerView 不更新他的项目的布局
- max - MDX 从切片器元素获取最小最大日期
- python - 如何与 kafka/pykafka 平衡消费者合作?
- sql - ORACLE SQL - 如何找到上一个辞职日期和加入日期之间的间隔?
- python - 在 Pandas 中调用 read_csv 后无法重用输入流