%global pkgvers 0 %global scdate0 20220527 %global schash0 253dc4604479b832dd254d0d348c0b3e7e53fe0f %global branch0 master %global source0 https://github.com/keras-team/keras.git %global sshort0 %{expand:%%{lua:print(('%{schash0}'):sub(1,8))}} Name: keras Version: 2.9.0 Release: %{scdate0}.%{pkgvers}.git%{sshort0}%{?dist} Summary: Keras: Deep Learning for humans License: BSD URL: https://keras.io ExclusiveArch: x86_64 aarch64 ppc64le BuildRequires: bazel5 gcc-c++ git unzip python3-devel python3-setuptools BuildRequires: tensorflow Requires: tensorflow %global debug_package %{nil} %global _lto_cflags %{nil} %undefine _hardened_build %undefine _annotated_build %description Keras is a deep learning API written in Python, running on top of the machine learning platform TensorFlow. %prep %setup -T -c %{name} -n %{name} git clone --depth 1 -n -b %{branch0} %{source0} %{name} git -C %{name} fetch --depth 1 origin %{schash0} git -C %{name} reset --hard %{schash0} git -C %{name} log --format=fuller %build pushd %{name} # python3 tooling sed -i 's|python keras/tools|python3 keras/tools|' keras/tools/pip_package/build_pip_package.sh export TMP=/tmp export TEST_TMPDIR="%{_builddir}/%{name}" bazel build \ --subcommands \ --explain=build.log \ --show_result=2147483647 \ --local_ram_resources=32768 \ --jobs 16 \ --verbose_failures \ --incompatible_use_python_toolchains \ //keras/tools/pip_package:build_pip_package %install rm -rf %{buildroot} pushd %{name} export PYTHON_BIN_PATH=%{python3} bash ./bazel-bin/keras/tools/pip_package/build_pip_package %{buildroot}/%{python3_sitearch}/ unzip %{buildroot}/%{python3_sitearch}/*.whl -d %{buildroot}/%{python3_sitearch}/ rm -rf %{buildroot}/%{python3_sitearch}/*.whl rm -rf %{buildroot}/%{python3_sitearch}/*.data rm -rf %{buildroot}/%{python3_sitearch}/*.dist-info # fix chmod find %{buildroot}/%{python3_sitearch}/ -type f -exec chmod 644 {} \; popd %files %license %{name}/LICENSE %doc %{name}/README.md %doc %{name}/CONTRIBUTING.md %{python3_sitearch}/* %changelog * Wed Dec 04 2019 Balint Cristian - github upstream releases