tensorflow/tensorflow.spec
chendexi 9d1036792a Add provides and fix build error
Signed-off-by: chendexi <chendexi@kylinos.cn>

update tensorflow.spec.

Signed-off-by: chendexi <chendexi@kylinos.cn>

modify changelog email
2022-09-22 15:16:03 +08:00

80 lines
3.8 KiB
RPMSpec

%global _empty_manifest_terminate_build 0
Name: tensorflow
Version: 2.8.2
Release: 3
Summary: An Open Source Machine Learning Framework for Everyone
License: Apache License 2.0
URL: https://www.tensorflow.org/
Source0: https://github.com/tensorflow/tensorflow/archive/v%{version}.tar.gz#/tensorflow-%{version}.tar.gz
#sh -x updateSource1.sh
Source1: external-aarch64.tar.bz2.partaa
Source2: external-aarch64.tar.bz2.partab
Source3: external-x86_64.tar.bz2.partaa
Source4: external-x86_64.tar.bz2.partab
Requires: python3-future python3-numpy
%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 system is general enough to be applicable in a wide variety of other domains, as well.
TensorFlow provides stable Python and C++ APIs, as well as non-guaranteed backward compatible API for other languages.
%package -n python3-tensorflow
Summary: An Open Source Machine Learning Framework for Everyone
Provides: python-tensorflow
Provides: python%{python3_version}dist(tensorflow) = %{version}
#It is because external-$(arch).tar.bz2 is built on bazel 3.5.0
BuildRequires: bazel == 4.2.1 gcc gcc-c++ git
BuildRequires: python3-numpy python3-devel python3-Keras-Preprocessing python3-pip python3-wheel
%description -n python3-tensorflow
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 system is general enough to be applicable in a wide variety of other domains, as well.
TensorFlow provides stable Python and C++ APIs, as well as non-guaranteed backward compatible API for other languages.
%prep
%autosetup -p1
extdir=$(bazel --output_user_root=`pwd`/../output_user_root info output_base)
mkdir -p ${extdir}
%ifarch aarch64
cat %{SOURCE1} %{SOURCE2} > external-%{_arch}.tar.bz2
%endif
%ifarch x86_64
cat %{SOURCE3} %{SOURCE4} > external-%{_arch}.tar.bz2
%endif
tar xf external-%{_arch}.tar.bz2 -C ${extdir}
ln -sfn $(find ${extdir}/../install -name embedded_tools) ${extdir}/external/bazel_tools
ln -sfn $(find ${extdir}/../install -maxdepth 2 -name platforms) ${extdir}/external/platforms
rm -rf ${extdir}/external/local_config*
%build
mkdir -p ${HOME}/.local/bin
ln -s -f -T $(command -v python3) ${HOME}/.local/bin/python
export PATH=${HOME}/.local/bin:$PATH
bazel --output_user_root=`pwd`/../output_user_root build --host_copt=-Wno-stringop-truncation //tensorflow/tools/pip_package:build_pip_package
./bazel-bin/tensorflow/tools/pip_package/build_pip_package dist
%install
%py3_install_wheel *
%files -n python3-tensorflow
%{python3_sitearch}/*
%{_bindir}/*
%changelog
* Thu Sep 22 2022 chendexi <chendexi@kylinos.cn> -2.8.2-3
- Add provides and fix build error
* Tue Aug 30 2022 zhangshaoning <zhangshaoning@uniontech.com> -2.8.2-2
- fix packaging issue
* Thu Jun 23 2022 zhangshaoning <zhangshaoning@uniontech.com> -2.8.2-1
- update version to 2.8.2
- fix some cves
* Wed Sep 30 2020 Zhipeng Xie<xiezhipeng1@huawei.com> - 2.3.1-1
- Package init