Skip to contentSkip to conversation

git-pasky spec file

PATCH Applied Chris Wright 5 participants 8 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 git-pasky spec file

Here's a simple spec file to do rpm builds. It's against the latest Makefile (which has the s/BINDIR/bindir/ change). I've used DESTDIR, although it's not clear it's meant to stay in the Makefile. For now, there's no dynamic (git.spec.in, for example) update to the Version, so it's set against 0.6.3 (expecting it to be forthcoming shortly). It installs to /usr/local/bin, and expects the tarball to be named git-pasky-0.6.3.tar.bz2. Creates a package named git, which seems fine since Linus' isn't likely to be packaged directly. Enjoy.

git.spec new file +43 -0
@@ -0,0 +1,43 @@
+Name: 		git
+Version: 	0.6.3
+Release: 	1
+Vendor: 	Petr Baudis <[email protected]>
+Summary:  	Git core and tools
+License: 	GPL
+Group: 		Development/Tools
+URL: 		http://pasky.or.cz/~pasky/dev/git/
+Source: 	http://pasky.or.cz/~pasky/dev/git/%{name}-pasky-%{version}.tar.bz2
+Provides: 	git = %{version}
+BuildRequires:	zlib-devel openssl-devel
+BuildRoot:	%{_tmppath}/%{name}-%{version}-root
+Prereq: 	sh-utils diffutils
+
+%description
+GIT comes in two layers. The bottom layer is merely an extremely fast
+and flexible filesystem-based database designed to store directory trees
+with regard to their history. The top layer is a SCM-like tool which
+enables human beings to work with the database in a manner to a degree
+similar to other SCM tools (like CVS, BitKeeper or Monotone).
+
+%prep
+%setup -q -n %{name}-pasky-%{version}
+
+%build
+
+make
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make DESTDIR=$RPM_BUILD_ROOT/usr/local/ bindir=bin/ install
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root)
+/usr/local/bin/*
+#%{_mandir}/*/*
+
+%changelog
+* Thu Apr 21 2005 Chris Wright <[email protected]> 0.6.3-1
+- Initial rpm build
Applied
#1 lore raw

Dear diary, on Fri, Apr 22, 2005 at 03:55:21AM CEST, I got a letter where Chris Wright <[email protected]> told me that...

Quoted 8 lines

Here's a simple spec file to do rpm builds. It's against the latest Makefile (which has the s/BINDIR/bindir/ change). I've used DESTDIR, although it's not clear it's meant to stay in the Makefile. For now, there's no dynamic (git.spec.in, for example) update to the Version, so it's set against 0.6.3 (expecting it to be forthcoming shortly). It installs to /usr/local/bin, and expects the tarball to be named git-pasky-0.6.3.tar.bz2. Creates a package named git, which seems fine since Linus' isn't likely to be packaged directly. Enjoy.

Thanks, applied. I'll gladly yet you maintain this file, but...

git.spec line 3

Quoted 6 lines
git.spec new file +3 -0
@@ -0,0 +1,43 @@
+%install
+rm -rf $RPM_BUILD_ROOT
+make DESTDIR=$RPM_BUILD_ROOT/usr/local/ bindir=bin/ install

I doubt this is actually what you want. I suppose you want

make DESTDIR=$RPM_BUILD_ROOT prefix=/usr/local install

instead. This may not matter now, but might well in future when we stuff some of the helper/library scripts to some lib/ or share/ directory, and will actually rewrite some paths somewhere based on $prefix during make install.

Signature · 3 lines
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor
#2 lore raw
Quoted 11 lines · * Petr Baudis ([email protected]) wrote:

Dear diary, on Fri, Apr 22, 2005 at 03:55:21AM CEST, I got a letter where Chris Wright <[email protected]> told me that...

Quoted 8 lines

Here's a simple spec file to do rpm builds. It's against the latest Makefile (which has the s/BINDIR/bindir/ change). I've used DESTDIR, although it's not clear it's meant to stay in the Makefile. For now, there's no dynamic (git.spec.in, for example) update to the Version, so it's set against 0.6.3 (expecting it to be forthcoming shortly). It installs to /usr/local/bin, and expects the tarball to be named git-pasky-0.6.3.tar.bz2. Creates a package named git, which seems fine since Linus' isn't likely to be packaged directly. Enjoy.

