git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] build: fix installation of scripts

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Sep 29, 2013, 16:53 UTC
Message-ID
<1380473586-4245-1-git-send-email-felipe.contreras@gmail.com>
They need the gitexecdir.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---

Otherwise this makes it difficult to package contrib scripts in certain distributions.

For example, if you have a proper Makefile in contrib:

--- TESTS := $(wildcard test*.sh) SCRIPTS := $(wildcard git-remote-*.py)

export T := $(addprefix $(CURDIR)/,$(TESTS)) export MAKE := $(MAKE) -e export PATH := $(CURDIR):$(PATH) export TEST_LINT := test-lint-executable test-lint-shell-syntax

export SCRIPT_PYTHON := $(addprefix $(CURDIR)/,$(SCRIPTS))
all: $(SCRIPTS)
	$(MAKE) -C ../.. build-python-script
install:
	$(MAKE) -C ../.. install-python-script
test: all
	$(MAKE) -C ../../t $@
$(TESTS): all
	$(MAKE) -C ../../t $(CURDIR)/$@

.PHONY: all install test $(TESTS) ---

A packager might create a git-bzr package that does this:
% make -C contrib/remote-helpers install
But that would fail, unless this patch is applied.

Distributions like Arch Linux don't have a concept of multiple binary packages from a single source package, so there would need to be a separate PKGBUILD (akin to spec file) for git-bzr. In addition this package might not be official, but part of the user maintained AUR. Similarly, other distributions might want to package git-bzr separetly, for example from launchpad.

 Makefile | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index 3588ca1..e51b92e 100644
--- a/Makefile
+++ b/Makefile
@@ -511,12 +511,14 @@ build-perl-script: $(SCRIPT_PERL_GEN)
 build-sh-script: $(SCRIPT_SH_GEN)
 build-python-script: $(SCRIPT_PYTHON_GEN)
 
-.PHONY: install-perl-script install-sh-script install-python-script
-install-sh-script: $(SCRIPT_SH_INS)
+.PHONY: install-gitexecdir install-perl-script install-sh-script install-python-script
+install-gitexecdir:
+	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
+install-sh-script: $(SCRIPT_SH_INS) | install-gitexecdir
 	$(INSTALL) $^ '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
-install-perl-script: $(SCRIPT_PERL_INS)
+install-perl-script: $(SCRIPT_PERL_INS) | install-gitexecdir
 	$(INSTALL) $^ '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
-install-python-script: $(SCRIPT_PYTHON_INS)
+install-python-script: $(SCRIPT_PYTHON_INS) | install-gitexecdir
 	$(INSTALL) $^ '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
 
 .PHONY: clean-perl-script clean-sh-script clean-python-script
-- 
1.8.4-fc
Message 1 of 1 in “build: fix installation of scripts”
  1. build: fix installation of scriptsFelipe Contreras, Sep 29, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.