%global pypi_name tensorflow %define copts --host_copt=-mtune=generic --host_copt=-m64 --host_copt=-mmmx --host_copt=-mno-sse4 --host_copt=-mfpmath=both --host_copt=-msse --host_copt=-msse2 --host_copt=-mlong-double-80 Name: tensorflow Version: 1.13.1 Release: 1.13%{?dist} Summary: A framework used for deep learning License: Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND FSFUL AND MIT AND MPL-2.0 AND OpenSSL AND Python-2.0 URL: https://www.tensorflow.org/ Source0: https://github.com/tensorflow/tensorflow/archive/v%{version}.tar.gz#/tensorflow-%{version}.tar.gz Patch0: adding_config_cpu.patch Patch1: adding_python_bin_path.patch Patch2: rules_closure-tensorflow-1.13.patch BuildRequires: python2-devel BuildRequires: patch BuildRequires: gcc < 5.0 BuildRequires: gcc-c++ < 5.0 BuildRequires: python2-six >= 1.12 BuildRequires: python2-pip BuildRequires: bazel >= 0.21 BuildRequires: python2-keras-applications >= 1.0.6 BuildRequires: python2-keras-preprocessing BuildRequires: numpy >= 1.16.1 BuildRequires: python-google-apputils BuildRequires: protobuf >= 3.6.1 BuildRequires: python2-protobuf >= 3.6.1 BuildRequires: python-enum34 >= 1.1.6 BuildRequires: python2-astor >= 0.6.0 BuildRequires: python2-termcolor >= 1.1.0 BuildRequires: python2-werkzeug >= 0.11.15 BuildRequires: python2-markdown >= 2.6.8 BuildRequires: python2-setuptools > 30 BuildRequires: python-backports BuildRequires: python2-futures BuildRequires: python2-absl-py Provides: python2-tensorflow Provides: python2-tensorflow-cpu Requires: numpy >= 1.16.1 Requires: python2-pip Requires: python2-protobuf >= 3.6.1 Requires: python-enum34 >= 1.1.6 Requires: python2-astor >= 0.6.0 Requires: python2-termcolor >= 1.1.0 Requires: python2-werkzeug >= 0.11.15 Requires: python2-markdown >= 2.6.8 Requires: python-backports Requires: python2-futures Requires: python2-absl-py Requires: python2-keras-applications >= 1.0.6 Requires: python2-keras-preprocessing Requires: python2-gast >= 0.2 %description This open source software library for numerical computation is used for data flow graphs. The graph nodes represent mathematical operations, while the graph edges represent the multidimensional data arrays (tensors) that flow between them. This flexible architecture enables you to deploy computation to one or more CPUs in a desktop, server, or mobile device without rewriting code. %package -n python2-%{pypi_name} Summary: %{summary} %{?python_provide:%python_provide python-%{pypi_name}} Provides: python2-tensorflow Provides: python2-tensorflow-cpu Requires: numpy >= 1.16.1 Requires: python2-pip Requires: python2-protobuf >= 3.6.1 Requires: python-enum34 >= 1.1.6 Requires: python2-astor >= 0.6.0 Requires: python2-termcolor >= 1.1.0 Requires: python2-werkzeug >= 0.11.15 Requires: python2-markdown >= 2.6.8 Requires: python-backports Requires: python2-futures Requires: python2-absl-py Requires: python2-keras-applications >= 1.0.6 Requires: python2-keras-preprocessing Requires: python2-gast >= 0.2 %description -n python2-%{pypi_name} This open source software library for numerical computation is used for data flow graphs. The graph nodes represent mathematical operations, while the graph edges represent the multidimensional data arrays (tensors) that flow between them. This flexible architecture enables you to deploy computation to one or more CPUs in a desktop, server, or mobile device without rewriting code. %package -n python2-tensorboard Summary: %{summary} %{?python_provide:%python_provide python-%{pypi_name}} Provides: python2-tensorboard Requires: numpy >= 1.16.1 Requires: python2-pip Requires: python2-protobuf >= 3.6.1 Requires: python-enum34 >= 1.1.6 Requires: python2-astor >= 0.6.0 Requires: python2-termcolor >= 1.1.0 Requires: python2-werkzeug >= 0.11.15 Requires: python2-markdown >= 2.6.8 Requires: python-backports Requires: python2-futures Requires: python2-absl-py Requires: python2-keras-applications >= 1.0.6 Requires: python2-keras-preprocessing Requires: python2-gast >= 0.2 %description -n python2-tensorboard This open source software library for numerical computation is used for data flow graphs. The graph nodes represent mathematical operations, while the graph edges represent the multidimensional data arrays (tensors) that flow between them. This flexible architecture enables you to deploy computation to one or more CPUs in a desktop, server, or mobile device without rewriting code. %prep %setup -q %patch0 -p0 %patch1 -p0 %patch2 -p0 %build yes | pip install --user --upgrade pip yes | pip install --user wheel mock bazel build --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0" %{?copts} --config=opt //tensorflow/tools/pip_package:build_pip_package ./bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg %install pip install --root=%{buildroot} /tmp/tensorflow_pkg/tensorflow-%{version}-cp27-cp27mu-linux_x86_64.whl rm -rf %{buildroot}/usr/lib/python2.7/site-packages/gast-0.2.2.dist-info rm -rf %{buildroot}/usr/lib/python2.7/site-packages/gast rm -rf %{buildroot}/usr/lib64/python2.7/site-packages/grpc rm -rf %{buildroot}/usr/lib64/python2.7/site-packages/grpcio-1.19.0.dist-info rm -rf %{buildroot}/usr/lib/python2.7/site-packages/backports.weakref-1.0.post1.dist-info rm -rf %{buildroot}/usr/lib/python2.7/site-packages/backports mv %{buildroot}/%{python_sitearch}/%{pypi_name}-%{version}.dist-info %{buildroot}/%{python_sitelib}/%{pypi_name}-%{version}.dist-info %files -n python2-%{pypi_name} %{python_sitelib}/%{pypi_name} %{python_sitelib}/%{pypi_name}-%{version}.dist-info %{python_sitelib}/tensorflow_estimator %{python_sitelib}/tensorflow_estimator-1.13.0.dist-info #%{python2_sitelib}/tensorflow-%{version}-py?.?.egg-info %{_bindir}/freeze_graph %{_bindir}/saved_model_cli %{_bindir}/tf_upgrade_v2 %{_bindir}/tflite_convert %{_bindir}/toco %{_bindir}/toco_from_protos %files -n python2-tensorboard %{python_sitelib}/tensorboard %{python_sitelib}/tensorboard-%{version}.dist-info %{_bindir}/tensorboard %changelog * Fri Mar 08 2019 Ruslan Pisarev - 1.13.1-1 - Build for Centos 7 CPU-only