Quoted 1 line

Thanks, applied. I'll gladly yet you maintain this file, but...

No problem...

Quoted 10 lines

git.spec line 3

Quoted 6 lines
git.spec new file +3 -0
@@ -0,0 +1,43 @@
+%install
+rm -rf $RPM_BUILD_ROOT
+make DESTDIR=$RPM_BUILD_ROOT/usr/local/ bindir=bin/ install

I doubt this is actually what you want. I suppose you want

make DESTDIR=$RPM_BUILD_ROOT prefix=/usr/local install

Yup, that makes more sense. Feel free to update if you're so inclined.

thanks,
-chris

Signature · 1 line
Linux Security Modules     http://lsm.immunix.org     http://lsm.bkbits.net
#3 lore raw
Quoted 25 lines · Chris Wright
Quoted 11 lines · * Petr Baudis ([email protected]) wrote:

Dear diary, on Fri, Apr 22, 2005 at 03:55:21AM CEST, I got a letter where Chris Wright <[email protected]> told me that...

Quoted 8 lines

Here's a simple spec file to do rpm builds. It's against the latest Makefile (which has the s/BINDIR/bindir/ change). I've used DESTDIR, although it's not clear it's meant to stay in the Makefile. For now, there's no dynamic (git.spec.in, for example) update to the Version, so it's set against 0.6.3 (expecting it to be forthcoming shortly). It installs to /usr/local/bin, and expects the tarball to be named git-pasky-0.6.3.tar.bz2. Creates a package named git, which seems fine since Linus' isn't likely to be packaged directly. Enjoy.

Quoted 1 line

Thanks, applied. I'll gladly yet you maintain this file, but...

No problem...

Quoted 9 lines

git.spec line 3

Quoted 6 lines
git.spec new file +3 -0
@@ -0,0 +1,43 @@
+%install
+rm -rf $RPM_BUILD_ROOT
+make DESTDIR=$RPM_BUILD_ROOT/usr/local/ bindir=bin/ install

I doubt this is actually what you want. I suppose you want

Quoted 3 lines
Quoted 1 line

make DESTDIR=$RPM_BUILD_ROOT prefix=/usr/local install

Yup, that makes more sense. Feel free to update if you're so inclined.

If you're building an RPM, it should go in /usr not /usr/local. /usr/local is for unmanaged (non-RPM) installs.

-Paul

#4 lore raw
Quoted 27 lines · * Paul Dickson ([email protected]) wrote:
Quoted 25 lines · Chris Wright
Quoted 11 lines · * Petr Baudis ([email protected]) wrote:

Dear diary, on Fri, Apr 22, 2005 at 03:55:21AM CEST, I got a letter where Chris Wright <[email protected]> told me that...

Quoted 8 lines

Here's a simple spec file to do rpm builds. It's against the latest Makefile (which has the s/BINDIR/bindir/ change). I've used DESTDIR, although it's not clear it's meant to stay in the Makefile. For now, there's no dynamic (git.spec.in, for example) update to the Version, so it's set against 0.6.3 (expecting it to be forthcoming shortly). It installs to /usr/local/bin, and expects the tarball to be named git-pasky-0.6.3.tar.bz2. Creates a package named git, which seems fine since Linus' isn't likely to be packaged directly. Enjoy.

Quoted 1 line

Thanks, applied. I'll gladly yet you maintain this file, but...

No problem...

Quoted 9 lines

git.spec line 3

Quoted 6 lines
git.spec new file +3 -0
@@ -0,0 +1,43 @@
+%install
+rm -rf $RPM_BUILD_ROOT
+make DESTDIR=$RPM_BUILD_ROOT/usr/local/ bindir=bin/ install

I doubt this is actually what you want. I suppose you want

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

make DESTDIR=$RPM_BUILD_ROOT prefix=/usr/local install

Yup, that makes more sense. Feel free to update if you're so inclined.

