summaryrefslogtreecommitdiff
path: root/tensorflow.spec
blob: d0e884842d80c78a96c5e66ef5d32cf3533aae75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Prebuilt manylinux wheels are used as Sources because building TensorFlow
# from source requires Bazel plus a version-matched vendored external
# dependency cache (the src-openeuler reference ships one for 2.12.1 only,
# which is incompatible with 2.21.0) and therefore cannot be done offline.
%global debug_package %{nil}
%global __os_install_post %{nil}
%global _empty_manifest_terminate_build 0
# The wheel METADATA declares `libclang>=13`, so pythondistdeps emits a hard
# `python3.11dist(libclang)` requirement. openEuler ships the libclang support
# as the `python3-libclang` compatibility shim, which exposes only the
# unversioned `python3dist(libclang)` capability (backed by python3-clang +
# clang-libs); no package provides the versioned `python3.11dist(libclang)`
# capability, so that auto-generated requirement is unsatisfiable. TensorFlow
# never imports clang/libclang at runtime (it is only referenced by the wheel's
# packaging tooling), and the official openEuler tensorflow carries no libclang
# dependency. Keep the real dependency on python3-libclang and drop only the
# unprovidable versioned capability so the package is repo-closed.
%global __requires_exclude ^python3\\.11dist\\(libclang\\)

Name:           tensorflow
Version:        2.21.0
Release:        1%{?dist}
Summary:        An Open Source Machine Learning Framework for Everyone
License:        Apache-2.0
URL:            https://www.tensorflow.org/
Source0:        https://mirrors.aliyun.com/pypi/packages/26/a1/23b9b39c046c723db63a1c2c93397703efa3400a36f98d9c717b473aafb8/tensorflow-%{version}-cp311-cp311-manylinux_2_27_x86_64.whl
Source1:        https://mirrors.aliyun.com/pypi/packages/9c/7c/57b7ee953b40d5d837136d20af6851b20ea6ca63753fc05699e8bcfab6d5/tensorflow-%{version}-cp311-cp311-manylinux_2_27_aarch64.whl
ExclusiveArch:  x86_64 aarch64
# topdir: none - wheels are prebuilt and unpacked directly into buildroot

%description
TensorFlow is an end-to-end open source platform for machine learning. It has
a comprehensive, flexible ecosystem of tools, libraries, and community
resources that lets researchers push the state-of-the-art in ML and developers
easily build and deploy ML-powered applications.

TensorFlow was originally developed by researchers and engineers working on
the Google Brain team within Google's Machine Intelligence Research
organization to conduct machine learning and deep neural networks research.

# The install root is produced as the main `tensorflow` package so that the
# package the CI/consumers install by the source name (`tensorflow`) actually
# exists. The conventional Python names are kept as virtual provides for
# backward compatibility with dependents that require python3-tensorflow.
Provides:       python-tensorflow = %{version}-%{release}
Provides:       python3-tensorflow = %{version}-%{release}
BuildRequires:  unzip
BuildRequires:  python3-devel
BuildRequires:  python3-rpm-macros
Requires:       python3-numpy
Requires:       python3-protobuf
Requires:       python3-grpcio
Requires:       python3-h5py
Requires:       python3-Keras
Requires:       python3-libclang >= 13.0.0

%prep
# Create (but do not populate) the build directory; sources are prebuilt
# wheels that are unpacked straight into the buildroot in %%install.
%setup -q -c -T -n %{name}-%{version}
%ifarch x86_64
cp -f %{SOURCE0} .
%endif
%ifarch aarch64
cp -f %{SOURCE1} .
%endif

%build

%install
mkdir -p %{buildroot}%{python3_sitearch}
%ifarch x86_64
unzip -q %{SOURCE0} -d %{buildroot}%{python3_sitearch}
%endif
%ifarch aarch64
unzip -q %{SOURCE1} -d %{buildroot}%{python3_sitearch}
%endif

%files
%{python3_sitearch}/tensorflow
%{python3_sitearch}/tensorflow-*.dist-info

%changelog
* Wed Dec 02 2026 openEuler AI Importer <ai-importer@openeuler.org> - 2.21.0-1
- Initial package for tensorflow 2.21.0 (prebuilt manylinux wheels)