# mind the upper case 'S' for the name as upstream wants so. %global binary shinobi %global ninja build.ninja %global expect expect.ninja %global sample %{name}-sample # enable verbose ninja debug and statistics %global nflags -v -d explain -d keeprsp -d stats # FIXME ninja is without packagable debuginfo # https://bugzilla.redhat.com/show_bug.cgi?id=1179261 %define debug_package %{nil} %debug_package %{nil} Name: Shinobi Version: 0.9 Release: 4%{?dist} Summary: Meta build system for Ninja License: MIT URL: https://github.com/Rapptz/%{name} Source0: %{url}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz Source10: %{sample} BuildRequires: boost-devel BuildRequires: ninja-build >= 1.3 BuildRequires: dos2unix help2man %description %{name} is a meta build system for Ninja, based on C++11 and boost. It uses an qmake-like structure to configure the output of the %{ninja} file and implicitly creates the directories specified in the %{name} file to circumvent the issue Ninja has with building on non-existing directories. It works by pulling in all .cpp, .cxx, .cc, and .c++ files and making them into basic build commands. There is also support for C by allowing .c extensions. %prep %setup -q # ninja: error: ninja.build:1: carriage returns are not allowed, use newline # rpmlint W: wrong-file-end-of-line-encoding dos2unix -k %{ninja} *.txt *.md %build # save build file for further reference in check section cp %{ninja} %{expect} # FIXME configure: disable bundling, enable debug, locate boost, ignore builddir # https://github.com/Rapptz/Shinobi/issues/1 # https://bugzilla.redhat.com/show_bug.cgi?id=1179261 sed -e 's,-static,,' \ -e 's,\(incflags =\).*,\1 -I. -I%{_includedir}/boost,' \ -e 's,\(builddir =\).*,\1 .,' \ -i %{ninja} CFLAGS="%{optflags}" LDFLAGS="%{?__global_ldflags}" ninja-build %{nflags} %{?_smp_mflags} # generate manpage help2man -o %{binary}.1 --version-string=%{version} ./%{binary} %install mkdir -p %{buildroot}%{_bindir} # execution flag is needed to produce useful -debuginfo install -m0755 %{binary} %{buildroot}%{_bindir} mkdir -p %{buildroot}%{_mandir}/man1 cp -p %{binary}.1 %{buildroot}%{_mandir}/man1 %check # mock a litte test environment and call binary to produce reference file mkdir -p test/obj test/util cp %{SOURCE10} test/%{name} pushd test touch util/parser.cpp %{binary}.cpp ../%{binary} diff ../%{expect} %{ninja} popd %files %doc LICENSE.txt README.md reference.md %{_bindir}/%{binary} %{_mandir}/man1/%{binary}.1* %changelog * Tue Jan 06 2015 Raphael Groner - 0.9-4 - remove explicit Requires - do not enforce compressed manpage - preserve timestamps - use proper flags for debug build * Fri Jan 02 2015 Raphael Groner - 0.9-3 - add manpage - cleanup for review * Sun Dec 21 2014 Raphael Groner - 0.9-2 - improve comments * Fri Dec 19 2014 Raphael Groner - 0.9-1 - initial