Dag Wieers wrote:
But the other problem is the amount of work to look at patches, move them
over to the subversion and integrate them. For that reason I would be very
interested to loo at git and see if we can migrate to git in the very
short term.

In that case you might be interested in a new specfile for git.
The current rpmforge git rpm is quite broken so instead I've been maintaining an rpmforge style RHEL friendly fork of the upstream specfile.

I'm attaching the specfile and two patches.

Things to note is:
Some formatting of the specfile has been kept to try and reduce the diff with upstream. Upstream depends on asciidoc 7.x to build manpages, I decided to remove that dependency and use the manpages that upstream ship in a separate tarball. Upstream also includes HTML documentation but since I find that less useful I cut that out. The -cvs subpackage depends on cvsps (for git-cvsimport) which is not currently in rpmforge. I suggest you import the EPEL version of cvsps or turn __without_cvs into __with_cvs. A few tests do not work on RHEL 2.1 and I use a small patch to disable one of them (rm takes care of the other). The patch for t9700/test.pl is necessary for RHEL 3, however after some prodding the issue has been fixed upstream and 1.6.0.3 will have a better fix in place. For some reason subversion-perl 1.1.4 fails the testsuite on el4/x86_64 but works fine on el4/i386, this should not be a problem for rpmforge since a newer subversion-perl is in the repository.

-tgc


%{?dtag: %{expand: %%define %dtag 1}}

%define perl_vendorlib %(eval "`%{__perl} -V:installvendorlib`"; echo 
$installvendorlib)
%define perl_vendorarch %(eval "`%{__perl} -V:installvendorarch`"; echo 
$installvendorarch)

%{?el2:%define _with_old_makemaker 1}
%{?el2:%define _without_curl 1}
%{?el2:%define _without_gui 1}
%{?el2:%define _without_module_compat 1}
%{?el2:%define _without_svn 1}
%{?el3:%define _with_old_makemaker 1}
%{?el3:%define _without_gui 1}

Name:           git
Version:        1.6.0.2
Release:        1
Summary:        Core git tools
License:        GPL
Group:          Development/Tools
URL:            http://kernel.org/pub/software/scm/git/
Source:         
http://kernel.org/pub/software/scm/git/%{name}-%{version}.tar.bz2
Source1:        
http://kernel.org/pub/software/scm/git/git-manpages-%{version}.tar.bz2
Patch0:         git-1.6.0.2-t7501-no-interactive.patch
Patch1:         git-1.6.0.1-t9700-test.pl.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  zlib-devel, openssl-devel, expat-devel
BuildRequires:  gnupg
%{!?_without_curl:BuildRequires:        curl-devel >= 7.9.8}
Requires:       perl-Git = %{version}-%{release}
Requires:       rsync, less
Provides:       git-core = %{version}-%{release}
Obsoletes:      git-core <= 1.5.4.2
Obsoletes:      git-p4

%description
Git is a fast, scalable, distributed revision control system with an
unusually rich command set that provides both high-level operations
and full access to internals.

The git rpm installs the core tools with minimal dependencies.  To
install all git packages, including tools for integrating with other
SCMs, install the git-all meta-package.

%package all
Summary:        Meta-package to pull in all git tools
Group:          Development/Tools
Requires:       git = %{version}-%{release}
Requires:       git-email = %{version}-%{release}
%{!?_without_svn:Requires:      git-svn = %{version}-%{release}}
%{!?_without_cvs:Requires:      git-cvs = %{version}-%{release}}
%{!?_without_gui:Requires:      gitk = %{version}-%{release}}
%{!?_without_gui:Requires:      git-gui = %{version}-%{release}}
%{?_with_arch:Requires: git-arch = %{version}-%{release}}
Obsoletes:      git <= 1.5.4.2

%description all
Git is a fast, scalable, distributed revision control system with an
unusually rich command set that provides both high-level operations
and full access to internals.

This is a dummy package which brings in all subpackages.

%if %{!?_without_svn:1}0
%package svn
Summary:        Git tools for importing Subversion repositories
Group:          Development/Tools
BuildRequires:  subversion-perl >= 1.1.0
Requires:       git = %{version}-%{release}, subversion-perl >= 1.1.0
%description svn
Git tools for importing Subversion repositories.
%endif

