Created
September 3, 2026 16:04
-
-
Save amidevous2/ae68249273db99f7ca6c82645c50b4f9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Set to bcond_without or use --with bootstrap, | |
| # when bootstrapping a new architecture. | |
| %bcond_with bootstrap | |
| Name: ninja-build | |
| Version: 1.11.1 | |
| Release: 7%{?dist} | |
| Summary: Small build system with a focus on speed | |
| License: Apache-2.0 | |
| URL: https://ninja-build.org/ | |
| Source0: https://github.com/ninja-build/ninja/archive/v%{version}/ninja-%{version}.tar.gz | |
| Source1: ninja.vim | |
| Source2: macros.ninja | |
| %if !0%{?rhel} | |
| # https://github.com/ninja-build/ninja/pull/2340 | |
| Patch0: python3.13-pipes.patch | |
| %endif | |
| BuildRequires: devtoolset-11 | |
| BuildRequires: rh-python38-python-devel | |
| %if %{without bootstrap} | |
| BuildRequires: asciidoc | |
| BuildRequires: gtest-devel | |
| %endif | |
| %if !0%{?rhel} | |
| BuildRequires: re2c >= 1.0 | |
| %endif | |
| %if %{without bootstrap} | |
| Requires: emacs-filesystem | |
| Requires: vim-filesystem | |
| %endif | |
| Requires: cmake3 | |
| %description | |
| Ninja is a small build system with a focus on speed. It differs from other | |
| build systems in two major respects: it is designed to have its input files | |
| generated by a higher-level build system, and it is designed to run builds as | |
| fast as possible. | |
| %prep | |
| %autosetup -n ninja-%{version} -p1 | |
| %build | |
| %set_build_flags | |
| scl enable rh-python38 devtoolset-11 'python3 configure.py --bootstrap --verbose' | |
| scl enable rh-python38 devtoolset-11 './ninja -v all' | |
| %if %{without bootstrap} | |
| scl enable rh-python38 devtoolset-11 './ninja -v manual' | |
| %endif | |
| %install | |
| mkdir -p %{buildroot}%{_bindir}/ | |
| install -Dpm0755 ninja -t %{buildroot}%{_bindir}/ | |
| %if %{without bootstrap} | |
| mkdir -p %{buildroot}%{_datadir}/bash-completion/completions/ninja/ | |
| install -Dpm0644 misc/bash-completion %{buildroot}%{_datadir}/bash-completion/completions/ninja | |
| mkdir -p %{buildroot}%{_datadir}/emacs/site-lisp/ninja-mode.el/ | |
| install -Dpm0644 misc/ninja-mode.el %{buildroot}%{_datadir}/emacs/site-lisp/ninja-mode.el | |
| mkdir -p %{buildroot}%{_datadir}/vim/vimfiles/syntax/ninja.vim/ | |
| install -Dpm0644 misc/ninja.vim %{buildroot}%{_datadir}/vim/vimfiles/syntax/ninja.vim | |
| mkdir -p %{buildroot}%{_datadir}/vim/vimfiles/ftdetect/ninja.vim/ | |
| install -Dpm0644 %{S:1} %{buildroot}%{_datadir}/vim/vimfiles/ftdetect/ninja.vim | |
| mkdir -p %{buildroot}%{_datadir}/zsh/site-functions/_ninja/ | |
| install -Dpm0644 misc/zsh-completion %{buildroot}%{_datadir}/zsh/site-functions/_ninja | |
| mkdir -p %{buildroot}%{python38_sitelib}/ | |
| install -Dpm0644 misc/ninja_syntax.py %{buildroot}%{python38_sitelib}/ninja_syntax.py | |
| mkdir -p %{buildroot}%{python3_sitelib}/ | |
| install -Dpm0644 misc/ninja_syntax.py %{buildroot}%{python3_sitelib}/ninja_syntax.py | |
| %endif | |
| mkdir -p %{buildroot}%{_datadir}/bash-completion/completions/ninja/ | |
| install -Dpm0644 %{S:2} %{buildroot}%{_rpmmacrodir}/macros.ninja | |
| # Macro should not change when we are redefining bindir | |
| sed -i -e "/^%%__ninja /s| .*$| %{_bindir}/ninja|" %{buildroot}%{_rpmmacrodir}/macros.ninja | |
| ln -s ninja %{buildroot}%{_bindir}/ninja-build | |
| %if %{without bootstrap} | |
| %check | |
| scl enable rh-python38 devtoolset-11 './ninja_test --gtest_filter=-SubprocessTest.SetWithLots' | |
| %endif | |
| %files | |
| %license COPYING | |
| %doc README.md | |
| %if %{without bootstrap} | |
| %doc doc/manual.html | |
| %endif | |
| %{_bindir}/ninja | |
| %{_bindir}/ninja-build | |
| %if %{without bootstrap} | |
| %{_datadir}/bash-completion/completions/ninja | |
| %{_datadir}/emacs/site-lisp/ninja-mode.el | |
| %{_datadir}/vim/vimfiles/syntax/ninja.vim | |
| %{_datadir}/vim/vimfiles/ftdetect/ninja.vim | |
| # zsh does not have a -filesystem package | |
| %dir %{_datadir}/zsh | |
| %dir %{_datadir}/zsh/site-functions | |
| %{_datadir}/zsh/site-functions/_ninja | |
| %pycached %{python3_sitelib}/ninja_syntax.py | |
| %pycached %{python38_sitelib}/ninja_syntax.py | |
| %endif | |
| %{_rpmmacrodir}/macros.ninja |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment