Add conditional for bootstrapping new architectures

The libxcrypt package may change its build-system from autotools to
mesonbuild sometime in the near future.  Thus we should be able to
build a bootstrap package for ninja-build with the smallest possible
build- and runtime-dependencies.

With bootstrap enabled the only build-dependency, except for a
working compiler-toolchain, will be re2c, and there will be no
runtime-depencies needed to install the ninja-build package.

Signed-off-by: Björn Esser <besser82@fedoraproject.org>
This commit is contained in:
Björn Esser 2020-02-05 13:34:21 +01:00
parent 49ac4b1035
commit b151dcbd6f
No known key found for this signature in database
GPG Key ID: F52E98007594C21D

View File

@ -1,6 +1,10 @@
# Set to bcond_without or use --with bootstrap,
# when bootstrapping a new architecture.
%bcond_with bootstrap
Name: ninja-build
Version: 1.9.0
Release: 4%{?dist}
Release: 5%{?dist}
Summary: Small build system with a focus on speed
License: ASL 2.0
URL: https://ninja-build.org/
@ -13,11 +17,15 @@ BuildRequires: python2-devel
%else
BuildRequires: python3-devel
%endif
%if %{without bootstrap}
BuildRequires: asciidoc
BuildRequires: gtest-devel
%endif
BuildRequires: re2c >= 0.11.3
%if %{without bootstrap}
Requires: emacs-filesystem
Requires: vim-filesystem
%endif
%description
Ninja is a small build system with a focus on speed. It differs from other
@ -37,16 +45,20 @@ CFLAGS="%{optflags}" LDFLAGS="%{?__global_ldflags}" \
%endif
configure.py --bootstrap --verbose
./ninja -v all
%if %{without bootstrap}
./ninja -v manual
%endif
%install
# TODO: Install ninja_syntax.py?
install -Dpm0755 ninja -t %{buildroot}%{_bindir}/
%if %{without bootstrap}
install -Dpm0644 misc/bash-completion %{buildroot}%{_datadir}/bash-completion/completions/ninja
install -Dpm0644 misc/ninja-mode.el %{buildroot}%{_datadir}/emacs/site-lisp/ninja-mode.el
install -Dpm0644 misc/ninja.vim %{buildroot}%{_datadir}/vim/vimfiles/syntax/ninja.vim
install -Dpm0644 %{S:1} %{buildroot}%{_datadir}/vim/vimfiles/ftdetect/ninja.vim
install -Dpm0644 misc/zsh-completion %{buildroot}%{_datadir}/zsh/site-functions/_ninja
%endif
install -Dpm0644 %{S:2} %{buildroot}%{_rpmmacrodir}/macros.ninja
# Macro should not change when we are redefining bindir
@ -54,23 +66,33 @@ sed -i -e "/^%%__ninja /s| .*$| %{_bindir}/ninja|" %{buildroot}%{_rpmmacrodir}/m
ln -s ninja %{buildroot}%{_bindir}/ninja-build
%if %{without bootstrap}
%check
./ninja_test --gtest_filter=-SubprocessTest.SetWithLots
%endif
%files
%license COPYING
%doc HACKING.md README doc/manual.html
%doc HACKING.md README
%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
%{_datadir}/zsh/
%endif
%{rpmmacrodir}/macros.ninja
%changelog
* Wed Feb 05 2020 Björn Esser <besser82@fedoraproject.org> - 1.9.0-5
- Add conditional for bootstrapping new architectures
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild