%global _enable_debug_packages %{nil} %global __brp_strip %{nil} %define upstream https://github.com/bazelbuild/bazel %global major 7 %define minor 5 %define patchlevel 0 Version: %{major}.%{minor}.%{patchlevel} %define forgeurl %{upstream} %define tag %{version} %define archiveext zip %define archivename %{repo}-%{tag}-dist %define archiveurl %{upstream}/releases/download/%{tag}/%{archivename}.%{archiveext} %forgemeta Name: bazel%{major} Release: %{autorelease} Summary: Bazel is a fast, correct, and extensible build tool URL: https://bazel.build/ License: Apache-2.0 Source: %{forgesource} BuildRequires: bash, coreutils, which BuildRequires: unzip, gzip BuildRequires: python3, gcc-c++, java-21-openjdk-devel Requires: java-21-openjdk-devel Requires(post): %{_sbindir}/alternatives Requires(postun): %{_sbindir}/alternatives %description ​Bazel is a fast, correct, and extensible build tool with integrated testing that supports multiple languages, repositories, and platforms in an industry-leading ecosystem. ​ %prep %autosetup -cn %{repo}-%{version} %build export JAVA_HOME=/usr/lib/jvm/java EMBED_LABEL=%{version} EXTRA_BAZEL_ARGS="--tool_java_runtime_version=local_jdk --verbose_failures" ./compile.sh ./output/bazel build //scripts:bash_completion //scripts:fish_completion ./output/bazel shutdown %install install -Dpm 0755 ./output/bazel %{buildroot}%{_bindir}/%{name} install -Dpm 0644 ./bazel-bin/scripts/bazel-complete.bash %{buildroot}%{bash_completions_dir}/%{name}.bash install -Dpm 0644 ./bazel-bin/scripts/bazel.fish %{buildroot}%{fish_completions_dir}/%{name}.fish install -Dpm 0644 ./scripts/zsh_completion/_bazel %{buildroot}%{zsh_completions_dir}/_%{name} touch %{buildroot}%{_bindir}/bazel touch %{buildroot}%{bash_completions_dir}/bazel.bash touch %{buildroot}%{fish_completions_dir}/bazel.fish touch %{buildroot}%{zsh_completions_dir}/_bazel %post alternatives --install %{_bindir}/bazel bazel %{_bindir}/%{name} %{major} \ --slave %{bash_completions_dir}/bazel.bash bazel.bash %{bash_completions_dir}/%{name}.bash \ --slave %{fish_completions_dir}/bazel.fish bazel.fish %{fish_completions_dir}/%{name}.fish \ --slave %{zsh_completions_dir}/_bazel _bazel %{zsh_completions_dir}/_%{name} %postun if [ $1 -eq 0 ] ; then alternatives --remove bazel %{_bindir}/%{name} fi %files %ghost %{_bindir}/bazel %ghost %{bash_completions_dir}/bazel.bash %ghost %{fish_completions_dir}/bazel.fish %ghost %{zsh_completions_dir}/_bazel %{_bindir}/%{name} %{bash_completions_dir}/%{name}.bash %{fish_completions_dir}/%{name}.fish %{zsh_completions_dir}/_%{name} %changelog %autochangelog