If you're building an RPM, it should go in /usr not /usr/local. /usr/local is for unmanaged (non-RPM) installs.

That's not quite the definition for FHS, but I don't mind putting into /usr/bin. I had planned upon doing a /usr/bin/git and helpers in another directory, but with new command name (ala cg-$cmd) then I think they'll all just go in /usr/bin. Other opinions?

thanks,
-chris

#5 lore raw

PATCH 1/1 Eliminate use of mktemp's "-t" option

In reply to Petr Baudis

It turns out that mktemp's "-t" option, while useful, isn't available on many systems (Mandrake & Red Hat Linux 9 at least, and probably piles of others). So, here's a portability patch that removes all use of mktemp's "-t" option. Unlike the quick hack I posted earlier, this should be "clean everywhere" (assuming you have mktemp).

This is a patch against git-pasky 0.6.3.

This is my first attempt to _post_ a patch using git itself,
and I'm not entirely sure how you want it. Let me know
if you have a problem with it!

--- David A. Wheeler

commit 5f926b684025b83e34386bf8e4ef30a97e2ae5ec
tree 61059575269ed1027cfb66543251e182f87d1064
parent dd69ca5f806c8b10bb29ecb8d77c88be007c981c
author David A. Wheeler <[email protected]> 1114138972 -0400 committer David A. Wheeler <[email protected]> 1114138972 -0400

Eliminated use of mktemp's "-t" option; older mktemps don't support it.

README (mode:100644 sha1:80952e2f67b28f64c10cfb913df375a5dd244cd9) renamed from README (mode:100644 sha1:a71b5fbdbdac0bf2e2d021e422b9f49dd5481165) +1 -1
Index: README
===================================================================
@@ -141,7 +141,7 @@
 	C compiler
 	bash
 	basic shell environment (sed, grep, textutils, ...)
-	mktemp 1.5+ (Mandrake users beware!)
+	mktemp
 	diff, patch
 	libssl
 	rsync
gitapply.sh (mode:100755 sha1:14a13ff23cff2a80f9a44c053002f837fec13e2c) renamed from gitapply.sh (mode:100755 sha1:7703809dc0743c6e4c1fa5b7d922a4efc16b4276) +7 -3
Index: gitapply.sh
===================================================================
@@ -8,9 +8,13 @@
 #
 # Takes the diff on stdin.
 
-gonefile=$(mktemp -t gitapply.XXXXXX)
-todo=$(mktemp -t gitapply.XXXXXX)
-patchfifo=$(mktemp -t gitapply.XXXXXX)
+if [ -z "$TMPDIR"]; then
+	TMPDIR=/tmp
+fi
+
+gonefile=$(mktemp "$TMPDIR/gitapply.XXXXXX")
+todo=$(mktemp "$TMPDIR/gitapply.XXXXXX")
+patchfifo=$(mktemp "$TMPDIR/gitapply.XXXXXX")
 rm $patchfifo && mkfifo -m 600 $patchfifo
 
 show-files --deleted >$gonefile
gitcommit.sh (mode:100755 sha1:ee777605dccdc9737cf743f4f8c96b9bacd97f10) renamed from gitcommit.sh (mode:100755 sha1:a13bef2c84492ed75679d7d52bb710df35544f8a) +5 -2
Index: gitcommit.sh
===================================================================
@@ -16,6 +16,9 @@
 	exit 1
 }
 
+if [ -z "$TMPDIR"]; then
+	TMPDIR=/tmp
+fi
 
 [ -s .git/blocked ] && die "committing blocked: $(cat .git/blocked)"
 
@@ -67,7 +70,7 @@
 fi
 
 echo "Enter commit message, terminated by ctrl-D on a separate line:"
-LOGMSG=$(mktemp -t gitci.XXXXXX)
+LOGMSG=$(mktemp "$TMPDIR/gitci.XXXXXX")
 if [ "$merging" ]; then
 	echo -n 'Merge with ' >>$LOGMSG
 	echo -n 'Merge with '
