diff options
author | Evan Martin <martine@danga.com> | 2012-07-27 16:45:06 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2012-07-27 16:45:06 (GMT) |
commit | 7bf35410b7c16f939c0f94a918065072c68bed1f (patch) | |
tree | 0e94bbb1e39f76698e077e992c2bd9a2a09400fe | |
parent | 83d5629c04a055a5794b3bfa8ef9b0ba8d97d816 (diff) | |
parent | 0cd552c0dc7b2aa1da692737f0f7d257b08ecdbc (diff) | |
download | Ninja-7bf35410b7c16f939c0f94a918065072c68bed1f.zip Ninja-7bf35410b7c16f939c0f94a918065072c68bed1f.tar.gz Ninja-7bf35410b7c16f939c0f94a918065072c68bed1f.tar.bz2 |
Merge pull request #369 from maximuska/proposed/packaging-rpm
packaging: added basic RPM building
-rwxr-xr-x | configure.py | 20 | ||||
-rw-r--r-- | misc/packaging/ninja.spec | 33 |
2 files changed, 53 insertions, 0 deletions
diff --git a/configure.py b/configure.py index bf2596c..b8c6d86 100755 --- a/configure.py +++ b/configure.py @@ -386,6 +386,26 @@ n.comment('Build only the main binary by default.') n.default(ninja) n.newline() +if host == 'linux': + n.comment('Packaging') + n.rule('rpmbuild', + command="rpmbuild \ + --define 'ver git' \ + --define \"rel `git rev-parse --short HEAD`\" \ + --define '_topdir %(pwd)/rpm-build' \ + --define '_builddir %{_topdir}' \ + --define '_rpmdir %{_topdir}' \ + --define '_srcrpmdir %{_topdir}' \ + --define '_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm' \ + --define '_specdir %{_topdir}' \ + --define '_sourcedir %{_topdir}' \ + --quiet \ + -bb misc/packaging/ninja.spec", + description='Building RPM..') + n.build('rpm', 'rpmbuild', + implicit=['ninja','README', 'COPYING', doc('manual.html')]) + n.newline() + n.build('all', 'phony', all_targets) print 'wrote %s.' % BUILD_FILENAME diff --git a/misc/packaging/ninja.spec b/misc/packaging/ninja.spec new file mode 100644 index 0000000..d513c6d --- /dev/null +++ b/misc/packaging/ninja.spec @@ -0,0 +1,33 @@ +Summary: Ninja is a small build system with a focus on speed. +Name: ninja +Version: %{ver} +Release: %{rel}%{?dist} +Group: Development/Tools +License: Apache 2.0 +URL: https://github.com/martine/ninja + +%description +Ninja is yet another build system. It takes as input the interdependencies of files (typically source code and output executables) and +orchestrates building them, quickly. + +Ninja joins a sea of other build systems. Its distinguishing goal is to be fast. It is born from my work on the Chromium browser project, +which has over 30,000 source files and whose other build systems (including one built from custom non-recursive Makefiles) can take ten +seconds to start building after changing one file. Ninja is under a second. + +%build +# Assuming we've bootstrapped already.. +../ninja manual ninja -C .. + +%install +mkdir -p %{buildroot}%{_bindir} %{buildroot}%{_docdir} +cp -p ../ninja %{buildroot}%{_bindir}/ +git log --oneline --pretty=format:'%h: %s (%an, %cd)' --abbrev-commit --all > GITLOG + +%files +%defattr(-, root, root) +%doc GITLOG ../COPYING ../README ../doc/manual.html +%{_bindir}/* + +%clean +mv %{_topdir}/*.rpm .. +rm -rf %{_topdir} |