%if %{!?_without_cvs:1}0
%package cvs
Summary:        Git tools for importing CVS repositories
Group:          Development/Tools
BuildRequires:  cvs
Requires:       git = %{version}-%{release}, cvs, cvsps
%description cvs
Git tools for importing CVS repositories.
%endif

%if %{?_with_arch:1}0
%package arch
Summary:        Git tools for importing Arch repositories
Group:          Development/Tools
Requires:       git = %{version}-%{release}, tla
%description arch
Git tools for importing Arch repositories.
%endif

%package email
Summary:        Git tools for sending email
Group:          Development/Tools
Requires:       git = %{version}-%{release} 
%description email
Git tools for sending email.

%if %{!?_without_gui:1}0
%package gui
Summary:        Git GUI tool
Group:          Development/Tools
BuildRequires:  gettext
Requires:       git = %{version}-%{release}, tk >= 8.4
%description gui
Git GUI tool

%package -n gitk
Summary:        Git revision tree visualiser ('gitk')
Group:          Development/Tools
BuildRequires:  gettext
Requires:       git = %{version}-%{release}, tk >= 8.4
%description -n gitk
Git revision tree visualiser ('gitk')
%endif

%package -n perl-Git
Summary:        Perl interface to Git
Group:          Development/Libraries
Requires:       git = %{version}-%{release}
%{!?_without_module_compat:Requires:       perl(:MODULE_COMPAT_%(eval 
"`%{__perl} -V:version`"; echo $version))}
BuildRequires:  perl(ExtUtils::MakeMaker), perl(Error)

%description -n perl-Git
Perl interface to Git

%define path_settings ETC_GITCONFIG=%{_sysconfdir}/gitconfig prefix=%{_prefix} 
mandir=%{_mandir}

%prep
%setup

# Some tests fail on el2 because perl is too old
%{?el2:%{__rm} -f t/t3701-add-interactive.sh}
%{?el2:%patch0 -p1}
%patch1 -p1

