From 7878b383d6c87824d7c33fa5bfcd0c38aa3f51f5 Mon Sep 17 00:00:00 2001 From: Eygene Ryabinkin Date: Tue, 27 Mar 2007 14:26:01 +0400 Subject: [PATCH 1/4] Add the WITH_P4IMPORT knob to the Makefile. WITH_P4IMPORT: enables the installation of the Perforce import script. Signed-off-by: Eygene Ryabinkin Signed-off-by: Junio C Hamano --- Makefile | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Makefile b/Makefile index b159ffd0a..bc8b70bf1 100644 --- a/Makefile +++ b/Makefile @@ -110,6 +110,8 @@ all:: # Define NO_PERL_MAKEMAKER if you cannot use Makefiles generated by perl's # MakeMaker (e.g. using ActiveState under Cygwin). # +# Define WITH_P4IMPORT to build and install Python git-p4import script. +# GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE @$(SHELL_PATH) ./GIT-VERSION-GEN @@ -196,9 +198,20 @@ SCRIPT_PERL = \ git-svnimport.perl git-cvsexportcommit.perl \ git-send-email.perl git-svn.perl +SCRIPT_PYTHON = \ + git-p4import.py + +ifdef WITH_P4IMPORT SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \ $(patsubst %.perl,%,$(SCRIPT_PERL)) \ + $(patsubst %.py,%,$(SCRIPT_PYTHON)) \ git-status git-instaweb +else +SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \ + $(patsubst %.perl,%,$(SCRIPT_PERL)) \ + git-status git-instaweb +endif + # ... and all the rest that could be moved out of bindir to gitexecdir PROGRAMS = \ @@ -241,6 +254,9 @@ endif ifndef PERL_PATH PERL_PATH = /usr/bin/perl endif +ifndef PYTHON_PATH + PYTHON_PATH = /usr/local/bin/python +endif export PERL_PATH @@ -646,6 +662,7 @@ prefix_SQ = $(subst ','\'',$(prefix)) SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH)) PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH)) +PYTHON_PATH_SQ = $(subst ','\'',$(PYTHON_PATH)) LIBS = $(GITLIBS) $(EXTLIBS) @@ -699,6 +716,15 @@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh $(patsubst %.perl,%,$(SCRIPT_PERL)): perl/perl.mak +$(patsubst %.py,%,$(SCRIPT_PYTHON)) : % : %.py + rm -f $@ $@+ + sed -e '1s|#!.*/python|#!$(PYTHON_PATH_SQ)|' \ + -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ + -e 's/@@NO_CURL@@/$(NO_CURL)/g' \ + $@.py >$@+ + chmod +x $@+ + mv $@+ $@ + perl/perl.mak: GIT-CFLAGS $(QUIET_SUBDIR0)perl $(QUIET_SUBDIR1) PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' $(@F) From 7a585c0e6ad872af9a7b88c7c4760a2c606be1ec Mon Sep 17 00:00:00 2001 From: Eygene Ryabinkin Date: Tue, 27 Mar 2007 15:25:15 +0400 Subject: [PATCH 2/4] Added git-p4 package to the list of git RPMs. Signed-off-by: Eygene Ryabinkin Signed-off-by: Junio C Hamano --- git.spec.in | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/git.spec.in b/git.spec.in index 46aee88fd..e469f213d 100644 --- a/git.spec.in +++ b/git.spec.in @@ -50,6 +50,13 @@ Requires: git-core = %{version}-%{release}, tla %description arch Git tools for importing Arch repositories. +%package p4 +Summary: Git tools for importing Perforce repositories +Group: Development/Tools +Requires: git-core = %{version}-%{release}, python +%description p4 +Git tools for importing Perforce repositories. + %package email Summary: Git tools for sending email Group: Development/Tools @@ -86,22 +93,22 @@ Perl interface to Git %build make %{_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" WITH_OWN_SUBPROCESS_PY=YesPlease \ - prefix=%{_prefix} all %{!?_without_docs: doc} + WITH_P4IMPORT=YesPlease prefix=%{_prefix} all %{!?_without_docs: doc} %install rm -rf $RPM_BUILD_ROOT make %{_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" DESTDIR=$RPM_BUILD_ROOT \ - WITH_OWN_SUBPROCESS_PY=YesPlease \ + WITH_OWN_SUBPROCESS_PY=YesPlease WITH_P4IMPORT=YesPlease \ prefix=%{_prefix} mandir=%{_mandir} INSTALLDIRS=vendor \ install %{!?_without_docs: install-doc} 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 {} ';' -(find $RPM_BUILD_ROOT%{_bindir} -type f | grep -vE "archimport|svn|cvs|email|gitk|git-gui|git-citool" | sed -e s@^$RPM_BUILD_ROOT@@) > bin-man-doc-files +(find $RPM_BUILD_ROOT%{_bindir} -type f | grep -vE "p4import|archimport|svn|cvs|email|gitk|git-gui|git-citool" | sed -e s@^$RPM_BUILD_ROOT@@) > bin-man-doc-files (find $RPM_BUILD_ROOT%{perl_vendorlib} -type f | sed -e s@^$RPM_BUILD_ROOT@@) >> perl-files %if %{!?_without_docs:1}0 -(find $RPM_BUILD_ROOT%{_mandir} $RPM_BUILD_ROOT/Documentation -type f | grep -vE "archimport|svn|git-cvs|email|gitk|git-gui|git-citool" | sed -e s@^$RPM_BUILD_ROOT@@ -e 's/$/*/' ) >> bin-man-doc-files +(find $RPM_BUILD_ROOT%{_mandir} $RPM_BUILD_ROOT/Documentation -type f | grep -vE "p4import|archimport|svn|git-cvs|email|gitk|git-gui|git-citool" | sed -e s@^$RPM_BUILD_ROOT@@ -e 's/$/*/' ) >> bin-man-doc-files %else rm -rf $RPM_BUILD_ROOT%{_mandir} %endif @@ -133,6 +140,13 @@ rm -rf $RPM_BUILD_ROOT %{!?_without_docs: %{_mandir}/man1/git-archimport.1*} %{!?_without_docs: %doc Documentation/git-archimport.html } +%files p4 +%defattr(-,root,root) +%doc Documentation/git-p4import.txt +%{_bindir}/git-p4import +%{!?_without_docs: %{_mandir}/man1/git-p4import.1*} +%{!?_without_docs: %doc Documentation/git-p4import.html } + %files email %defattr(-,root,root) %doc Documentation/*email*.txt @@ -167,6 +181,9 @@ rm -rf $RPM_BUILD_ROOT %{!?_without_docs: %doc Documentation/*.html } %changelog +* Tue Mar 27 2007 Eygene Ryabinkin +- Added the git-p4 package: Perforce import stuff. + * Mon Feb 13 2007 Nicolas Pitre - Update core package description (Git isn't as stupid as it used to be) From 5250929d6010083779d334634dcd6766de045b1f Mon Sep 17 00:00:00 2001 From: Brian Gernhardt Date: Tue, 27 Mar 2007 12:03:43 -0400 Subject: [PATCH 3/4] Remove unused WITH_OWN_SUBPROCESS_PY from RPM spec We don't have a copy of subprocess.py anymore, so we removed that option from the Makefile. Let's not leave that cruft around the RPM spec file either. Signed-off-by: Junio C Hamano --- git.spec.in | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/git.spec.in b/git.spec.in index e469f213d..4bf7a8f61 100644 --- a/git.spec.in +++ b/git.spec.in @@ -92,15 +92,14 @@ Perl interface to Git %setup -q %build -make %{_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" WITH_OWN_SUBPROCESS_PY=YesPlease \ - WITH_P4IMPORT=YesPlease prefix=%{_prefix} all %{!?_without_docs: doc} +make %{_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" WITH_P4IMPORT=YesPlease \ + prefix=%{_prefix} all %{!?_without_docs: doc} %install rm -rf $RPM_BUILD_ROOT make %{_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" DESTDIR=$RPM_BUILD_ROOT \ - WITH_OWN_SUBPROCESS_PY=YesPlease WITH_P4IMPORT=YesPlease \ - prefix=%{_prefix} mandir=%{_mandir} INSTALLDIRS=vendor \ - install %{!?_without_docs: install-doc} + WITH_P4IMPORT=YesPlease prefix=%{_prefix} mandir=%{_mandir} \ + INSTALLDIRS=vendor install %{!?_without_docs: install-doc} 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 {} ';' From faced1af7112353bcb67e033cd2a4fb47e21b201 Mon Sep 17 00:00:00 2001 From: Eygene Ryabinkin Date: Thu, 29 Mar 2007 14:07:47 +0400 Subject: [PATCH 4/4] Added correct Python path to the RPM specfile. Signed-off-by: Eygene Ryabinkin Signed-off-by: Junio C Hamano --- git.spec.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/git.spec.in b/git.spec.in index 4bf7a8f61..1d3934bba 100644 --- a/git.spec.in +++ b/git.spec.in @@ -1,4 +1,7 @@ # Pass --without docs to rpmbuild if you don't want the documentation + +%define python_path /usr/bin/python + Name: git Version: @@VERSION@@ Release: 1%{?dist} @@ -93,12 +96,13 @@ Perl interface to Git %build make %{_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" WITH_P4IMPORT=YesPlease \ - prefix=%{_prefix} all %{!?_without_docs: doc} + prefix=%{_prefix} PYTHON_PATH=%{python_path} all %{!?_without_docs: doc} %install rm -rf $RPM_BUILD_ROOT make %{_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" DESTDIR=$RPM_BUILD_ROOT \ WITH_P4IMPORT=YesPlease prefix=%{_prefix} mandir=%{_mandir} \ + PYTHON_PATH=%{python_path} \ INSTALLDIRS=vendor install %{!?_without_docs: install-doc} find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} ';' find $RPM_BUILD_ROOT -type f -name '*.bs' -empty -exec rm -f {} ';'