@@ -111,7 +114,7 @@
 if [ ! "$customfiles" ]; then
 	rm -f .git/add-queue .git/rm-queue
 else
-	greptmp=$(mktemp -t gitci.XXXXXX)
+	greptmp=$(mktemp "$TMPDIR/gitci.XXXXXX")
 	for file in $customfiles; do
 		if [ -s .git/add-queue ]; then
 			fgrep -vx "$file" .git/add-queue >$greptmp
gitdiff-do (mode:100755 sha1:caf20ae034b8dc9f88922ee9f82809bb32a56231) renamed from gitdiff-do (mode:100755 sha1:218dfabeb4a5dcbd2cf58bd6f672f385690ec397) +5 -1
Index: gitdiff-do
===================================================================
@@ -32,7 +32,11 @@
 	[ "$labelapp" ] && label="$label  ($labelapp)"
 }
 
-diffdir=$(mktemp -d -t gitdiff.XXXXXX)
+if [ -z "$TMPDIR"]; then
+	TMPDIR=/tmp
+fi
+
+diffdir=$(mktemp -d "$TMPDIR/gitdiff.XXXXXX")
 diffdir1="$diffdir/$id1"
 diffdir2="$diffdir/$id2"
 mkdir "$diffdir1" "$diffdir2"
gitdiff.sh (mode:100755 sha1:278511a3f491ed7d5e41bbd642acfd9b5a1d8257) renamed from gitdiff.sh (mode:100755 sha1:195c3b9962c764855ec6168a78babf5867ea3046) +5 -1
Index: gitdiff.sh
===================================================================
@@ -80,6 +80,10 @@
 	shift
 fi
 
+if [ -z "$TMPDIR"]; then
+	TMPDIR=/tmp
+fi
+
 if [ "$parent" ]; then
 	id2="$id1"
 	id1=$(parent-id "$id2" | head -n 1)
@@ -88,7 +92,7 @@
 
 if [ "$id2" = " " ]; then
 	if [ "$id1" != " " ]; then
-		export GIT_INDEX_FILE=$(mktemp -t gitdiff.XXXXXX)
+		export GIT_INDEX_FILE=$(mktemp "$TMPDIR/gitdiff.XXXXXX")
 		read-tree $(gitXnormid.sh "$id1")
 		update-cache --refresh
 	fi
gitmerge.sh (mode:100755 sha1:1c733bbdb9fe54c41787d962d0f55bb5f67d4c63) renamed from gitmerge.sh (mode:100755 sha1:683755729b6f689ea43c692712fad6e51eeac354) +5 -1
Index: gitmerge.sh
===================================================================
@@ -19,6 +19,10 @@
 	exit 1
 }
 
+if [ -z "$TMPDIR"]; then
+	TMPDIR=/tmp
+fi
+
 head=$(commit-id)
 
 
@@ -58,7 +62,7 @@
 	echo "Fast-forwarding $base -> $branch" >&2
 	echo -e "\ton top of $head..." >&2
 
-	patchfile=$(mktemp -t gitmerge.XXXXXX)
+	patchfile=$(mktemp "$TMPDIR/gitmerge.XXXXXX")
 	gitdiff.sh >$patchfile
 
 	read-tree -m $(tree-id $branch)
#6 lore raw
In reply to Chris Wright
Quoted 1 line · Chris Wright

Here's a simple spec file to do rpm builds.

(snip)

Quoted 2 lines

Creates a package named git, which seems
fine since Linus' isn't likely to be packaged directly.

Um. Really? I can't imagine why Linus's git wouldn't be packaged directly. He has strongly indicated that folks who want to build on top of it should not expect to see libgit any time soon, so git will be an important independent tool.

But presumably you'll change the name of this package to cogito soon anyway, as soon as git-pasky itself is renamed.

Kevin

#7 lore raw
Quoted 2 lines · * Kevin Smith ([email protected]) wrote:

But presumably you'll change the name of this package to cogito soon anyway, as soon as git-pasky itself is renamed.

that's the plan.

thanks,
-chris

Signature · 1 line
Linux Security Modules     http://lsm.immunix.org     http://lsm.bkbits.net