b863fb
# Set to bcond_without or use --with bootstrap,
b863fb
# when bootstrapping a new architecture.
b863fb
%bcond_with bootstrap
b863fb
b863fb
Name:           ninja-build
b863fb
Version:        1.10.2
b863fb
Release:        6%{?dist}
b863fb
Summary:        Small build system with a focus on speed
b863fb
License:        ASL 2.0
b863fb
URL:            https://ninja-build.org/
b863fb
Source0:        https://github.com/ninja-build/ninja/archive/v%{version}/ninja-%{version}.tar.gz
b863fb
Source1:        ninja.vim
b863fb
Source2:        macros.ninja
b863fb
BuildRequires:  gcc-c++
b863fb
%if 0%{?rhel} && 0%{?rhel} <= 7
b863fb
BuildRequires:  python2-devel
b863fb
%else
b863fb
BuildRequires:  python3-devel
b863fb
%endif
b863fb
%if %{without bootstrap}
b863fb
BuildRequires:  asciidoc
b863fb
%endif
b863fb
%if !0%{?rhel}
b863fb
BuildRequires:  re2c >= 0.11.3
b863fb
%endif
b863fb
%if %{without bootstrap}
b863fb
Requires:       emacs-filesystem
b863fb
Requires:       vim-filesystem
b863fb
%endif
b863fb
b863fb
%description
b863fb
Ninja is a small build system with a focus on speed. It differs from other
b863fb
build systems in two major respects: it is designed to have its input files
b863fb
generated by a higher-level build system, and it is designed to run builds as
b863fb
fast as possible.
b863fb
b863fb
%prep
b863fb
%autosetup -n ninja-%{version} -p1
b863fb
b863fb
%build
b863fb
%if 0%{?set_build_flags:1}
b863fb
%{set_build_flags}
b863fb
%else
b863fb
CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS
b863fb
CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS
b863fb
FFLAGS="${FFLAGS:-%optflags%{?_fmoddir: -I%_fmoddir}}" ; export FFLAGS
b863fb
FCFLAGS="${FCFLAGS:-%optflags%{?_fmoddir: -I%_fmoddir}}" ; export FCFLAGS
b863fb
%{?__global_ldflags:LDFLAGS="${LDFLAGS:-%__global_ldflags}" ; export LDFLAGS ;}
b863fb
%endif
b863fb
%if 0%{?rhel} && 0%{?rhel} <= 7
b863fb
%{__python2} \
b863fb
%else
b863fb
%{__python3} \
b863fb
%endif
b863fb
  configure.py --bootstrap --verbose
b863fb
./ninja -v all
b863fb
%if %{without bootstrap}
b863fb
./ninja -v manual
b863fb
%endif
b863fb
b863fb
%install
b863fb
install -Dpm0755 ninja -t %{buildroot}%{_bindir}/
b863fb
%if %{without bootstrap}
b863fb
install -Dpm0644 misc/bash-completion %{buildroot}%{_datadir}/bash-completion/completions/ninja
b863fb
install -Dpm0644 misc/ninja-mode.el %{buildroot}%{_datadir}/emacs/site-lisp/ninja-mode.el
b863fb
install -Dpm0644 misc/ninja.vim %{buildroot}%{_datadir}/vim/vimfiles/syntax/ninja.vim
b863fb
install -Dpm0644 %{S:1} %{buildroot}%{_datadir}/vim/vimfiles/ftdetect/ninja.vim
b863fb
install -Dpm0644 misc/zsh-completion %{buildroot}%{_datadir}/zsh/site-functions/_ninja
b863fb
%if 0%{?rhel} && 0%{?rhel} <= 7
b863fb
install -Dpm0644 misc/ninja_syntax.py %{buildroot}%{python2_sitelib}/ninja_syntax.py
b863fb
%else
b863fb
install -Dpm0644 misc/ninja_syntax.py %{buildroot}%{python3_sitelib}/ninja_syntax.py
b863fb
%endif
b863fb
%endif
b863fb
install -Dpm0644 %{S:2} %{buildroot}%{_rpmmacrodir}/macros.ninja
b863fb
b863fb
# Macro should not change when we are redefining bindir
b863fb
sed -i -e "/^%%__ninja /s| .*$| %{_bindir}/ninja|" %{buildroot}%{_rpmmacrodir}/macros.ninja
b863fb
b863fb
ln -s ninja %{buildroot}%{_bindir}/ninja-build
b863fb
b863fb
%if %{without bootstrap}
b863fb
%check
b863fb
./ninja_test --gtest_filter=-SubprocessTest.SetWithLots
b863fb
%endif
b863fb
b863fb
%files
b863fb
%license COPYING
b863fb
%doc README.md
b863fb
%if %{without bootstrap}
b863fb
%doc doc/manual.html
b863fb
%endif
b863fb
%{_bindir}/ninja
b863fb
%{_bindir}/ninja-build
b863fb
%if %{without bootstrap}
b863fb
%{_datadir}/bash-completion/completions/ninja
b863fb
%{_datadir}/emacs/site-lisp/ninja-mode.el
b863fb
%{_datadir}/vim/vimfiles/syntax/ninja.vim
b863fb
%{_datadir}/vim/vimfiles/ftdetect/ninja.vim
b863fb
# zsh does not have a -filesystem package
b863fb
%{_datadir}/zsh/
b863fb
%if 0%{?rhel} && 0%{?rhel} <= 7
b863fb
%pycached %{python2_sitelib}/ninja_syntax.py
b863fb
%else
b863fb
%pycached %{python3_sitelib}/ninja_syntax.py
b863fb
%endif
b863fb
%endif
b863fb
%{rpmmacrodir}/macros.ninja
b863fb
b863fb
%changelog
b863fb
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 1.10.2-6
b863fb
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
b863fb
  Related: rhbz#1991688
