{"thread":{"id":"35045","subject":"[PATCH] build: fix installation of scripts","startedAt":"2013-09-29T16:53:06Z","lastAt":"2013-09-29T16:53:06Z","messageCount":1,"participants":["Felipe Contreras"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"228456","messageId":"1380473586-4245-1-git-send-email-felipe.contreras@gmail.com","threadId":"35045","inReplyTo":null,"subject":"[PATCH] build: fix installation of scripts","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-09-29T16:53:06Z","receivedAt":"2013-09-29T16:53:06Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"They need the gitexecdir.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n\nOtherwise this makes it difficult to package contrib scripts in certain\ndistributions.\n\nFor example, if you have a proper Makefile in contrib:\n\n---\nTESTS := $(wildcard test*.sh)\nSCRIPTS := $(wildcard git-remote-*.py)\n\nexport T := $(addprefix $(CURDIR)/,$(TESTS))\nexport MAKE := $(MAKE) -e\nexport PATH := $(CURDIR):$(PATH)\nexport TEST_LINT := test-lint-executable test-lint-shell-syntax\n\nexport SCRIPT_PYTHON := $(addprefix $(CURDIR)/,$(SCRIPTS))\n\nall: $(SCRIPTS)\n\t$(MAKE) -C ../.. build-python-script\n\ninstall:\n\t$(MAKE) -C ../.. install-python-script\n\ntest: all\n\t$(MAKE) -C ../../t $@\n\n$(TESTS): all\n\t$(MAKE) -C ../../t $(CURDIR)/$@\n\n.PHONY: all install test $(TESTS)\n---\n\nA packager might create a git-bzr package that does this:\n\n% make -C contrib/remote-helpers install\n\nBut that would fail, unless this patch is applied.\n\nDistributions like Arch Linux don't have a concept of multiple binary packages\nfrom a single source package, so there would need to be a separate PKGBUILD\n(akin to spec file) for git-bzr. In addition this package might not be\nofficial, but part of the user maintained AUR. Similarly, other distributions\nmight want to package git-bzr separetly, for example from launchpad.\n\n Makefile | 10 ++++++----\n 1 file changed, 6 insertions(+), 4 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 3588ca1..e51b92e 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -511,12 +511,14 @@ build-perl-script: $(SCRIPT_PERL_GEN)\n build-sh-script: $(SCRIPT_SH_GEN)\n build-python-script: $(SCRIPT_PYTHON_GEN)\n \n-.PHONY: install-perl-script install-sh-script install-python-script\n-install-sh-script: $(SCRIPT_SH_INS)\n+.PHONY: install-gitexecdir install-perl-script install-sh-script install-python-script\n+install-gitexecdir:\n+\t$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'\n+install-sh-script: $(SCRIPT_SH_INS) | install-gitexecdir\n \t$(INSTALL) $^ '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'\n-install-perl-script: $(SCRIPT_PERL_INS)\n+install-perl-script: $(SCRIPT_PERL_INS) | install-gitexecdir\n \t$(INSTALL) $^ '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'\n-install-python-script: $(SCRIPT_PYTHON_INS)\n+install-python-script: $(SCRIPT_PYTHON_INS) | install-gitexecdir\n \t$(INSTALL) $^ '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'\n \n .PHONY: clean-perl-script clean-sh-script clean-python-script\n-- \n1.8.4-fc\n"}]}