threads / patch / 436

patchadd git.spec and adapt Makefile for RPM build

Subject: [PATCH] add git.spec and adapt Makefile for RPM build

## tl;dr

2 messages between May 2, 2005 and May 2, 2005. Diffs are folded; open one to read it.

replies: 1people: 1as markdown or json

Kay Sievers· May 2, 2005, 10:23 UTC · lore
Add support for building the rpm package directly from the git tree.
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
---
Show changes to 2 files +53 −1

Makefile, git.spec

--- a/Makefile
+++ b/Makefile
@@ -7,6 +7,10 @@
 # BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely randomly
 # break unless your underlying filesystem supports those sub-second times
 # (my ext3 doesn't).
+
+prefix=$(HOME)
+bindir=$(prefix)/bin
+
 CFLAGS=-g -O2 -Wall
 
 CC=gcc
@@ -26,7 +30,11 @@ PROG=   git-update-cache git-diff-files 
 all: $(PROG)
 
 install: $(PROG) $(SCRIPTS)
-	install $(PROG) $(SCRIPTS) $(HOME)/bin/
+	install -m755 -d $(DESTDIR)$(bindir)
+	install $(PROG) $(SCRIPTS) $(DESTDIR)$(bindir)
+
+uninstall:
+	cd $(DESTDIR)$(bindir) && rm $(PROG) $(SCRIPTS)
 
 LIB_OBJS=read-cache.o sha1_file.o usage.o object.o commit.o tree.o blob.o \
 	 tag.o date.o
Created: git.spec (mode:100644)
--- /dev/null
+++ b/git.spec
@@ -0,0 +1,44 @@
+Name: 		git
+Version: 	0.7
+Release: 	1
+Vendor: 	Linus Torvalds <torvalds@osdl.org>
+Summary:  	git
+License: 	GPL
+Group: 		Development/Tools
+URL: 		http://www.kernel.org/pub/software/scm/git/
+Source: 	http://www.kernel.org/pub/software/scm/git/%{name}-%{version}.tar.bz2
+Provides: 	git = %{version}
+BuildRequires:	zlib-devel openssl-devel curl-devel
+BuildRoot:	%{_tmppath}/%{name}-%{version}-root
+Prereq: 	sh-utils diffutils
+
+%description
+git is an fast and flexible filesystem-based database designed to store directory
+trees with regard to their history. It is the base for SCM tools bild on top of
+git like cogito.
+
+%prep
+%setup -q -n %{name}-%{version}
+
+%build
+
+make
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make DESTDIR=$RPM_BUILD_ROOT prefix=/usr install
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root)
+/usr/bin/*
+#%{_mandir}/*/*
+
+%changelog
+* Thu May 2 2005 Kay Sievers <kay.sievers@vrfy.org> 0.7-1
+- rpm build for core git
+
+* Thu Apr 21 2005 Chris Wright <chrisw@osdl.org> 0.6.3-1
+- Initial rpm build
Kay Sievers· May 2, 2005, 14:52 UTC · re: Kay Sievers · lore

Re: [PATCH] add git.spec and adapt Makefile for RPM build

On Mon, May 02, 2005 at 12:23:03PM +0200, Kay Sievers wrote:
> Add support for building the rpm package directly from the git tree.

This version creates the git.spec from a git.spec.in with the version number from the Makefile.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
---
Show changes to 2 files +59 −2

Makefile, git.spec.in

--- a/Makefile
+++ b/Makefile
@@ -7,6 +7,12 @@
 # BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely randomly
 # break unless your underlying filesystem supports those sub-second times
 # (my ext3 doesn't).
+
+VERSION = 0.7
+
+prefix=$(HOME)
+bindir=$(prefix)/bin
+
 CFLAGS=-g -O2 -Wall
 
 CC=gcc
@@ -25,8 +31,15 @@ PROG=   git-update-cache git-diff-files 
 
 all: $(PROG)
 
+git.spec: git.spec.in Makefile
+	sed -e 's/@@VERSION@@/$(VERSION)/g' < $< > $@
+
 install: $(PROG) $(SCRIPTS)
-	install $(PROG) $(SCRIPTS) $(HOME)/bin/
+	install -m755 -d $(DESTDIR)$(bindir)
+	install $(PROG) $(SCRIPTS) $(DESTDIR)$(bindir)
+
+uninstall:
+	cd $(DESTDIR)$(bindir) && rm $(PROG) $(SCRIPTS)
 
 LIB_OBJS=read-cache.o sha1_file.o usage.o object.o commit.o tree.o blob.o \
 	 tag.o date.o
@@ -110,7 +123,7 @@ diff.o: $(LIB_H)
 strbuf.o: $(LIB_H)
 
 clean:
-	rm -f *.o mozilla-sha1/*.o ppc/*.o $(PROG) $(LIB_FILE)
+	rm -f *.o mozilla-sha1/*.o ppc/*.o $(PROG) $(LIB_FILE) git.spec
 
 backup: clean
 	cd .. ; tar czvf dircache.tar.gz dir-cache
Created: git.spec.in (mode:100644)
--- /dev/null
+++ b/git.spec.in
@@ -0,0 +1,44 @@
+Name: 		git
+Version: 	@@VERSION@@
+Release: 	1
+Vendor: 	Linus Torvalds <torvalds@osdl.org>
+Summary:  	git
+License: 	GPL
+Group: 		Development/Tools
+URL: 		http://www.kernel.org/pub/software/scm/git/
+Source: 	http://www.kernel.org/pub/software/scm/git/%{name}-%{version}.tar.bz2
+Provides: 	git = %{version}
+BuildRequires:	zlib-devel openssl-devel curl-devel
+BuildRoot:	%{_tmppath}/%{name}-%{version}-root
+Prereq: 	sh-utils diffutils
+
+%description
+git is an fast and flexible filesystem-based database designed to store directory
+trees with regard to their history. It is the base for SCM tools bild on top of
+git like cogito.
+
+%prep
+%setup -q -n %{name}-%{version}
+
+%build
+
+make
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make DESTDIR=$RPM_BUILD_ROOT prefix=/usr install
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root)
+/usr/bin/*
+#%{_mandir}/*/*
+
+%changelog
+* Thu May 2 2005 Kay Sievers <kay.sievers@vrfy.org> 0.7-1
+- rpm build for core git
+
+* Thu Apr 21 2005 Chris Wright <chrisw@osdl.org> 0.6.3-1
+- Initial rpm build

← back to recent threads