b863fb
b863fb
* Tue May 04 2021 Richard Hughes <rhughes@redhat.com> - 1.10.2-5
b863fb
- Do not BR gtest-devel. It appears completely unused.
b863fb
- Resolves: rhbz#1975974
b863fb
b863fb
* Tue May 04 2021 Richard Hughes <rhughes@redhat.com> - 1.10.2-4
b863fb
- Do not BR re2c on RHEL. It is NTH, and one less package dep to maintain.
b863fb
- Resolves: rhbz#1956954
b863fb
b863fb
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1.10.2-3
b863fb
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
b863fb
b863fb
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.10.2-2
b863fb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
b863fb
b863fb
* Thu Jan 21 2021 Kalev Lember <klember@redhat.com> - 1.10.2-1
b863fb
- Update to 1.10.2
b863fb
b863fb
* Wed Aug 19 2020 Björn Esser <besser82@fedoraproject.org> - 1.10.1-2
b863fb
- Add ninja_syntax.py
b863fb
b863fb
* Wed Aug 19 2020 Igor Raits <ignatenkobrain@fedoraproject.org> - 1.10.1-1
b863fb
- Update to 1.10.1
b863fb
b863fb
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.10.0-2
b863fb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
b863fb
b863fb
* Wed Feb 05 2020 Björn Esser <besser82@fedoraproject.org> - 1.10.0-1
b863fb
- Update to 1.10.0
b863fb
b863fb
* Wed Feb 05 2020 Björn Esser <besser82@fedoraproject.org> - 1.9.0-5
b863fb
- Add conditional for bootstrapping new architectures
b863fb
- Use %%set_build_flags macro to export buildflags, if available
b863fb
b863fb
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.0-4
b863fb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
b863fb
b863fb
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.0-3
b863fb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
b863fb
b863fb
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.0-2
b863fb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
b863fb
b863fb
* Thu Jan 31 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.9.0-1
b863fb
- Update to 1.9.0
b863fb
b863fb
* Thu Aug 16 2018 Owen Taylor <otaylor@redhat.com> - 1.8.2-5
b863fb
- Fix binddir usage in macros.ninja
b863fb
b863fb
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.2-4
b863fb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
b863fb
b863fb
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.8.2-3
b863fb
- Rebuilt for Python 3.7
b863fb
b863fb
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.2-2
b863fb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
b863fb
b863fb
* Tue Sep 12 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.8.2-1
b863fb
- Update to 1.8.2
b863fb
b863fb
* Thu Sep 07 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.8.1-1
b863fb
- Update to 1.8.1
b863fb
b863fb
* Sat Sep 02 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.8.0-1
b863fb
- Update to 1.8.0
b863fb
b863fb
* Tue Aug 01 2017 Kalev Lember <klember@redhat.com> - 1.7.2-6
b863fb
- Backport an upstream patch to handle ostree setting 0 mtime
b863fb
b863fb
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.2-5
b863fb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
b863fb
b863fb
* Fri Apr 21 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.7.2-4
b863fb
- Rename main executable to ninja (#1166135)
b863fb
  (compatibility symlink is added)
b863fb
b863fb
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.2-3
b863fb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
b863fb
b863fb
* Sat Dec 03 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 1.7.2-2
b863fb
- Add EPEL hacks
b863fb
b863fb
* Mon Nov 28 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 1.7.2-1
b863fb
- Update to 1.7.2
b863fb
b863fb
* Mon Oct 10 2016 Igor Gnatenko <ignatenko@redhat.com> - 1.7.1-3
b863fb
- Fix install ninja.vim
b863fb
b863fb
* Sat Oct 08 2016 Igor Gnatenko <ignatenko@redhat.com> - 1.7.1-2
b863fb
- Add RPM macro
b863fb
b863fb
* Sat Jul 23 2016 Ben Boeckel <mathstuf@gmail.com> - 1.7.1-1
b863fb
- update to 1.7.1
b863fb
- fix bash completion for the binary rename (#1352330)
b863fb
- disable test which fails to koji rlimit settings
b863fb
b863fb
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.0-3
b863fb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
b863fb
b863fb
* Mon Nov 16 2015 Ben Boeckel <mathstuf@gmail.com> - 1.6.0-2
b863fb
- Add patch to rename mentions of the binary name
b863fb
b863fb
* Sun Jul 19 2015 Ben Boeckel <mathstuf@gmail.com> - 1.6.0-1
b863fb
- Update to 1.6.0
b863fb
b863fb
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.3-4
b863fb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
b863fb
b863fb
* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 1.5.3-3
b863fb
- Rebuilt for GCC 5 C++11 ABI change
b863fb
b863fb
* Sun Feb 08 2015 Ben Boeckel <mathstuf@gmail.com> - 1.5.3-2
b863fb
- Update bash-completions location
b863fb
b863fb
* Wed Dec 10 2014 Ben Boeckel <mathstuf@gmail.com> - 1.5.3-1
b863fb
- Update to 1.5.3
b863fb
b863fb
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.1-2
b863fb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
b863fb
b863fb
* Tue Aug 05 2014 Christopher Meng <rpm@cicku.me> - 1.5.1-1
b863fb
- Update to 1.5.1
b863fb
b863fb
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.0-2
b863fb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
b863fb
b863fb
* Wed Nov 20 2013 Ben Boeckel <mathstuf@gmail.com> - 1.4.0-1
b863fb
- Update to 1.4.0
b863fb
b863fb
* Sun Nov  3 2013 Ville Skyttä <ville.skytta@iki.fi> - 1.3.4-4
b863fb
- Use special %%doc to install all docs (#994005).
b863fb
b863fb
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.4-3
b863fb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
b863fb
b863fb
* Fri Jun 21 2013 Dan Horák <dan[at]danny.cz> - 1.3.4-2
b863fb
- workaround possible too low limits for number of processes and open files,
b863fb
  fixes build on ppc/ppc64 and s390(x)
b863fb
b863fb
* Sun Jun 09 2013 Ben Boeckel <mathstuf@gmail.com> - 1.3.4-1
b863fb
- Update to 1.3.4
b863fb
- Run test suite
b863fb
b863fb
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0-2
b863fb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
b863fb
b863fb
* Sun Nov 04 2012 Ben Boeckel <mathstuf@gmail.com> - 1.0.0-1
b863fb
- Update to 1.0.0
b863fb
b863fb
* Thu Jul 19 2012 Ben Boeckel <mathstuf@gmail.com> - 0-0.6.20120719git5dc55a3
b863fb
- Update to new snapshot
b863fb
b863fb
* Mon Jul 09 2012 Ben Boeckel <mathstuf@gmail.com> - 0-0.5.20120709gitb90d038
b863fb
- Preserve timestamps on install
b863fb
- Install as ninja-build to avoid conflicts with the ninja IRC package
b863fb
- Update snapshot
b863fb
b863fb
* Tue Jun 19 2012 Ben Boeckel <mathstuf@gmail.com> - 0-0.4.20120605git54553d3
b863fb
- Add an ftdetect file for ninja
b863fb
- Fix zsh-stuff directory ownership
b863fb
b863fb
* Thu Jun 07 2012 Ben Boeckel <mathstuf@gmail.com> - 0-0.3.20120605git54553d3
b863fb
- Add a Group tag
b863fb
b863fb
* Tue Jun 05 2012 Ben Boeckel <mathstuf@gmail.com> - 0-0.2.20120605git54553d3
b863fb
- Update to new snapshot
b863fb
b863fb
* Fri Mar 30 2012 Ben Boeckel <mathstuf@gmail.com> - 0-0.1.20120330gitabd33d5
b863fb
- Initial package