summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7378560)
raw | patch | inline | side by side (parent: 7378560)
author | Jakub Narebski <jnareb@gmail.com> | |
Thu, 31 May 2007 09:20:05 +0000 (11:20 +0200) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Thu, 31 May 2007 09:20:05 +0000 (11:20 +0200) |
Adds RPM_VERSION to Makefile and new make targets: tig.spec, dist, and
rpm. A simple 'make rpm' will build the rpm. Also adds tig.spec.in
which is used to generate tig.spec.
Accidentally VERSION (and adding -DVERSION=$(VERSION) to CFLAGS) is
now defined always, even if we do not compile from the "live" tig
repository.
Minimally tested (meaning "make rpm" from tig repository works).
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
rpm. A simple 'make rpm' will build the rpm. Also adds tig.spec.in
which is used to generate tig.spec.
Accidentally VERSION (and adding -DVERSION=$(VERSION) to CFLAGS) is
now defined always, even if we do not compile from the "live" tig
repository.
Minimally tested (meaning "make rpm" from tig repository works).
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
.gitignore | patch | blob | history | |
Makefile | patch | blob | history | |
tig.spec.in | [new file with mode: 0644] | patch | blob |
diff --git a/.gitignore b/.gitignore
index 8f6aa93442de87e91d305c98919b46eaf26e205c..f7ab8409e7fa73091dd74a14874bfd6c15e156de 100644 (file)
--- a/.gitignore
+++ b/.gitignore
manual.pdf
manual.toc
tig
+tig.spec
+tig-*.tar.gz
diff --git a/Makefile b/Makefile
index 9f2d086324873c1f2987721951eeea1bad05f47f..ad01d12b8da73317cc3424c02bf2c4873ee94924 100644 (file)
--- a/Makefile
+++ b/Makefile
else
VERSION = $(shell test -f VERSION && cat VERSION || echo "unknown-version")
endif
+RPM_VERSION = $(subst -,.,$(VERSION))
LDLIBS = -lcurses
CFLAGS = -Wall -O2 '-DVERSION="$(VERSION)"'
DOCS = $(DOCS_MAN) $(DOCS_HTML) \
manual.toc manual.pdf
+TARNAME = tig-$(RPM_VERSION)
+
all: $(PROGS)
all-debug: $(PROGS)
all-debug: CFLAGS += $(DFLAGS)
clean:
rm -rf manual.html-chunked
rm -f $(PROGS) $(DOCS) core *.xml
+ rm -f *.spec
+ rm -rf $(TARNAME)
+ rm -f $(TARNAME).tar.gz
spell-check:
aspell --lang=en --check tig.1.txt tigrc.5.txt manual.txt
strip: all
strip $(PROGS)
-.PHONY: all all-debug doc doc-man doc-html install install-doc install-doc-man install-doc-html clean spell-check
+dist: tig.spec
+ git-archive --format=tar --prefix=$(TARNAME)/ HEAD > $(TARNAME).tar
+ @mkdir -p $(TARNAME)
+ @cp tig.spec $(TARNAME)
+ tar rf $(TARNAME).tar $(TARNAME)/tig.spec
+ @rm -rf $(TARNAME)
+ gzip -f -9 $(TARNAME).tar
+
+rpm: dist
+ rpmbuild -ta $(TARNAME).tar.gz
+
+.PHONY: all all-debug doc doc-man doc-html install install-doc install-doc-man install-doc-html clean spell-check dist rpm
+
+tig.spec: tig.spec.in
+ sed -e 's/@@VERSION@@/$(RPM_VERSION)/g' < $< > $@+
+ mv $@+ $@
+
+tig: tig.c
manual.html: manual.toc
manual.toc: manual.txt
*) ref="$$ref, $$line" ;; \
esac; done | sed 's/\[\[\(.*\)\]\]/\1/' > $@
-tig: tig.c
-
README.html: README
asciidoc -b xhtml11 -d article -a readme $<
diff --git a/tig.spec.in b/tig.spec.in
--- /dev/null
+++ b/tig.spec.in
@@ -0,0 +1,56 @@
+# -*- mode: rpm-spec-mode; encoding: utf-8; -*-
+# Pass '--without docs' to rpmbuild if you don't want the documentation
+
+Summary: Tig: text-mode interface for git
+Name: tig
+Version: @@VERSION@@
+Release: 1%{?dist}
+License: GPL
+Group: Development/Tools
+Vendor: Jonas Fonseca <fonseca@diku.dk>
+URL: http://jonas.nitro.dk/tig/
+Source: http://jonas.nitro.dk/tig/releases/%{name}-%{version}.tar.gz
+BuildRequires: ncurses-devel%{!?_without_docs:, xmlto, asciidoc > 6.0.3, /usr/bin/docbook2pdf}
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+Requires: git-core, ncurses
+
+%description
+Tig is a git repository browser that additionally can act as a pager
+for output from various git commands.
+
+When browsing repositories, it uses the underlying git commands to
+present the user with various views, such as summarized revision log
+and showing the commit with the log message, diffstat, and the diff.
+
+Using it as a pager, it will display input from stdin and colorize it.
+
+%prep
+%setup -q
+
+%build
+CFLAGS="$RPM_OPT_FLAGS -DVERSION=tig-%{version}-%{release}"
+%{__make} %{_smp_mflags} \
+ prefix=%{_prefix} \
+ all %{!?_without_docs: doc}
+
+%install
+[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
+CFLAGS="$RPM_OPT_FLAGS -DVERSION=tig-%{version}-%{release}"
+%{__make} %{_smp_mflags} DESTDIR=$RPM_BUILD_ROOT \
+ prefix=%{_prefix} bindir=%{_bindir} mandir=%{_mandir} \
+ install %{!?_without_docs: install-doc-man}
+
+%clean
+[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root)
+%{_bindir}/*
+%doc README COPYING INSTALL SITES BUGS TODO tigrc
+%{!?_without_docs: %{_mandir}/man1/*.1*}
+%{!?_without_docs: %{_mandir}/man5/*.5*}
+%{!?_without_docs: %doc *.html *.pdf}
+
+%changelog
+* Mon May 28 2007 Jakub Narebski <jnareb@gmail.com>
+- Initial tig spec file