gitweb/Makefile: add a "NO_GITWEB" parameter

From looking at the {Free,Net,Dragonfly}BSD packages for git[1] they've been monkeypatching "gitweb" out of the Makefile, let's be nicer and provide a NO_GITWEB=Y for their use. For the "all" target this allows for optionally restoring what's been the status quo before the preceding commit, but now we'll also behave correctly on the subsequent "make install". As before our installation of gitweb can be suppressed with NO_PERL. For backwards compatibility the NO_PERL=Y flag by itself still doesn't change whether or not we build gitweb, unlike the new NO_GITWEB=Y flag. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ævar Arnfjörð Bjarmason committed Jun 28, 2022 at 12:16 UTC a35258c62adf5c0e591f2335f3427434ff0b63f0
2 files changed +9
Makefile
+7
@@ -309,6 +309,11 @@ include shared.mak
309 # distributions that want to use their packaged versions of Perl
310 # modules, instead of the fallbacks shipped with Git.
311 #
312 +# Define NO_GITWEB if you do not want to build or install
313 +# 'gitweb'. Note that defining NO_PERL currently has the same effect
314 +# on not installing gitweb, but not on whether it's built in the
315 +# gitweb/ directory.
316 +#
317 # Define PYTHON_PATH to the path of your Python binary (often /usr/bin/python
318 # but /usr/bin/python2.7 or /usr/bin/python3 on some platforms).
319 #
@@ -3042,7 +3047,9 @@ include gitweb/Makefile
3047
3048 .PHONY: gitweb
3049 gitweb: $(MAK_DIR_GITWEB_ALL)
3050 +ifndef NO_GITWEB
3051 all:: gitweb
3052 +endif
3053
3054 ### Installation rules
3055
gitweb/Makefile
+2
@@ -130,9 +130,11 @@ install-gitweb: $(MAK_DIR_GITWEB_ALL)
130 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitwebstaticdir_SQ)'
131 $(INSTALL) -m 644 $(addprefix $(MAK_DIR_GITWEB),$(GITWEB_FILES)) \
132 '$(DESTDIR_SQ)$(gitwebstaticdir_SQ)'
133 +ifndef NO_GITWEB
134 ifndef NO_PERL
135 install: install-gitweb
136 endif
137 +endif
138
139 ### Cleaning rules
140