%global pkgvers 0 %global scdate0 20220124 %global schash0 562bfa738dda3fd55e2933acd5a27a8a0c597543 %global branch0 2.6 %global source0 https://github.com/tensorflow/tensorboard.git %global sshort0 %{expand:%%{lua:print(('%{schash0}'):sub(1,8))}} Name: tensorboard-2.6 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 Patch0: tensorboard-py.patch URL: https://www.tensorflow.org/tensorboard BuildRequires: gcc-c++ curl unzip git BuildRequires: bazel4 java-11-openjdk-devel BuildRequires: python3-devel python3-setuptools python3dist(absl-py) >= 0.4.0 BuildRequires: python3dist(virtualenv) python3dist(numpy) python3dist(protobuf) >= 3.9.2 Requires: tensorflow-2.6 Requires: python3dist(google-auth) python3dist(requests) Provides: tensorboard = %{version} %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 tensorboard -n %{name} git clone --depth 1 -n -b %{branch0} %{source0} tensorboard git -C tensorboard fetch --depth 1 origin %{schash0} git -C tensorboard reset --hard %{schash0} git -C tensorboard log --format=fuller %patch0 -p0 -b .py~ %build pushd tensorboard sed -i '1 i #!/usr/bin/python3\n' tensorboard/tools/mat_bundle_icon_svg.py export TMP=/tmp export TF_NEED_AWS=0 export TF_IGNORE_MAX_BAZEL_VERSION=1 export TEST_TMPDIR="%{_builddir}/%{name}" export PYTHON_BIN_PATH=%{python3} %if 0%{?fedora} > 35 export CXXFLAGS="-include /usr/include/c++/12/limits" export BAZEL_CXXOPTS="-include/usr/include/c++/12/limits" export EXTRA_BAZEL_ARGS="${EXTRA_BAZEL_ARGS} --cxxopt=-include/usr/include/c++/12/limits" %elif (0%{?rhel} == 9) || (0%{?fedora} > 34) export CXXFLAGS="-include /usr/include/c++/11/limits" export BAZEL_CXXOPTS="-include/usr/include/c++/11/limits" export EXTRA_BAZEL_ARGS="${EXTRA_BAZEL_ARGS} --cxxopt=-include/usr/include/c++/11/limits" %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 \ %ifarch x86_64 --jobs %{_smp_build_ncpus} \ %else --jobs 1 \ %endif --verbose_failures \ --host_force_python=PY3 \ --python_path="%{python3}" \ --define=no_tensorflow_py_deps=true \ --incompatible_use_python_toolchains \ --cxxopt="-DPYPY_VERSION" ${EXTRA_BAZEL_ARGS} \ --host_javabase=@local_jdk//:jdk \ //tensorboard/pip_package:build_pip_package popd %install rm -rf %{buildroot} pushd tensorboard 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 tensorboard/README.md %doc tensorboard/CONTRIBUTING.md %license tensorboard/LICENSE %{python3_sitearch}/* %changelog * Sat Apr 25 2020 Balint Cristian - github update releases