%global pkgvers 0 %global scdate0 20230605 %global schash0 6b95f26841ad3f772a1dd81e5588835862822705 %global branch0 master %global source0 https://github.com/tensorflow/tensorboard.git %global sshort0 %{expand:%%{lua:print(('%{schash0}'):sub(1,8))}} Name: tensorboard Version: %(curl -s "https://raw.githubusercontent.com/tensorflow/tensorboard/%{schash0}/tensorboard/version.py" | grep "VERSION =" | cut -d'"' -f2 | sed 's|.[a-z,A-Z]||') Release: %{scdate0}.%{pkgvers}.git%{sshort0}%{?dist} Summary: TensorFlow's Visualization Toolkit License: BSD URL: https://www.tensorflow.org/tensorboard Patch0: tensorboard-protobuf.patch BuildRequires: gcc-c++ curl unzip git BuildRequires: bazel5 java-11-openjdk-devel BuildRequires: python3-devel python3-setuptools python3dist(absl-py) >= 0.4.0 BuildRequires: python3dist(virtualenv) python3dist(numpy) >= 1.20 python3dist(protobuf) >= 3.9.2 Requires: tensorflow %global debug_package %{nil} %description TensorBoard is a suite of web applications for inspecting and understanding your TensorFlow runs and graphs. %prep %setup -T -c -n %{name} rm -rf %{_builddir}/%{name}/* rm -rf %{_builddir}/%{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 %patch0 -p1 -b .proto~ %build pushd %{name} sed -i '1 i #!/usr/bin/python3\n' tensorboard/tools/mat_bundle_icon_svg.py export TMP=/tmp export TEST_TMPDIR="%{_builddir}/%{name}" export PYTHON_BIN_PATH=%{python3} %if 0%{?fedora} %if 0%{?fedora} <= 35 export CXXFLAGS="-include/usr/include/c++/11/limits" export BAZEL_CXXOPTS="-include/usr/include/c++/11/limits" %endif %if 0%{?fedora} == 36 || 0%{?fedora} == 37 export CXXFLAGS="-include/usr/include/c++/12/limits" export BAZEL_CXXOPTS="-include/usr/include/c++/12/limits" %endif %if 0%{?fedora} >= 38 export CXXFLAGS="-include/usr/include/c++/13/limits" export BAZEL_CXXOPTS="-include/usr/include/c++/13/limits" %endif %endif %ifarch aarch64 export BAZEL_JAVAC_OPTS="-J-Xmx4g -J-Xms512m" %endif bazel build \ --subcommands \ --explain=build.log \ --show_result=2147483647 \ --local_ram_resources=32768 \ --jobs %{_smp_build_ncpus} \ --verbose_failures \ --host_force_python=PY3 \ --python_path="%{python3}" \ --incompatible_use_python_toolchains \ --cxxopt="-DPYPY_VERSION" \ %if 0%{?fedora} %if 0%{?fedora} <= 35 --cxxopt="-include/usr/include/c++/11/limits" \ %endif %if 0%{?fedora} == 36 || 0%{?fedora} == 37 --cxxopt="-include/usr/include/c++/12/limits" \ %endif %if 0%{?fedora} >= 38 --cxxopt="-include/usr/include/c++/13/limits" \ %endif %endif //tensorboard/pip_package:build_pip_package popd %install pushd %{name} mkdir -p %{buildroot}/%{python3_sitearch}/ ./bazel-bin/tensorboard/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 # remove weak depends sed -i '/Requires-Dist: /d' %{buildroot}/%{python3_sitearch}/*.dist-info/METADATA # fix chmod find %{buildroot}/%{python3_sitearch}/ -type f -exec chmod 644 {} \; # strip libraries find %{buildroot}/%{python3_sitearch}/ -name "*.so*" -exec strip {} \; find %{buildroot}/%{python3_sitearch}/ -name "*.so*" -exec chmod 755 {} \; popd # cleanup bad ro build rights chmod +w -R %{_builddir}/%{name}/_bazel* %files %doc %{name}/README.md %doc %{name}/CONTRIBUTING.md %license %{name}/LICENSE %{python3_sitearch}/* %changelog * Sat Apr 25 2020 Balint Cristian - github update releases