$NetBSD: patch-Makefile,v 1.4 2019/06/09 16:15:32 ryoon Exp $

Do not override compiler/linker flags.
Provide proper path for Perl module.
Do not install git-p4 (requires Python).
Fix tar operations.

--- Makefile.orig	2019-06-07 18:37:32.000000000 +0000
+++ Makefile
@@ -539,7 +539,7 @@ gitexecdir = libexec/git-core
 mergetoolsdir = $(gitexecdir)/mergetools
 sharedir = $(prefix)/share
 gitwebdir = $(sharedir)/gitweb
-perllibdir = $(sharedir)/perl5
+perllibdir = ${PERLLIBDIR}
 localedir = $(sharedir)/locale
 template_dir = share/git-core/templates
 htmldir = $(prefix)/share/doc/git-doc
@@ -560,13 +560,9 @@ perllibdir_relative = $(patsubst $(prefi
 export prefix bindir sharedir sysconfdir gitwebdir perllibdir localedir
 
 # Set our default programs
-CC = cc
-AR = ar
 RM = rm -f
 DIFF = diff
-TAR = tar
 FIND = find
-INSTALL = install
 TCL_PATH = tclsh
 TCLTK_PATH = wish
 XGETTEXT = xgettext
@@ -671,7 +667,6 @@ clean-python-script:
 
 SCRIPTS = $(SCRIPT_SH_GEN) \
 	  $(SCRIPT_PERL_GEN) \
-	  $(SCRIPT_PYTHON_GEN) \
 	  git-instaweb
 
 ETAGS_TARGET = TAGS
@@ -2024,8 +2019,8 @@ PAGER_ENV_CQ = "$(subst ",\",$(subst \,\
 PAGER_ENV_CQ_SQ = $(subst ','\'',$(PAGER_ENV_CQ))
 BASIC_CFLAGS += -DPAGER_ENV='$(PAGER_ENV_CQ_SQ)'
 
-ALL_CFLAGS += $(BASIC_CFLAGS)
-ALL_LDFLAGS += $(BASIC_LDFLAGS)
+ALL_CFLAGS = $(BASIC_CFLAGS) $(CPPFLAGS) $(CFLAGS)
+ALL_LDFLAGS = $(BASIC_LDFLAGS) $(LDFLAGS)
 
 export DIFF TAR INSTALL DESTDIR SHELL_PATH
 
@@ -2879,13 +2874,12 @@ install: all
 ifndef NO_GETTEXT
 	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(localedir_SQ)'
 	(cd po/build/locale && $(TAR) cf - .) | \
-	(cd '$(DESTDIR_SQ)$(localedir_SQ)' && umask 022 && $(TAR) xof -)
+	(cd '$(DESTDIR_SQ)$(localedir_SQ)' && umask 022 && $(TAR) xf -)
 endif
 ifndef NO_PERL
 	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perllibdir_SQ)'
 	(cd perl/build/lib && $(TAR) cf - .) | \
-	(cd '$(DESTDIR_SQ)$(perllibdir_SQ)' && umask 022 && $(TAR) xof -)
-	$(MAKE) -C gitweb install
+	(cd '$(DESTDIR_SQ)$(perllibdir_SQ)' && umask 022 && $(TAR) xf -)
 endif
 ifndef NO_TCLTK
 	$(MAKE) -C gitk-git install
@@ -2952,7 +2946,7 @@ install-man: install-man-perl
 install-man-perl: man-perl
 	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(mandir_SQ)/man3'
 	(cd perl/build/man/man3 && $(TAR) cf - .) | \
-	(cd '$(DESTDIR_SQ)$(mandir_SQ)/man3' && umask 022 && $(TAR) xof -)
+	(cd '$(DESTDIR_SQ)$(mandir_SQ)/man3' && umask 022 && $(TAR) xf -)
 
 install-html:
 	$(MAKE) -C Documentation install-html
