%global pkgvers 0 %global scdate0 20231107 %global schash0 601488fd4c1468ae7872e132e0f1c9843df54182 %global branch0 r2.15 %global source0 https://github.com/keras-team/keras.git %global sshort0 %{expand:%%{lua:print(('%{schash0}'):sub(1,8))}} Name: keras Version: %(curl -s "https://raw.githubusercontent.com/keras-team/keras/%{schash0}/keras/tools/pip_package/setup.py" | grep "VERSION =" | cut -d'"' -f2 | sed 's|.[a-z,A-Z]||') 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: python-ml_dtypes 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 # python3 tooling sed -i 's|python keras/tools|python3 keras/tools|' keras/keras/tools/pip_package/build_pip_package.sh %build pushd %{name} 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 popd %install 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 # 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