%build
make %{_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" %{?_without_curl:NO_CURL=YES} 
%{?_without_gui:NO_TCLTK=YES} \
     %{path_settings} \
     all

cd perl
%{__perl} Makefile.PL PREFIX="%{?_with_old_makemaker:%{buildroot}}%{_prefix}" 
INSTALLDIRS="vendor"
cd -

%install
rm -rf $RPM_BUILD_ROOT
make %{_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" DESTDIR=$RPM_BUILD_ROOT 
%{?_without_curl:NO_CURL=YES} %{?_without_gui:NO_TCLTK=YES} \
     %{path_settings} \
     PREFIX=%{?_with_old_makemaker:%{buildroot}}%{_prefix} \
     INSTALLDIRS=vendor install

%{__mkdir} -p %{buildroot}%{_mandir}
cd %{buildroot}%{_mandir}
tar xvjf %{SOURCE1}
%if %{?_without_gui:1}0
%{__rm} -f man1/git-citool.1*
%{__rm} -f man1/git-gui.1*
%{__rm} -f man1/gitk.1*
%endif
cd -

# We must own system global configfile
%{__mkdir} -p %{buildroot}/%{_sysconfdir}
touch %{buildroot}/%{_sysconfdir}/gitconfig

find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} ';'
find $RPM_BUILD_ROOT -type f -name '*.bs' -empty -exec rm -f {} ';'
find $RPM_BUILD_ROOT -type f -name perllocal.pod -exec rm -f {} ';'

# Nuke any traces of a private copy of perl(Error)
find $RPM_BUILD_ROOT -type f -name Error.pm -exec rm -f {} ';'
find $RPM_BUILD_ROOT -type f -name private-Error.3pm* -exec rm -f {} ';'

(find $RPM_BUILD_ROOT%{_bindir} -type f | grep -vE 
"archimport|svn|cvs|email|gitk|git-gui|git-citool" | sed -e [EMAIL 
PROTECTED]@@) > bin-man-doc-files
(find $RPM_BUILD_ROOT%{_libexecdir}/git-core -type f | grep -vE 
"archimport|svn|cvs|email|gitk|git-gui|git-citool" | sed -e [EMAIL 
PROTECTED]@@) >> bin-man-doc-files
(find $RPM_BUILD_ROOT%{_mandir} -type f | grep -vE 
"archimport|svn|git-cvs|email|gitk|git-gui|git-citool" | sed -e [EMAIL 
PROTECTED]@@ -e 's/$/*/' ) >> bin-man-doc-files
(find $RPM_BUILD_ROOT%{perl_vendorlib} -type f | sed -e [EMAIL PROTECTED]@@) >> 
perl-files

# Find files for git-arch
(find $RPM_BUILD_ROOT%{_libexecdir}/git-core -type f | grep -E "archimport" | 
sed -e [EMAIL PROTECTED]@@) > archimport-files
(find $RPM_BUILD_ROOT%{_mandir} -type f | grep -E "archimport" | sed -e [EMAIL 
PROTECTED]@@ -e 's/$/*/' ) >> archimport-files
%if %{!?_with_arch:1}0
for x in `cat archimport-files`
do
    %{__rm} -f %{buildroot}/$x
done
%endif

# Find files for git-svn
(find $RPM_BUILD_ROOT%{_libexecdir}/git-core -type f | grep -E "svn" | sed -e 
[EMAIL PROTECTED]@@) > svn-files
(find $RPM_BUILD_ROOT%{_mandir} -type f | grep -E "svn" | sed -e [EMAIL 
PROTECTED]@@ -e 's/$/*/' ) >> svn-files
%if %{?_without_svn:1}0
for x in `cat svn-files`
do
    %{__rm} -f %{buildroot}/$x
done
%endif

# Find files for git-cvs
(find $RPM_BUILD_ROOT%{_libexecdir}/git-core -type f | grep -E "cvs" | sed -e 
[EMAIL PROTECTED]@@) > cvs-files
(find $RPM_BUILD_ROOT%{_mandir} -type f | grep -E "cvs" | sed -e [EMAIL 
PROTECTED]@@ -e 's/$/*/' ) >> cvs-files
%if %{?_without_cvs:1}0
for x in `cat cvs-files`
do
    %{__rm} -f %{buildroot}/$x
done
%endif

%check || :
make %{_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" %{?_without_curl:NO_CURL=YES} 
%{?_without_gui:NO_TCLTK=YES} \
     %{path_settings} \
     test

%clean
rm -rf $RPM_BUILD_ROOT

%files -f bin-man-doc-files
%defattr(-,root,root)
%{_datadir}/git-core/
%doc README COPYING Documentation/*.txt
%config(noreplace) %ghost %{_sysconfdir}/gitconfig

%if %{!?_without_svn:1}0
%files svn -f svn-files
%defattr(-,root,root)
%endif

%if %{!?_without_cvs:1}0
%files cvs -f cvs-files
%defattr(-,root,root)
%endif

%if %{?_with_arch:1}0
%files arch -f archimport-files
%defattr(-,root,root)
%endif

%files email
%defattr(-,root,root)
%{_libexecdir}/git-core/*email*
%{_mandir}/man1/*email*.1*

%if %{!?_without_gui:1}0
%files gui
%defattr(-,root,root)
%{_libexecdir}/git-core/git-gui
%{_libexecdir}/git-core/git-citool
%{_mandir}/man1/git-gui.1*
%{_mandir}/man1/git-citool.1*
%{_datadir}/git-gui/

%files -n gitk
%defattr(-,root,root)
%{_bindir}/*gitk*
%{_mandir}/man1/*gitk*.1*
%{_datadir}/gitk/
%endif

%files -n perl-Git -f perl-files
%defattr(-,root,root)

%files all
# No files for you!

%changelog
* Mon Sep 15 2008 Tom G. Christensen <[EMAIL PROTECTED]> - 1.6.0.2-1
- Update to 1.6.0.2
- Reenable git-svn for el3.

* Mon Sep  1 2008 Tom G. Christensen <[EMAIL PROTECTED]> - 1.6.0.1-2
- Disable git-svn for el3 (File::Temp too old)
- Add patch from Brandon Casey to fix t9700 on el3 (File::Temp too old)

* Fri Aug 29 2008 Tom G. Christensen <[EMAIL PROTECTED]> - 1.6.0.1-1
- Update to 1.6.0.1

* Wed Aug  6 2008 Tom G. Christensen <[EMAIL PROTECTED]> - 1.5.6.4-1
- Update to 1.5.6.4

* Fri Jul  4 2008 Tom G. Christensen <[EMAIL PROTECTED]> - 1.5.6.1-3
- Update to 1.5.6.1

* Fri Jun 13 2008 Tom G. Christensen <[EMAIL PROTECTED]> - 1.5.5.4-1
- Update to 1.5.5.4

* Fri Jun  6 2008 Tom G. Christensen <[EMAIL PROTECTED]> - 1.5.5.3-3
- Make the git package own the default global gitconfig
- git-clone.sh requires curl for http fetch
- Add cvs and gnupg BRs to run more of the testsuite

* Mon Jun  2 2008 Tom G. Christensen <[EMAIL PROTECTED]> - 1.5.5.3-2
- Update to 1.5.5.3
- Don't build git-svn packages for el2
- Don't build git-arch packages unless --with arch was given

* Fri May 23 2008 Tom G. Christensen <[EMAIL PROTECTED]> - 1.5.5.1-2
- Update to 1.5.5.1
- Don't build gitk and gui packages for el2, el3 since tcl is too old anyway
- Add %%check
- remove mktemp, sh-utils and diffutils Requires
- git-svn requires atleast subversion-perl 1.1.0
- Sync with upstream spec
  - rename git to git-all and git-core to git

* Thu Jan 10 2008 Tom G. Christensen <[EMAIL PROTECTED]> - 1.5.3.8-5
- Update to 1.5.3.8
- Removed p4import
- Bump curl BR to 7.9.8 as Makefile suggests
- Workaround old MakeMaker (no DESTDIR support)

* Thu Aug 23 2007 Tom G. Christensen <[EMAIL PROTECTED]> - 1.5.2.5-4
- Remove dead sections of the specfile
- Remove all explicit requires picked up by autodeps
- Allow clean building on RHEL 3,4,5
- Add upstream pre-compiled manpages
- Remove all doc lines depending on asciidoc
- Add missing perl directory macros

* Tue May 13 2007 Quy Tonthat <[EMAIL PROTECTED]>
- Added lib files for git-gui
- Added Documentation/technical (As needed by Git Users Manual)

* Tue May 8 2007 Quy Tonthat <[EMAIL PROTECTED]>
- Added howto files

* Tue Mar 27 2007 Eygene Ryabinkin <[EMAIL PROTECTED]>
- Added the git-p4 package: Perforce import stuff.

* Mon Feb 13 2007 Nicolas Pitre <[EMAIL PROTECTED]>
- Update core package description (Git isn't as stupid as it used to be)

* Mon Feb 12 2007 Junio C Hamano <[EMAIL PROTECTED]>
- Add git-gui and git-citool.

* Mon Nov 14 2005 H. Peter Anvin <[EMAIL PROTECTED]> 0.99.9j-1
- Change subpackage names to git-<name> instead of git-core-<name>
- Create empty root package which brings in all subpackages
- Rename git-tk -> gitk

* Thu Nov 10 2005 Chris Wright <[EMAIL PROTECTED]> 0.99.9g-1
- zlib dependency fix
- Minor cleanups from split
- Move arch import to separate package as well

* Tue Sep 27 2005 Jim Radford <[EMAIL PROTECTED]>
- Move programs with non-standard dependencies (svn, cvs, email)
  into separate packages

* Tue Sep 27 2005 H. Peter Anvin <[EMAIL PROTECTED]>
- parallelize build
- COPTS -> CFLAGS

* Fri Sep 16 2005 Chris Wright <[EMAIL PROTECTED]> 0.99.6-1
- update to 0.99.6

* Fri Sep 16 2005 Horst H. von Brand <[EMAIL PROTECTED]>
- Linus noticed that less is required, added to the dependencies

* Sun Sep 11 2005 Horst H. von Brand <[EMAIL PROTECTED]>
- Updated dependencies
- Don't assume manpages are gzipped

* Thu Aug 18 2005 Chris Wright <[EMAIL PROTECTED]> 0.99.4-4
- drop sh_utils, sh-utils, diffutils, mktemp, and openssl Requires
- use RPM_OPT_FLAGS in spec file, drop patch0

* Wed Aug 17 2005 Tom "spot" Callaway <[EMAIL PROTECTED]> 0.99.4-3
- use dist tag to differentiate between branches
- use rpm optflags by default (patch0)
- own %{_datadir}/git-core/

* Mon Aug 15 2005 Chris Wright <[EMAIL PROTECTED]>
- update spec file to fix Buildroot, Requires, and drop Vendor

* Sun Aug 07 2005 Horst H. von Brand <[EMAIL PROTECTED]>
- Redid the description
- Cut overlong make line, loosened changelog a bit
- I think Junio (or perhaps OSDL?) should be vendor...

* Thu Jul 14 2005 Eric Biederman <[EMAIL PROTECTED]>
- Add the man pages, and the --without docs build option

* Wed Jul 7 2005 Chris Wright <[EMAIL PROTECTED]>
- initial git spec file
diff -urN git-1.6.0.1.pristine/t/t9700/test.pl git-1.6.0.1/t/t9700/test.pl
--- git-1.6.0.1.pristine/t/t9700/test.pl	2008-08-25 01:41:58.000000000 +0200
+++ git-1.6.0.1/t/t9700/test.pl	2008-09-01 13:19:51.000000000 +0200
@@ -38,7 +38,7 @@
 # Failure cases for config:
 # Save and restore STDERR; we will probably extract this into a
 # "dies_ok" method and possibly move the STDERR handling to Git.pm.
-open our $tmpstderr, ">&", STDERR or die "cannot save STDERR"; close STDERR;
+open our $tmpstderr, ">&STDERR" or die "cannot save STDERR"; close STDERR;
 eval { $r->config("test.dupstring") };
 ok($@, "config: duplicate entry in scalar context fails");
 eval { $r->config_bool("test.boolother") };
@@ -69,18 +69,18 @@
 
 # objects and hashes
 ok(our $file1hash = $r->command_oneline('rev-parse', "HEAD:file1"), "(get file hash)");
-our $tmpfile = File::Temp->new;
+our ($tmpfile, $tmpnam) = File::Temp::tempfile();
 is($r->cat_blob($file1hash, $tmpfile), 15, "cat_blob: size");
 our $blobcontents;
 { local $/; seek $tmpfile, 0, 0; $blobcontents = <$tmpfile>; }
 is($blobcontents, "changed file 1\n", "cat_blob: data");
 seek $tmpfile, 0, 0;
-is(Git::hash_object("blob", $tmpfile), $file1hash, "hash_object: roundtrip");
-$tmpfile = File::Temp->new();
+is(Git::hash_object("blob", $tmpnam), $file1hash, "hash_object: roundtrip");
+($tmpfile, $tmpnam) = File::Temp::tempfile();
 print $tmpfile my $test_text = "test blob, to be inserted\n";
-like(our $newhash = $r->hash_and_insert_object($tmpfile), qr/[0-9a-fA-F]{40}/,
+like(our $newhash = $r->hash_and_insert_object($tmpnam), qr/[0-9a-fA-F]{40}/,
      "hash_and_insert_object: returns hash");
-$tmpfile = File::Temp->new;
+$tmpfile = File::Temp::tempfile();
 is($r->cat_blob($newhash, $tmpfile), length $test_text, "cat_blob: roundtrip size");
 { local $/; seek $tmpfile, 0, 0; $blobcontents = <$tmpfile>; }
 is($blobcontents, $test_text, "cat_blob: roundtrip data");
--- git-1.6.0.2/t/t7501-commit.sh.interactive	2008-09-15 12:17:45.000000000 +0200
+++ git-1.6.0.2/t/t7501-commit.sh	2008-09-15 12:29:00.000000000 +0200
@@ -120,10 +120,6 @@
 	 git commit -m 'author' --author 'Rubber Duck <[EMAIL PROTECTED]>' -a"
 
 test_expect_success \
-	"interactive add" \
-	"echo 7 | git commit --interactive | grep 'What now'"
-
-test_expect_success \
 	"showing committed revisions" \
 	"git rev-list HEAD >current"
 
_______________________________________________
users mailing list
[email protected]
http://lists.rpmforge.net/mailman/listinfo/users

Reply via email to